fix(ntp.yml): standardize variable naming and replace command with copy module for backup
This commit is contained in:
@@ -16,7 +16,7 @@
|
|||||||
- name: (ntp.yml) Check file '/etc/ntpsec/ntp.conf.ORIG' exists
|
- name: (ntp.yml) Check file '/etc/ntpsec/ntp.conf.ORIG' exists
|
||||||
ansible.builtin.stat:
|
ansible.builtin.stat:
|
||||||
path: /etc/ntpsec/ntp.conf.ORIG
|
path: /etc/ntpsec/ntp.conf.ORIG
|
||||||
register: etc_ntpsec_conf_ORIG
|
register: common_etc_ntpsec_conf_orig
|
||||||
when:
|
when:
|
||||||
- ansible_facts.distribution == "Debian"
|
- ansible_facts.distribution == "Debian"
|
||||||
tags:
|
tags:
|
||||||
@@ -33,11 +33,17 @@
|
|||||||
- ansible_facts.distribution == "Debian"
|
- ansible_facts.distribution == "Debian"
|
||||||
|
|
||||||
- name: (ntp.yml) Backup installation version of file '/etc/ntpsec/ntp.conf'
|
- name: (ntp.yml) Backup installation version of file '/etc/ntpsec/ntp.conf'
|
||||||
ansible.builtin.command: cp /etc/ntpsec/ntp.conf /etc/ntpsec/ntp.conf.ORIG
|
ansible.builtin.copy:
|
||||||
|
src: /etc/ntpsec/ntp.conf
|
||||||
|
dest: /etc/ntpsec/ntp.conf.ORIG
|
||||||
|
remote_src: true
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
mode: "0644"
|
||||||
when:
|
when:
|
||||||
- groups['oopen_office_server']|string is search(inventory_hostname)
|
- groups['oopen_office_server']|string is search(inventory_hostname)
|
||||||
- etc_ntpsec_conf_ORIG.stat.exists == False
|
- not common_etc_ntpsec_conf_orig.stat.exists
|
||||||
- local_ntp_service is defined and local_ntp_service|bool
|
- local_ntp_service is defined and local_ntp_service
|
||||||
tags:
|
tags:
|
||||||
- ntp-server
|
- ntp-server
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user