summaryrefslogtreecommitdiffstats
path: root/roles/common
diff options
context:
space:
mode:
Diffstat (limited to 'roles/common')
-rw-r--r--roles/common/handlers/main.yml1
-rw-r--r--roles/common/tasks/mail.yml6
2 files changed, 3 insertions, 4 deletions
diff --git a/roles/common/handlers/main.yml b/roles/common/handlers/main.yml
index d20f7b6..13712fe 100644
--- a/roles/common/handlers/main.yml
+++ b/roles/common/handlers/main.yml
@@ -12,26 +12,25 @@
service: name=samhain state=reloaded
- name: Update rkhunter's data file
command: /usr/bin/rkhunter --propupd
- name: Restart fail2ban
service: name=fail2ban state=restarted
- name: Reload networking
# /etc/init.d/networking doesn't answer the status command; but since
# it should be "up" whenever ansible has access to the machine, we use
# pattern=init as a dummy assumption.
service: name=networking pattern=init state=reloaded
- name: Restart rsyslog
service: name=rsyslog state=restarted
- name: Restart ntp
service: name=ntp state=restarted
-# TODO: should be in a separate file, since it's used by other roles
- name: Restart Postfix
service: name=postfix state=restarted
- name: Reload Postfix
service: name=postfix state=reloaded
diff --git a/roles/common/tasks/mail.yml b/roles/common/tasks/mail.yml
index 3b2a41f..cbec8cf 100644
--- a/roles/common/tasks/mail.yml
+++ b/roles/common/tasks/mail.yml
@@ -15,51 +15,51 @@
- Restart Postfix
- name: Link the dynamic maps & master.cf of each children to the master's
# main.cf is specialized to each dedicated role, though
file: src=../postfix/{{ item.1 }}
dest=/etc/postfix-{{ postfix_instance[item.0].name }}/{{ item.1 }}
owner=root group=root
state=link force=yes
register: r2
with_nested:
- postfix_instance.keys() | intersect(group_names) | list
- [ 'dynamicmaps.cf', 'master.cf' ]
notify:
- Restart Postfix
- name: Configure Postfix (1)
copy: src=etc/postfix/master.cf
dest=/etc/postfix/master.cf
owner=root group=root
mode=0644
+ register: r3
notify:
- - Reload Postfix
+ - Restart Postfix
- name: Configure Postfix (2)
template: src=etc/postfix/main.cf.j2
dest=/etc/postfix/main.cf
owner=root group=root
mode=0644
- register: r3
notify:
- - Restart Postfix
+ - Reload Postfix
- name: Create directory /etc/postfix/ssl
file: path=/etc/postfix/ssl
state=directory
owner=root group=root
mode=0755
tags:
- genkey
- name: Generate a private key and a X.509 certificate for Postfix
command: genkeypair.sh x509
--pubkey=/etc/postfix/ssl/{{ ansible_fqdn }}.pem
--privkey=/etc/postfix/ssl/{{ ansible_fqdn }}.key
--dns={{ ansible_fqdn }}
-t ecdsa -b secp384r1 -h sha512
register: r4
changed_when: r4.rc == 0
failed_when: r4.rc > 1
tags:
- genkey