debconf: >
name=postfix
question=postfix/mailname
- value="{{ inventory_hostname }}"
+ value="{{ postfix_mailname }}"
vtype=select
- name: configure Postfix "destinations"
debconf: >
name=postfix
question=postfix/destinations
- value="$myhostname, localhost.$mydomain, localhost"
+ value="{{ postfix_mailname }}, $myhostname, localhost.$mydomain, localhost"
vtype=select
- name: install "postfix" package
template: >
dest=/etc/mailname
group=root
- mode=644
+ mode=0644
owner=root
src=mailname.j2
notify:
dest=/etc/postfix/main.cf
group=root
line="myorigin = /etc/mailname"
- mode=644
+ mode=0644
owner=root
regexp="^myorigin"
notify:
dest=/etc/postfix/main.cf
group=root
line="myhostname = {{ inventory_hostname }}"
- mode=644
+ mode=0644
owner=root
regexp="^myhostname"
notify:
- restart "postfix"
-- name: ensure service "postfix" is enabled and running
+- name: ensure service "postfix" is enabled and started
tags:
- mail
- postfix
service: >
enabled=yes
name=postfix
- state=running
+ state=started