Refactor variable names in copy_files.yml for consistency and clarity
This commit is contained in:
@@ -6,16 +6,16 @@
|
||||
- name: Check if file '/etc/postfix/relay_domains' exists
|
||||
ansible.builtin.stat:
|
||||
path: /etc/postfix/relay_domains
|
||||
register: relay_domains_actual
|
||||
register: common_relay_domains_actual
|
||||
|
||||
- name: (copy_files.yml) Get checksum of '/etc/postfix/relay_domains'
|
||||
ansible.builtin.set_fact:
|
||||
relay_domains_sha1: "{{ relay_domains_actual.stat.checksum }}"
|
||||
common_relay_domains_sha1: "{{ common_relay_domains_actual.stat.checksum }}"
|
||||
when:
|
||||
- relay_domains_actual.stat.exists
|
||||
- common_relay_domains_actual.stat.exists
|
||||
|
||||
# ---
|
||||
# Copy files - main
|
||||
# Copy files - main
|
||||
# ---
|
||||
|
||||
- name: (copy_files.yml) Copy plain files
|
||||
@@ -135,18 +135,19 @@
|
||||
- name: Get checksum oif (possible upodated) file '/etc/postfix/relay_domains' exists
|
||||
ansible.builtin.stat:
|
||||
path: /etc/postfix/relay_domains
|
||||
register: relay_domains_new
|
||||
register: common_relay_domains_new
|
||||
|
||||
- name: (copy_files.yml) Get checksum of '/etc/postfix/relay_domains'
|
||||
ansible.builtin.set_fact:
|
||||
relay_domains_sha1_new: "{{ relay_domains_new.stat.checksum }}"
|
||||
common_relay_domains_sha1_new: "{{ common_relay_domains_new.stat.checksum }}"
|
||||
when:
|
||||
- relay_domains_new.stat.exists
|
||||
- common_relay_domains_new.stat.exists
|
||||
|
||||
- name: (copy_files.yml) Renew database /etc/postfix/relay_domains.db
|
||||
ansible.builtin.command: "/usr/sbin/postmap btree:/etc/postfix/relay_domains"
|
||||
changed_when: true
|
||||
when:
|
||||
- relay_domains_actual.stat.exists
|
||||
- relay_domains_new.stat.exists
|
||||
- relay_domains_actual.stat.checksum != relay_domains_new.stat.checksum
|
||||
- common_relay_domains_actual.stat.exists
|
||||
- common_relay_domains_new.stat.exists
|
||||
- common_relay_domains_actual.stat.checksum != common_relay_domains_new.stat.checksum
|
||||
notify: "Reload postfwd"
|
||||
|
||||
Reference in New Issue
Block a user