check if var is defined

This commit is contained in:
2023-01-30 10:59:37 +01:00
parent 59d9acab13
commit 75a73b9af5

View File

@@ -8,17 +8,23 @@
- block:
- include_tasks: install_postfix.yml
- include_tasks: configure_postfix.yml
when: postfix == true
when:
- postfix is defined
- postfix == true
- block:
- include_tasks: install_dovecot.yml
- include_tasks: configure_dovecot.yml
when: dovecot == true
when:
- dovecot is defined
- dovecot == true
- block:
- include_tasks: install_fetchmail.yml
- include_tasks: configure_fetchmail.yml
when: fetchmail == true
when:
- fetchmail is defined
- fetchmail == true
rescue:
- set_fact: task_failed=true