This commit is contained in:
parent
4263d1be5a
commit
2059989d8a
4 changed files with 62 additions and 12 deletions
|
|
@ -8,11 +8,19 @@
|
|||
- postfix_mydestination is defined
|
||||
|
||||
- name: install packages
|
||||
package: name="{{ postfix_packages }}" state=latest update_cache=yes
|
||||
package:
|
||||
name: "{{ postfix_packages }}"
|
||||
state: present
|
||||
update_cache: yes
|
||||
notify: Restart postfix
|
||||
|
||||
- name: Deploy templates
|
||||
template: src=etc/postfix/{{ item }}.j2 dest=/etc/postfix/{{ item }} owner=root group=root mode=0644
|
||||
template:
|
||||
src: etc/postfix/{{ item }}.j2
|
||||
dest: /etc/postfix/{{ item }}
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
with_items:
|
||||
- main.cf
|
||||
- master.cf
|
||||
|
|
@ -74,7 +82,10 @@
|
|||
- postfix_mydestination is defined
|
||||
|
||||
- name: Enable postfix at boot time
|
||||
service: name=postfix enabled=yes state=started
|
||||
service:
|
||||
name: postfix
|
||||
enabled: yes
|
||||
state: started
|
||||
when:
|
||||
- postfix_mydestination is defined
|
||||
|
||||
|
|
|
|||
|
|
@ -3,10 +3,20 @@
|
|||
# Need EPEL repo
|
||||
|
||||
- name: Make {{ postfix_mydomain }} keys directory
|
||||
file: path=/etc/opendkim/keys/{{ postfix_mydomain }} state=directory owner=opendkim group=opendkim mode=0750
|
||||
file:
|
||||
path: /etc/opendkim/keys/{{ postfix_mydomain }}
|
||||
state: directory
|
||||
owner: opendkim
|
||||
group: opendkim
|
||||
mode: 0750
|
||||
|
||||
- name: Install template config file
|
||||
template: src=etc/{{ item }}.j2 dest=/etc/{{ item }} owner=opendkim group=opendkim mode=0640
|
||||
template:
|
||||
src: etc/{{ item }}.j2
|
||||
dest: /etc/{{ item }}
|
||||
owner: opendkim
|
||||
group: opendkim
|
||||
mode: 0640
|
||||
with_items:
|
||||
- opendkim.conf
|
||||
- opendkim/SigningTable
|
||||
|
|
@ -18,7 +28,12 @@
|
|||
# opendkim-genkey -D /etc/opendkim/keys/{{ postfix_mydomain }}/ -d {{ postfix_mydomain }} -s default
|
||||
|
||||
- name: Copy specifics files
|
||||
copy: src=etc/opendkim/keys/{{ postfix_mydomain }}/{{ item }} dest=/etc/opendkim/keys/{{ postfix_mydomain }}/{{ item }} owner=opendkim group=opendkim mode=0600
|
||||
copy:
|
||||
src: etc/opendkim/keys/{{ postfix_mydomain }}/{{ item }}
|
||||
dest: /etc/opendkim/keys/{{ postfix_mydomain }}/{{ item }}
|
||||
owner: opendkim
|
||||
group: opendkim
|
||||
mode: 0600
|
||||
with_items:
|
||||
- default.private
|
||||
- default.txt
|
||||
|
|
@ -27,5 +42,8 @@
|
|||
# Add /etc/opendkim/keys/{{ postfix_mydomain }}/default.txt in DNS zone
|
||||
|
||||
- name: Enable OpenDKIM on boot
|
||||
service: name=opendkim state=started enabled=yes
|
||||
service:
|
||||
name: opendkim
|
||||
state: started
|
||||
enabled: yes
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,12 @@
|
|||
# Need EPEL repo
|
||||
|
||||
- name: Install template config file
|
||||
template: src=etc/opendmarc.conf.j2 dest=/etc/opendmarc.conf owner=root group=root mode=0644
|
||||
template:
|
||||
src: etc/opendmarc.conf.j2
|
||||
dest: /etc/opendmarc.conf
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
|
||||
- name: Install update public_suffix_list file for opendmarc
|
||||
get_url:
|
||||
|
|
@ -14,9 +19,17 @@
|
|||
mode: 0644
|
||||
|
||||
- name: Install updater script
|
||||
copy: src=etc/cron.weekly/opendmarc dest=/etc/cron.weekly/opendmarc owner=root group=root mode=0755
|
||||
copy:
|
||||
src: etc/cron.weekly/opendmarc
|
||||
dest: /etc/cron.weekly/opendmarc
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0755
|
||||
notify: Restart OpenDMARC
|
||||
|
||||
- name: Enable OpenDMARC on boot
|
||||
service: name=opendmarc state=started enabled=yes
|
||||
service:
|
||||
name: opendmarc
|
||||
state: started
|
||||
enabled: yes
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,13 @@
|
|||
- name: Install script to update postgrey whitelist
|
||||
copy: src=usr/local/sbin/update_postgrey_whitelist.sh dest=/usr/local/sbin/update_postgrey_whitelist.sh owner=root group=root mode=0755
|
||||
copy:
|
||||
src: usr/local/sbin/update_postgrey_whitelist.sh
|
||||
dest: /usr/local/sbin/update_postgrey_whitelist.sh
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0755
|
||||
|
||||
- name: Enable postgrey at boot time
|
||||
service: name=postgrey enabled=yes state=started
|
||||
service:
|
||||
name: postgrey
|
||||
enabled: yes
|
||||
state: started
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue