Create single virtual domain task

for use in other playbooks
This commit is contained in:
phil 2023-03-24 13:19:22 +01:00
parent 5ef68a7f78
commit 822dfdb408
3 changed files with 18 additions and 2 deletions

View file

@ -7,6 +7,10 @@
ansible.builtin.import_tasks: postfix.yml ansible.builtin.import_tasks: postfix.yml
tags: postfix tags: postfix
- name: Virtual domains
ansible.builtin.import_tasks: virtual_domains.yml
tags: virtual_domains
- name: OnionMX - name: OnionMX
ansible.builtin.import_tasks: onionmx.yml ansible.builtin.import_tasks: onionmx.yml
tags: onionmx tags: onionmx

View file

@ -47,7 +47,6 @@
- sender_checks - sender_checks
- transport_global_exceptions - transport_global_exceptions
- transport_relay - transport_relay
- virtual_domains
notify: reload postfix notify: reload postfix
- name: "Postfix | Run postmap" - name: "Postfix | Run postmap"
@ -64,7 +63,6 @@
- file: relay_checks - file: relay_checks
- file: sender_checks - file: sender_checks
- file: transport_relay - file: transport_relay
- file: virtual_domains
- name: "Postfix | Create dhparam file" - name: "Postfix | Create dhparam file"
community.crypto.openssl_dhparam: community.crypto.openssl_dhparam:

14
tasks/virtual_domains.yml Normal file
View file

@ -0,0 +1,14 @@
---
- name: "Virtual domain | Copy lookup tables from templates"
ansible.builtin.template:
src: "postfix/conf.d/virtual_domains.j2"
dest: "{{ postfix_conf_dir }}/virtual_domains"
mode: "0644"
notify: reload postfix
- name: "Postfix | Run postmap"
ansible.builtin.command: "postmap cdb:virtual_domains"
args:
chdir: "{{ postfix_conf_dir }}"
changed_when: false
notify: reload postfix