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
|
||||
ansible.builtin.stat:
|
||||
path: /etc/ntpsec/ntp.conf.ORIG
|
||||
register: etc_ntpsec_conf_ORIG
|
||||
register: common_etc_ntpsec_conf_orig
|
||||
when:
|
||||
- ansible_facts.distribution == "Debian"
|
||||
tags:
|
||||
@@ -33,11 +33,17 @@
|
||||
- ansible_facts.distribution == "Debian"
|
||||
|
||||
- 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:
|
||||
- groups['oopen_office_server']|string is search(inventory_hostname)
|
||||
- etc_ntpsec_conf_ORIG.stat.exists == False
|
||||
- local_ntp_service is defined and local_ntp_service|bool
|
||||
- not common_etc_ntpsec_conf_orig.stat.exists
|
||||
- local_ntp_service is defined and local_ntp_service
|
||||
tags:
|
||||
- ntp-server
|
||||
|
||||
|
||||
Reference in New Issue
Block a user