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