From 8087ae743c961539f9b38ba8b11119e8d69d29f4 Mon Sep 17 00:00:00 2001 From: nicoo Date: Sat, 16 Jun 2018 20:16:57 +0200 Subject: [PATCH] base: Make managed ntpd optional --- ansible/roles/base/defaults/main.yml | 1 + ansible/roles/base/tasks/main.yml | 39 ++++++++++++++++++---------------- 2 files changed, 22 insertions(+), 18 deletions(-) create mode 100644 ansible/roles/base/defaults/main.yml diff --git a/ansible/roles/base/defaults/main.yml b/ansible/roles/base/defaults/main.yml new file mode 100644 index 0000000..ea08535 --- /dev/null +++ b/ansible/roles/base/defaults/main.yml @@ -0,0 +1 @@ +base_managed_ntpd: yes diff --git a/ansible/roles/base/tasks/main.yml b/ansible/roles/base/tasks/main.yml index c168799..947987e 100644 --- a/ansible/roles/base/tasks/main.yml +++ b/ansible/roles/base/tasks/main.yml @@ -80,28 +80,31 @@ - python-apt state: present -- name: check that ISC ntpd is not installed - apt: - name: ntp - state: absent - purge: yes +- when: base_managed_ntpd + block: + - name: check that ISC ntpd is not installed + apt: + name: ntp + state: absent + purge: yes -- name: install openntpd - apt: - name: openntpd + - name: install openntpd + apt: + name: openntpd -- name: configure openntpd - copy: - dest: /etc/openntpd/ntpd.conf - content: | - # Use the ffgraz.net NTP server - servers ntp.ffgraz.net weight 3 + - name: configure openntpd + copy: + dest: /etc/openntpd/ntpd.conf + content: | + # Use the ffgraz.net NTP server + servers ntp.ffgraz.net weight 3 + + # Use some servers announced from the NTP Pool + servers 0.debian.pool.ntp.org + servers 1.debian.pool.ntp.org - # Use some servers announced from the NTP Pool - servers 0.debian.pool.ntp.org - servers 1.debian.pool.ntp.org + notify: restart openntpd - notify: restart openntpd - name: make sure grml-(etc|scripts)-core is not installed apt: -- 1.7.10.4