From ae89800f1fd5083585cd879ac26b32eb5c458170 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Fri, 5 Jul 2024 21:00:30 +0200 Subject: move postfix rules to mail subdir --- dan/sk-cloudio.yml | 2 +- dan/sk-tomnext-nc.yml | 2 +- roles/mail/postfix/base/defaults/main.yml | 18 ++++++++++++++++++ roles/mail/postfix/base/handlers/main.yml | 5 +++++ roles/mail/postfix/base/tasks/main.yml | 22 ++++++++++++++++++++++ roles/postfix/base/defaults/main.yml | 18 ------------------ roles/postfix/base/handlers/main.yml | 5 ----- roles/postfix/base/tasks/main.yml | 22 ---------------------- 8 files changed, 47 insertions(+), 47 deletions(-) create mode 100644 roles/mail/postfix/base/defaults/main.yml create mode 100644 roles/mail/postfix/base/handlers/main.yml create mode 100644 roles/mail/postfix/base/tasks/main.yml delete mode 100644 roles/postfix/base/defaults/main.yml delete mode 100644 roles/postfix/base/handlers/main.yml delete mode 100644 roles/postfix/base/tasks/main.yml diff --git a/dan/sk-cloudio.yml b/dan/sk-cloudio.yml index 244c771c..15e8bfec 100644 --- a/dan/sk-cloudio.yml +++ b/dan/sk-cloudio.yml @@ -19,7 +19,7 @@ - role: kubernetes/standalone/base - role: x509/acmetool/base - role: nginx/base - - role: postfix/base + - role: mail/postfix/base - role: apps/nextcloud - role: apps/collabora/code - role: apps/onlyoffice diff --git a/dan/sk-tomnext-nc.yml b/dan/sk-tomnext-nc.yml index b8a6dc13..9b756a18 100644 --- a/dan/sk-tomnext-nc.yml +++ b/dan/sk-tomnext-nc.yml @@ -18,7 +18,7 @@ - role: kubernetes/standalone/base - role: x509/acmetool/base - role: nginx/base - - role: postfix/base + - role: mail/postfix/base - role: apps/nextcloud - role: apps/collabora/code - role: apps/onlyoffice diff --git a/roles/mail/postfix/base/defaults/main.yml b/roles/mail/postfix/base/defaults/main.yml new file mode 100644 index 00000000..a0c85d46 --- /dev/null +++ b/roles/mail/postfix/base/defaults/main.yml @@ -0,0 +1,18 @@ +--- +postfix_base_mydestination: + - "$myhostname" + - "{{ host_name }}.{{ host_domain }}" + - "localhost" + +postfix_base_mynetworks: + - "127.0.0.0/8" + - "[::ffff:127.0.0.0]/104" + - "[::1]/128" + +postfix_base_inet_interfaces: + - "loopback-only" + +postfix_base_inet_protocols: + - "all" + +postfix_base_relayhost: "" diff --git a/roles/mail/postfix/base/handlers/main.yml b/roles/mail/postfix/base/handlers/main.yml new file mode 100644 index 00000000..bea754c9 --- /dev/null +++ b/roles/mail/postfix/base/handlers/main.yml @@ -0,0 +1,5 @@ +--- +- name: restart postfix + service: + name: postfix + state: restarted diff --git a/roles/mail/postfix/base/tasks/main.yml b/roles/mail/postfix/base/tasks/main.yml new file mode 100644 index 00000000..8cb55fe0 --- /dev/null +++ b/roles/mail/postfix/base/tasks/main.yml @@ -0,0 +1,22 @@ +--- +- name: install postfix package + apt: + name: postfix + state: present + +- name: basic postfix options + vars: + postfix_options: + mydestination: "{{ postfix_base_mydestination | join(', ') }}" + mynetworks: "{{ postfix_base_mynetworks | join(', ') }}" + relayhost: "{{ postfix_base_relayhost }}" + inet_interfaces: "{{ postfix_base_inet_interfaces | join(', ') }}" + inet_protocols: "{{ postfix_base_inet_protocols | join(', ') }}" + loop: "{{ postfix_options | dict2items }}" + loop_control: + label: "{{ item.key }} = {{ item.value }}" + lineinfile: + regexp: "^#?\\s*{{ item.key }}\\s*=" + line: "{{ item.key }} = {{ item.value }}" + dest: /etc/postfix/main.cf + notify: restart postfix diff --git a/roles/postfix/base/defaults/main.yml b/roles/postfix/base/defaults/main.yml deleted file mode 100644 index a0c85d46..00000000 --- a/roles/postfix/base/defaults/main.yml +++ /dev/null @@ -1,18 +0,0 @@ ---- -postfix_base_mydestination: - - "$myhostname" - - "{{ host_name }}.{{ host_domain }}" - - "localhost" - -postfix_base_mynetworks: - - "127.0.0.0/8" - - "[::ffff:127.0.0.0]/104" - - "[::1]/128" - -postfix_base_inet_interfaces: - - "loopback-only" - -postfix_base_inet_protocols: - - "all" - -postfix_base_relayhost: "" diff --git a/roles/postfix/base/handlers/main.yml b/roles/postfix/base/handlers/main.yml deleted file mode 100644 index bea754c9..00000000 --- a/roles/postfix/base/handlers/main.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- -- name: restart postfix - service: - name: postfix - state: restarted diff --git a/roles/postfix/base/tasks/main.yml b/roles/postfix/base/tasks/main.yml deleted file mode 100644 index 8cb55fe0..00000000 --- a/roles/postfix/base/tasks/main.yml +++ /dev/null @@ -1,22 +0,0 @@ ---- -- name: install postfix package - apt: - name: postfix - state: present - -- name: basic postfix options - vars: - postfix_options: - mydestination: "{{ postfix_base_mydestination | join(', ') }}" - mynetworks: "{{ postfix_base_mynetworks | join(', ') }}" - relayhost: "{{ postfix_base_relayhost }}" - inet_interfaces: "{{ postfix_base_inet_interfaces | join(', ') }}" - inet_protocols: "{{ postfix_base_inet_protocols | join(', ') }}" - loop: "{{ postfix_options | dict2items }}" - loop_control: - label: "{{ item.key }} = {{ item.value }}" - lineinfile: - regexp: "^#?\\s*{{ item.key }}\\s*=" - line: "{{ item.key }} = {{ item.value }}" - dest: /etc/postfix/main.cf - notify: restart postfix -- cgit v1.2.3