From ccaa67daca70303c77e7499a618150d4a46256f2 Mon Sep 17 00:00:00 2001 From: mg Date: Sat, 27 Mar 2021 10:46:48 +0100 Subject: [PATCH] Bugfix: ntp (#53) Bugfix: ntp Co-authored-by: Michael Grote Reviewed-on: https://git.mgrote.net/mg/ansible/pulls/53 Co-Authored-By: mg Co-Committed-By: mg --- roles/mgrote.ntp_chrony_client/handlers/main.yml | 6 ++++++ roles/mgrote.ntp_chrony_client/tasks/main.yml | 4 ++-- roles/mgrote.ntp_chrony_server/handlers/main.yml | 6 ++++++ roles/mgrote.ntp_chrony_server/tasks/main.yml | 4 ++-- 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/roles/mgrote.ntp_chrony_client/handlers/main.yml b/roles/mgrote.ntp_chrony_client/handlers/main.yml index f62bf2d0..f1c7c2d2 100644 --- a/roles/mgrote.ntp_chrony_client/handlers/main.yml +++ b/roles/mgrote.ntp_chrony_client/handlers/main.yml @@ -4,3 +4,9 @@ name: chrony enabled: yes state: restarted + + - name: mask ntp service + become: yes + systemd: + name: ntp + masked: yes diff --git a/roles/mgrote.ntp_chrony_client/tasks/main.yml b/roles/mgrote.ntp_chrony_client/tasks/main.yml index 5312772c..27864329 100644 --- a/roles/mgrote.ntp_chrony_client/tasks/main.yml +++ b/roles/mgrote.ntp_chrony_client/tasks/main.yml @@ -6,12 +6,12 @@ state: stopped masked: yes - - name: mask ntp service + - name: stop ntp service become: yes systemd: name: ntp state: stopped - masked: yes + notify: mask ntp service - name: install chrony packages become: yes diff --git a/roles/mgrote.ntp_chrony_server/handlers/main.yml b/roles/mgrote.ntp_chrony_server/handlers/main.yml index f62bf2d0..f1c7c2d2 100644 --- a/roles/mgrote.ntp_chrony_server/handlers/main.yml +++ b/roles/mgrote.ntp_chrony_server/handlers/main.yml @@ -4,3 +4,9 @@ name: chrony enabled: yes state: restarted + + - name: mask ntp service + become: yes + systemd: + name: ntp + masked: yes diff --git a/roles/mgrote.ntp_chrony_server/tasks/main.yml b/roles/mgrote.ntp_chrony_server/tasks/main.yml index 75b6cf76..b7fcff84 100644 --- a/roles/mgrote.ntp_chrony_server/tasks/main.yml +++ b/roles/mgrote.ntp_chrony_server/tasks/main.yml @@ -6,12 +6,12 @@ state: stopped masked: yes - - name: mask ntp service + - name: stop ntp service become: yes systemd: name: ntp state: stopped - masked: yes + notify: mask ntp service - name: install chrony packages become: yes