clone from private repo
This commit is contained in:
commit
c0ae983acb
48 changed files with 2766 additions and 0 deletions
79
mail_system/tasks/postfix.yml
Normal file
79
mail_system/tasks/postfix.yml
Normal file
|
|
@ -0,0 +1,79 @@
|
|||
- name: install postfix packages
|
||||
apt:
|
||||
name: postfix,postfix-pgsql,postfix-doc
|
||||
state: present
|
||||
update_cache: yes
|
||||
install_recommends: no
|
||||
|
||||
- name: divert /etc/postfix/main.cf
|
||||
shell: dpkg-divert --add --rename --divert /etc/postfix/main.cf.orig /etc/postfix/main.cf
|
||||
|
||||
- name: divert /etc/postfix/master.cf
|
||||
shell: dpkg-divert --add --rename --divert /etc/postfix/master.cf.orig /etc/postfix/master.cf
|
||||
|
||||
- name: group 'mailstore'
|
||||
group:
|
||||
name: mailstore
|
||||
state: present
|
||||
system: yes
|
||||
gid: 5000
|
||||
|
||||
- name: user 'mailstore'
|
||||
user:
|
||||
name: mailstore
|
||||
group: mailstore
|
||||
state: present
|
||||
system: yes
|
||||
uid: 5000
|
||||
create_home: no
|
||||
home: /srv/mailstore
|
||||
password: '!'
|
||||
password_lock: yes
|
||||
comment: created by ansible
|
||||
|
||||
- name: directories /srv/mailstore /srv/mailstore/role_specific
|
||||
file:
|
||||
path: "{{ item }}"
|
||||
state: directory
|
||||
owner: mailstore
|
||||
group: mailstore
|
||||
mode: 0755
|
||||
loop:
|
||||
- /srv/mailstore
|
||||
- /srv/mailstore/role_specific
|
||||
- /srv/mailstore/role_specific/roles
|
||||
|
||||
- name: postfix configuration files
|
||||
template:
|
||||
src: "postfix/{{ item }}"
|
||||
dest: "/etc/postfix/{{ item }}"
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
force: "{{ mailserver.postfix.overwrite_config }}"
|
||||
loop:
|
||||
- main.cf
|
||||
- master.cf
|
||||
- header_checks
|
||||
|
||||
- name: postfix database queries
|
||||
template:
|
||||
src: "postfix/{{ item }}"
|
||||
dest: "/etc/postfix/{{ item }}"
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0600
|
||||
force: yes
|
||||
loop:
|
||||
- domains.cf
|
||||
- mailboxes.cf
|
||||
- aliases.cf
|
||||
- email_existence_check.cf
|
||||
- relay_domains.cf
|
||||
- relay_recipient_maps.cf
|
||||
- transport_maps.cf
|
||||
|
||||
- name: restart postfix
|
||||
systemd:
|
||||
name: postfix
|
||||
state: restarted
|
||||
Loading…
Add table
Add a link
Reference in a new issue