Add postfix ansible roll
This commit is contained in:
20
ansible/roles/postfix/tasks/configure.yml
Normal file
20
ansible/roles/postfix/tasks/configure.yml
Normal file
@@ -0,0 +1,20 @@
|
||||
---
|
||||
- name: Copy postfix configuration template
|
||||
template: src=files/postfix/main.cf dest=/etc/postfix/main.cf
|
||||
|
||||
- name: Copy postfix sasl_passwd
|
||||
template: src=files/postfix/sasl_passwd dest=/etc/postfix/sasl/sasl_passwd
|
||||
|
||||
- name: Copy init-mail.sh script to remote hosts
|
||||
copy: src=files/postfix/init-mail.sh dest=/etc/postfix/init-mail.sh
|
||||
|
||||
- name: Touch a file, using symbolic modes to set the permissions (equivalent to 0644)
|
||||
file:
|
||||
path: /etc/postfix/init-mail.sh
|
||||
state: touch
|
||||
mode: u=rwx,g=rwx,o=rwx
|
||||
|
||||
- name: Run script to initialize postfix
|
||||
script: files/postfix/init-mail.sh
|
||||
notify:
|
||||
- restart postfix
|
||||
4
ansible/roles/postfix/tasks/install.yml
Normal file
4
ansible/roles/postfix/tasks/install.yml
Normal file
@@ -0,0 +1,4 @@
|
||||
---
|
||||
- name: Install packages
|
||||
apt: name="{{ item }}" state=latest
|
||||
with_items: "{{ packages }}"
|
||||
7
ansible/roles/postfix/tasks/main.yml
Normal file
7
ansible/roles/postfix/tasks/main.yml
Normal file
@@ -0,0 +1,7 @@
|
||||
---
|
||||
# tasks file for /etc/ansible/roles/nginx
|
||||
|
||||
- import_tasks: install.yml
|
||||
- import_tasks: configure.yml
|
||||
- import_tasks: service.yml
|
||||
|
||||
3
ansible/roles/postfix/tasks/service.yml
Normal file
3
ansible/roles/postfix/tasks/service.yml
Normal file
@@ -0,0 +1,3 @@
|
||||
---
|
||||
- name: Start and enable postfix service
|
||||
service: name=postfix state=restarted enabled=yes
|
||||
Reference in New Issue
Block a user