update...

This commit is contained in:
2023-05-01 10:47:10 +02:00
parent 9766f7841e
commit bb57e8e555
35 changed files with 1416 additions and 274 deletions

View File

@ -105,7 +105,7 @@
group: root
owner: root
when:
- inventory_hostname not in groups['lxc_guest']
- inventory_hostname not in groups['lxc_guest'] or inventory_hostname in groups['lxc_host']
- copy_plain_files_sysctl is defined
- copy_plain_files_sysctl|length > 0
tags:
@ -122,7 +122,7 @@
loop_control:
label: 'dest: {{ item.name }}'
when:
- inventory_hostname not in groups['lxc_guest']
- inventory_hostname not in groups['lxc_guest'] or inventory_hostname in groups['lxc_host']
- copy_plain_files_sysctl is defined
- copy_plain_files_sysctl|length > 0
tags:
@ -139,7 +139,7 @@
loop_control:
label: 'dest: {{ item.name }}'
when:
- inventory_hostname not in groups['lxc_guest']
- inventory_hostname not in groups['lxc_guest'] or inventory_hostname in groups['lxc_host']
- copy_additional_plain_files_sysctl is defined
- copy_additional_plain_files_sysctl|length > 0
tags:

View File

@ -1,6 +1,23 @@
---
# ---
# Some Checks
# ---
- name: Check if file '/etc/postfix/relay_domains' exists
stat:
path: /etc/postfix/relay_domains
register: relay_domains_actual
- name: (copy_files.yml) Get checksum of '/etc/postfix/relay_domains'
set_fact:
relay_domains_sha1: "{{ relay_domains_actual.stat.checksum }}"
when:
- relay_domains_actual.stat.exists
# ---
# Copy files - main
# ---
- name: (copy_files.yml) Copy plain files
copy:
@ -36,6 +53,26 @@
tags:
- copy-files
- copy-plain-files
notify: "Reload postfwd"
- name: (copy_files.yml) Copy host specific plain files Postfix (/etc/postfix)
copy:
src: '{{ item.src_path }}'
dest: '{{ item.dest_path }}'
owner: root
group: root
mode: '0644'
loop: "{{ copy_plain_files_postfix_host_specific }}"
loop_control:
label: 'dest: {{ item.name }}'
when:
- inventory_hostname in groups['mail_server']
- copy_plain_files_postfix_host_specific is defined
- copy_plain_files_postfix_host_specific|length > 0
tags:
- copy-files
- copy-plain-files
notify: "Reload postfwd"
- name: (copy_files.yml) Copy plain files Postfix Firewall (postfwd)
copy:
@ -92,3 +129,26 @@
tags:
- copy-files
- copy-template-files
# ---
# Some final tasks
# ---
- name: Get checksum oif (possible upodated) file '/etc/postfix/relay_domains' exists
stat:
path: /etc/postfix/relay_domains
register: relay_domains_new
- name: (copy_files.yml) Get checksum of '/etc/postfix/relay_domains'
set_fact:
relay_domains_sha1_new: "{{ relay_domains_new.stat.checksum }}"
when:
- relay_domains_new.stat.exists
- name: (copy_files.yml) Renew database /etc/postfix/relay_domains.db
shell: '/usr/sbin/postmap btree:/etc/postfix/relay_domains'
when:
- relay_domains_actual.stat.exists
- relay_domains_new.stat.exists
- relay_domains_actual.stat.checksum != relay_domains_new.stat.checksum
notify: "Reload postfwd"