Initial commit

This commit is contained in:
2022-06-26 19:46:33 +02:00
commit 818d34657c
106 changed files with 1390 additions and 0 deletions

View File

@@ -0,0 +1,6 @@
- name: Configure Postfix
template:
src: main.cf.j2
dest: /etc/postfix/main.cf
notify: Activate and restart Postfix

View File

@@ -0,0 +1,6 @@
- name: Copy alisases
copy:
src: aliases
dest: /etc/aliases
notify: Generate aliases

View File

@@ -0,0 +1,7 @@
- name: Copy Postfix authentication
template:
src: sasl_passwd.j2
dest: /etc/postfix/sasl_passwd
mode: 0600
notify: Generate SASL

View File

@@ -0,0 +1,6 @@
- name: Copy sender_canonical
template:
src: sender_canonical.j2
dest: /etc/postfix/sender_canonical
notify: Generate sender_canonical

View File

@@ -0,0 +1,9 @@
- name: Install Postfix and s-nail
package:
state: present
name: "{{ item }}"
with_items:
- postfix
- s-nail
notify: Activate and restart Postfix

View File

@@ -0,0 +1,15 @@
- name: Check that a username and password is supplied
assert:
that:
- (relay_user is defined) and (relay_user is not none)
- (relay_password is defined) and
(relay_password is not none)
fail_msg: "'relay_user' and 'relay_password' must be set"
success_msg: "username and password for relay is set"
- import_tasks: install-postfix.yml
- import_tasks: configure-postfix.yml
- import_tasks: copy-postfix-auth.yml
- import_tasks: copy-aliases.yml
- import_tasks: copy-sender-canonical.yml