-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
6 changed files
with
52 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,27 @@ | ||
{% set ntp_servers = salt['pillar.get']('ntp:servers', []) %} | ||
{% set timezone = salt['pillar.get']('ntp:timezone', 'UTC') %} | ||
{% set ntp_service = pillar['ntp']['service_name'] %} | ||
|
||
ntp-set_timezone: | ||
timezone.system: | ||
- name: {{ timezone }} | ||
|
||
ntp-install_ntp_package: | ||
pkg.installed: | ||
- name: {{ pillar['ntp']['package-name'] }} | ||
- version: {{ pillar['ntp']['version'] }} | ||
- name: chrony | ||
- ignore_epoch: True | ||
|
||
ntp-install_conf: | ||
file.managed: | ||
- name: /etc/ntp.conf | ||
- source: salt://ntp/templates/ntp.conf.tpl | ||
- name: /etc/chrony.conf | ||
- source: salt://ntp/templates/chrony.conf.tpl | ||
- template: jinja | ||
- context: | ||
ntp_servers: {{ ntp_servers }} | ||
|
||
ntp-ntpdate_sync_on_boot_script: | ||
file.managed: | ||
- name: /etc/ntpdate.sh | ||
- source: salt://ntp/files/ntpdate.sh | ||
- mode: 0755 | ||
- template: jinja | ||
- context: | ||
ntp_service: {{ ntp_service }} | ||
ntp_servers: {{ ntp_servers }} | ||
|
||
ntp-systemctl_reload: | ||
cmd.run: | ||
- name: /bin/systemctl daemon-reload; /bin/systemctl enable {{ ntp_service }}; /bin/systemctl stop chronyd; /bin/systemctl disable chronyd; /bin/systemctl enable ntpdate; | ||
|
||
ntp-ntpdate-sync: | ||
cmd.run: | ||
- name: '/etc/ntpdate.sh' | ||
|
||
ntp-enable_chronyd: | ||
service.running: | ||
- name: chronyd | ||
- enable: True | ||
- watch: | ||
- pkg: ntp-install_ntp_package | ||
- file: ntp-install_conf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# Use public servers from the pool.ntp.org project. | ||
# Please consider joining the pool (http://www.pool.ntp.org/join.html). | ||
server 0.centos.pool.ntp.org iburst | ||
server 1.centos.pool.ntp.org iburst | ||
server 2.centos.pool.ntp.org iburst | ||
server 3.centos.pool.ntp.org iburst | ||
|
||
{% for ntp_server in ntp_servers -%} | ||
server {{ ntp_server }} | ||
{% endfor %} | ||
|
||
# Record the rate at which the system clock gains/losses time. | ||
driftfile /var/lib/chrony/drift | ||
|
||
# Allow the system clock to be stepped in the first three updates | ||
# if its offset is larger than 1 second. | ||
makestep 1.0 3 | ||
|
||
# Enable kernel synchronization of the real-time clock (RTC). | ||
rtcsync | ||
|
||
# Enable hardware timestamping on all interfaces that support it. | ||
#hwtimestamp * | ||
|
||
# Increase the minimum number of selectable sources required to adjust | ||
# the system clock. | ||
#minsources 2 | ||
|
||
# Allow NTP client access from local network. | ||
#allow 192.168.0.0/16 | ||
|
||
# Serve time even if not synchronized to a time source. | ||
#local stratum 10 | ||
|
||
# Specify file containing keys for NTP authentication. | ||
#keyfile /etc/chrony.keys | ||
|
||
# Specify directory for log files. | ||
logdir /var/log/chrony | ||
|
||
# Select which information is logged. | ||
#log measurements statistics tracking |
This file was deleted.
Oops, something went wrong.