Pour tout problème contactez-nous par mail : support@froggit.fr | La FAQ :grey_question: | Rejoignez-nous sur le Chat :speech_balloon:

Skip to content
Snippets Groups Projects
Commit 2ec9d974 authored by Arthur BOUDREAULT's avatar Arthur BOUDREAULT
Browse files

refactor: add default vars

parent d78cc359
No related branches found
No related tags found
1 merge request!39Resolve "refactor: improve backup usage README"
......@@ -20,7 +20,7 @@
- name: Fail if variables are not used correctly
ansible.builtin.fail:
msg: You need to define variable ynh_backup.apps and / or ynh_backup.system to True
when: ynh_backup.apps | default(False) is false and ynh_backup.system | default(False) is false
when: ynh_backup.apps | default(True) is false and ynh_backup.system | default(True) is false
tags: backup
- name: Create backup folder if doesn't already exist
......
......@@ -13,7 +13,7 @@ _fail() {
_create_ynh_backup() {
echo "Backing up $today YunoHost data now."
yunohost backup create {% if ynh_backup.system|default(ynh_backup.system == true) %}--system{% endif %}{% if ynh_backup.apps|default(ynh_backup.apps == true) %} --apps{% endif %}{% if ynh_backup.directory|default(ynh_backup.directory == "/data/backup") %} --output-directory {{ ynh_backup.directory }}/backup_"$today" {% endif %} || _fail "can't create a backup"
yunohost backup create {% if ynh_backup.system | default(True) %}--system{% endif %}{% if ynh_backup.apps | default(True) %} --apps{% endif %}{% if ynh_backup.directory | default("/data/backup") %} --output-directory {{ ynh_backup.directory }}/backup_"$today" {% endif %} || _fail "can't create a backup"
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment