File tree Expand file tree Collapse file tree
install-config-ntp-package/tasks Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33registry_env : prod
44registry_port : 80
55
6- # ntp servers
7- ntp_servers :
8- - 0.north-america.pool.ntp.org
9- - 1.north-america.pool.ntp.org
10- - 2.north-america.pool.ntp.org
11- - 3.north-america.pool.ntp.org
12-
136# for docker stop old container
147stop_time : 5
158
Original file line number Diff line number Diff line change 11---
22- hosts : all
3- vars_files :
4- group_vars/all.yml
3+ gather_facts : no
4+
55 roles :
6- - { role: notify, tags: "notify" }
7- - { role: install-config-ntp-package, tags "Setup NTP Package" }
6+ - { role: package_ntp, tags "Setup NTP Package" }
Original file line number Diff line number Diff line change 1+ ---
2+ - hosts : all
3+ gather_facts : no
4+
5+ tasks :
6+ name : restart services
7+ sudo : yes
8+ service :
9+ name={{ item }}
10+ state=restarted
11+ with_items :
12+ - ntp
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ ---
2+ ntp_servers :
3+ - 0.north-america.pool.ntp.org
4+ - 1.north-america.pool.ntp.org
5+ - 2.north-america.pool.ntp.org
6+ - 3.north-america.pool.ntp.org
Original file line number Diff line number Diff line change 11---
22- name : Restart ntp
3+ sudo : yes
34 service :
4- name=
5- state=restart
6- enabled=yes
7- tags : restart ntp
5+ name=ntp
6+ state=restarted
87
98- name : Froce ntp update
9+ sudo : yes
1010 shell :
1111 " service ntp stop && /usr/sbin/ntpdate pool.ntp.org && service ntp start"
12- tags : force ntp update
12+
13+ - name : Start and Enable ntp
14+ sudo : yes
15+ service :
16+ name=ntp
17+ state=started
18+ enabled=yes
Original file line number Diff line number Diff line change 1+ ---
2+ - name : Install ntp package
3+ sudo : yes
4+ apt :
5+ name=ntp
6+ state=present
7+ force=yes
8+ update_cache=yes
9+ cache_valid_time=604800
10+
11+ - name : Copy the ntp.conf template file
12+ sudo : yes
13+ template :
14+ src=ntp.conf.j2
15+ dest=/etc/ntp.conf
16+ mode=0644
17+ notify : Start and Enable ntp
18+
Original file line number Diff line number Diff line change 1+ # {{ ansible_managed }}
2+
3+ driftfile /var/lib/ntp/ntp.drift
4+
5+ statsdir /var/log/ntpstats/
6+ statistics loopstats peerstats clockstats
7+ filegen loopstats file loopstats type day enable
8+ filegen peerstats file peerstats type day enable
9+ filegen clockstats file clockstats type day enable
10+
11+ restrict -4 default kdo notrap nomodify nopeer noquery
12+ restrict -6 default kdo notrap nomodify nopeer noquery
13+
14+ restrict 127.0.0.1
15+ restrict ::1
16+
17+ {% for server in ntp_servers %}
18+ server {{ server }} iburst
19+ {% endfor %}
You can’t perform that action at this time.
0 commit comments