Browse Source

NTP: define servers with a list instead of few variables

pull/1/head
nanowish 9 years ago
parent
commit
a689c7094b
2 changed files with 10 additions and 8 deletions
  1. +5
    -3
      etc/host_vars/localhost.example
  2. +5
    -5
      roles/common/templates/etc-ntp.conf.j2

+ 5
- 3
etc/host_vars/localhost.example View File

@ -1,9 +1,11 @@
---
---
admin_ssh_keys: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDZXK3ufonx+zNQ1x6cSWuUWckB/xf9sKZ+mRgY5SPXzqrxSkqNSmr9JQ6xzvhxKEVcFWsi50op1WWtRo3HG3p3+EHKXeCyzt5QnczDlVOoQbB8kgI0byKcvXux1inL4/Q4DbVLUbDFnynD/C5aAyYMYePahMxR+AQr60DD+7Ty6pcEVih1wwHIlxWziY1EF6sEzQwz/PiTxWIZkKHl/WPGagS9Pp/5nQfdZy0AS/JqbzNyMEg51+XedADuqseV4GXDzrzDYLJXJFv1PFVJxRWLrjChKrUMqyszUySkZMr5YSPXlsV0bi+0xivYEsXvIkLORV96JTZosYbV+0aFKDPv root@debian
default_packages_debian: htop
description: machine test
ntp_server1: 0.pool.ntp.org
ntp_server2: 1.pool.ntp.org
ntp_servers:
- 0.pool.ntp.org
- 1.pool.ntp.org
- 2.pool.ntp.org
disable_ipv6: true
domain: test.net
mariadb_version: 10.0

+ 5
- 5
roles/common/templates/etc-ntp.conf.j2 View File

@ -6,12 +6,12 @@ statistics loopstats peerstats clockstats
filegen loopstats file loopstats type day enable
filegen peerstats file peerstats type day enable
filegen clockstats file clockstats type day enable
server {{ ntp_server1 }}
server {{ ntp_server2 }}
{% for server in ntp_servers %}
server {{ server }}
restrict {{ server }} nomodify nopeer
restrict {{ server }} nomodify nopeer
{% endfor %}
restrict default ignore
restrict -6 default ignore
restrict 127.0.0.1
restrict ::1
restrict {{ ntp_server1 }} nomodify nopeer
restrict {{ ntp_server2 }} nomodify nopeer

Loading…
Cancel
Save