diff --git a/roles/common/tasks/mail.yml b/roles/common/tasks/mail.yml index a135544..084107d 100644 --- a/roles/common/tasks/mail.yml +++ b/roles/common/tasks/mail.yml @@ -1,11 +1,15 @@ --- -- name: Configure root email forward - lineinfile: - dest: /etc/aliases - regexp: "^root:.*" - line: "root: {{ system_admin_email }}" - notify: newaliases - when: system_admin_email is defined +- when: system_admin_email is defined + block: + - name: Install postfix + package: name=postfix + + - name: Configure root email forward + lineinfile: + dest: /etc/aliases + regexp: "^root:.*" + line: "root: {{ system_admin_email }}" + notify: newaliases ...