Skip to content

Commit

Permalink
Only use Debian pool if base_ntp_server is not defined
Browse files Browse the repository at this point in the history
If base_ntp_server is defined, aka we have set a custom ntp server, we
do not want to use the Debian pool.

Ansible Molecule verifier checks the expected files.
The `pool` line needs to be removed, as we now expect the Debian
pool line to be missing if base_ntp_server is defined.

Closes: #20
  • Loading branch information
jkirk committed Jan 7, 2025
1 parent 97505b4 commit 05425c6
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 7 deletions.
3 changes: 0 additions & 3 deletions molecule/default/files/chrony.bookworm.example.conf
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
# Include configuration files found in /etc/chrony/conf.d.
confdir /etc/chrony/conf.d

# Use Debian vendor zone.
pool 2.debian.pool.ntp.org iburst

# Use time sources from DHCP.
sourcedir /run/chrony-dhcp

Expand Down
3 changes: 0 additions & 3 deletions molecule/default/files/chrony.bullseye.example.conf
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
# Include configuration files found in /etc/chrony/conf.d.
confdir /etc/chrony/conf.d

# Use Debian vendor zone.
pool 2.debian.pool.ntp.org iburst

# Use time sources from DHCP.
sourcedir /run/chrony-dhcp

Expand Down
1 change: 0 additions & 1 deletion molecule/default/files/chrony.buster.example.conf
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Ansible managed: Do NOT edit this file manually!
# Welcome to the chrony configuration file. See chrony.conf(5) for more
# information about usuable directives.
pool 2.debian.pool.ntp.org iburst

# This directive specify the location of the file containing ID/key pairs for
# NTP authentication.
Expand Down
2 changes: 2 additions & 0 deletions templates/chrony/chrony.bookworm.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
# Include configuration files found in /etc/chrony/conf.d.
confdir /etc/chrony/conf.d

{% if base_ntp_server is not defined %}
# Use Debian vendor zone.
pool 2.debian.pool.ntp.org iburst

{% endif %}
# Use time sources from DHCP.
sourcedir /run/chrony-dhcp

Expand Down
2 changes: 2 additions & 0 deletions templates/chrony/chrony.bullseye.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
# Include configuration files found in /etc/chrony/conf.d.
confdir /etc/chrony/conf.d

{% if base_ntp_server is not defined %}
# Use Debian vendor zone.
pool 2.debian.pool.ntp.org iburst

{% endif %}
# Use time sources from DHCP.
sourcedir /run/chrony-dhcp

Expand Down
2 changes: 2 additions & 0 deletions templates/chrony/chrony.buster.conf.j2
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# {{ ansible_managed }}
# Welcome to the chrony configuration file. See chrony.conf(5) for more
# information about usuable directives.
{% if base_ntp_server is not defined %}
pool 2.debian.pool.ntp.org iburst
{% endif %}

# This directive specify the location of the file containing ID/key pairs for
# NTP authentication.
Expand Down

0 comments on commit 05425c6

Please sign in to comment.