Merge branch 'ntp_client' into 'newinfra'

[ntp-client] On continue à PEPCRANSIFIER

See merge request nounous/ansible!194
certbot_on_virtu
pa 2021-01-17 21:00:42 +01:00
commit 61036c2c58
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] [nginx:children]
reverseproxy reverseproxy
[ntp_server]
charybde.adm.crans.org
# silice.adm.crans.org
[postfix] [postfix]
mailman.adm.crans.org mailman.adm.crans.org
redisdead.adm.crans.org redisdead.adm.crans.org

View File

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

View File

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