[ntp-client] On continue à PEPCRANSIFIER

certbot_on_virtu
_shirenn 2021-01-17 20:59:45 +01:00
parent 1d964c849b
commit 1eba54f3ec
5 changed files with 15 additions and 10 deletions

View File

@ -0,0 +1,3 @@
glob_ntp_client:
servers:
- charybde.adm.crans.org

4
hosts
View File

@ -76,6 +76,10 @@ fluxx.adm.crans.org
[nginx:children]
reverseproxy
[ntp_server]
charybde.adm.crans.org
# silice.adm.crans.org
[postfix]
mailman.adm.crans.org
redisdead.adm.crans.org

View File

@ -33,10 +33,7 @@
# # Will be in /usr/scripts/
# crans_scripts_git: "http://gitlab.adm.crans.org/nounous/scripts.git"
# NTP servers
ntp_servers:
- charybde.adm.crans.org
# - silice.adm.crans.org
ntp_client: '{{ glob_ntp_client | combine(loc_ntp_client | default({})) }}'
roles:
- debian-apt-sources
- common-tools

View File

@ -7,12 +7,11 @@
register: apt_result
retries: 3
until: apt_result is succeeded
when: inventory_hostname not in ntp_servers
when: "'ntp_server' not in group_names"
- name: Configure NTP
lineinfile:
path: /etc/systemd/timesyncd.conf
regexp: '^NTP='
line: "NTP={{ ntp_servers | join(' ') }}"
template:
src: systemd/timesyncd.conf.j2
dest: /etc/systemd/timesyncd.conf
notify: Restart systemd-timesyncd
when: inventory_hostname not in ntp_servers
when: "'ntp_server' not in group_names"

View File

@ -0,0 +1,2 @@
[Time]
NTP={{ ntp_client.servers | join(' ') }}