From 81e1f3fb3e728571669b39a941fa7fd3fa1352d3 Mon Sep 17 00:00:00 2001 From: Christoph Date: Tue, 28 Jul 2026 22:03:46 +0200 Subject: [PATCH] fix(ntp.yml): standardize variable naming and replace command with copy module for backup --- roles/common/tasks/ntp.yml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/roles/common/tasks/ntp.yml b/roles/common/tasks/ntp.yml index a5f995e..ab829fc 100644 --- a/roles/common/tasks/ntp.yml +++ b/roles/common/tasks/ntp.yml @@ -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