ipabackup: Fix undefined vars for conditions in shell tasks without else

The use of conditions in shell tasks without else clause is failing on
some systems with an undefined variable error.
This commit is contained in:
Thomas Woerner
2020-12-01 14:33:42 +01:00
parent 06d73ba8df
commit 923208b98c
2 changed files with 22 additions and 22 deletions

View File

@@ -4,13 +4,13 @@
- name: Create backup
shell: >
ipa-backup
{{ "--gpg" if ipabackup_gpg | bool }}
{{ "--gpg-keyring="+ipabackup_gpg_keyring if ipabackup_gpg_keyring is defined }}
{{ "--data" if ipabackup_data | bool }}
{{ "--logs" if ipabackup_logs | bool }}
{{ "--online" if ipabackup_online | bool }}
{{ "--disable-role-check" if ipabackup_disable_role_check | bool }}
{{ "--log-file="+ipabackup_log_file if ipabackup_log_file is defined }}
{{ "--gpg" if ipabackup_gpg | bool else "" }}
{{ "--gpg-keyring="+ipabackup_gpg_keyring if ipabackup_gpg_keyring is defined else "" }}
{{ "--data" if ipabackup_data | bool else "" }}
{{ "--logs" if ipabackup_logs | bool else "" }}
{{ "--online" if ipabackup_online | bool else "" }}
{{ "--disable-role-check" if ipabackup_disable_role_check | bool else "" }}
{{ "--log-file="+ipabackup_log_file if ipabackup_log_file is defined else "" }}
register: result_ipabackup
- block: