Add postfix ansible roll

This commit is contained in:
2020-04-23 01:44:57 +00:00
parent 00259b25a1
commit 5a1f098597
13 changed files with 207 additions and 0 deletions

View 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

View File

@@ -0,0 +1,4 @@
---
- name: Install packages
apt: name="{{ item }}" state=latest
with_items: "{{ packages }}"

View File

@@ -0,0 +1,7 @@
---
# tasks file for /etc/ansible/roles/nginx
- import_tasks: install.yml
- import_tasks: configure.yml
- import_tasks: service.yml

View File

@@ -0,0 +1,3 @@
---
- name: Start and enable postfix service
service: name=postfix state=restarted enabled=yes