forked from openshift/openshift-ansible
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1. ntp is required by contrail, so checking for ntp package and starting ntpd service by configuring the /etc/ntp.conf file. If ntpserver is provided by user in the ose-install that will be used as ntp server and will be configured on all nodes including master, else master will be ntpserver Change-Id: I3a6989f14b5581e1906010d1a059deec2bb01802 Closes-Bug: #1784085
- Loading branch information
1 parent
3d18b9c
commit cd6a8f2
Showing
6 changed files
with
99 additions
and
22 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
--- | ||
- name: install ntp packages | ||
package: | ||
name: "{{ item }}" | ||
state: present | ||
with_items: | ||
- ntp | ||
|
||
- name: open ntp port 123 on masters | ||
command: iptables -I INPUT 4 -j ACCEPT -p udp --dport 123 | ||
|
||
- name: stop ntp service | ||
service: name="ntpd" state=stopped enabled=yes | ||
|
||
- name: set ntp server | ||
template: | ||
src: ntp.conf.j2 | ||
dest: /etc/ntp.conf | ||
|
||
- name: start ntp service | ||
service: name="ntpd" state=started enabled=yes | ||
|
||
- name: set fact that this master is an ntp server | ||
set_fact: | ||
is_ntp_server: true | ||
|
||
- name: disable service chronyd | ||
systemd: | ||
name: chronyd | ||
enabled: no | ||
ignore_errors: yes |
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,12 @@ | ||
tinker panic 0 | ||
|
||
disable monitor | ||
restrict default kod nomodify notrap nopeer noquery | ||
restrict -6 default kod nomodify notrap nopeer noquery | ||
restrict 127.0.0.1 | ||
restrict -6 ::1 | ||
|
||
server 127.127.1.0 | ||
|
||
# Driftfile. | ||
driftfile /var/lib/ntp/drift |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
--- | ||
- name: install ntp packages | ||
package: | ||
name: "{{ item }}" | ||
state: present | ||
with_items: | ||
- ntp | ||
|
||
- name: stop ntp service | ||
service: name="ntpd" state=stopped enabled=yes | ||
|
||
- name: set ntp conf file | ||
template: | ||
src: ntp.conf.j2 | ||
dest: /etc/ntp.conf | ||
when: | ||
- is_ntp_server is not defined | ||
|
||
- name: start ntp service | ||
service: name="ntpd" state=started enabled=yes | ||
|
||
- name: disable service chronyd | ||
systemd: | ||
name: chronyd | ||
enabled: no | ||
ignore_errors: yes |
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,18 @@ | ||
tinker panic 0 | ||
|
||
disable monitor | ||
restrict default kod nomodify notrap nopeer noquery | ||
restrict -6 default kod nomodify notrap nopeer noquery | ||
restrict 127.0.0.1 | ||
restrict -6 ::1 | ||
|
||
{% if ntpserver is not defined %} | ||
{% for master in groups.masters %} | ||
server {{ master | ipaddr }} iburst | ||
{% endfor %} | ||
{% else %} | ||
server {{ ntpserver | ipaddr }} iburst | ||
{% endif %} | ||
|
||
# Driftfile. | ||
driftfile /var/lib/ntp/drift |