Add conditionals to disable tasks dor intenal mail servers

This commit is contained in:
phil 2023-04-19 15:14:03 +02:00
parent df43829b66
commit 5d6c3e0f77
4 changed files with 6 additions and 1 deletions

View file

@ -10,6 +10,7 @@ postfix_conf_dir: /etc/postfix/conf.d
postfix_daemon_dir: /usr/lib/postfix/sbin
postfix_default_db_type: cdb
postfix_dhparam_file: /etc/ssl/private/dhparam.pem
postfix_pflogsum_enabled: true
postfix_pflogsum_mail_subject: "Mailserver Statistics"
postfix_myhostname: "$myorigin"
postfix_relayhost: ""

View file

@ -27,6 +27,7 @@
- name: TLS-helper
ansible.builtin.import_tasks: tls-helper.yml
tags: tls-helper
when: postfix_type == "internet"
- name: MTA-STS
ansible.builtin.include_tasks: mta-sts.yml
@ -40,6 +41,7 @@
- name: Hostname
ansible.builtin.import_tasks: hostname.yml
tags: hostname
when: postfix_type == "internet"
- name: Monitoring
ansible.builtin.import_tasks: monitoring.yml

View file

@ -13,4 +13,4 @@
dest: /etc/monit/conf-enabled/mta-sts-daemon
mode: "0644"
notify: reload monit
when: "'monit' in ansible_facts.packages"
when: "'monit' in ansible_facts.packages and postfix_type == 'internet'"

View file

@ -74,6 +74,7 @@
community.crypto.openssl_dhparam:
path: "{{ postfix_dhparam_file }}"
size: 4096
when: postfix_type == "internet"
- name: "Postfix | Setup cron job for pflogsum"
ansible.builtin.cron:
@ -81,3 +82,4 @@
job: /usr/sbin/pflogsumm --detail 8 --problems-first --no-no-msg-size --reject-detail 12 /var/log/mail.log.1 | mail -s "{{ postfix_pflogsum_mail_subject }} ({{ inventory_hostname }})" {{ postfix_pflogsum_recipient }}
hour: "06"
minute: "24"
when: postfix_pflogsum_enabled