forked from ocp-power-automation/ocp4-playbooks
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix issue: ocp-power-automation#31 (setup crony during OCP installati…
…on) (ocp-power-automation#34) Allow users to specify a list of ntp servers to configure chrony time synchronization on RHCOS nodes during installation Fixes: ocp-power-automation#31 Signed-off-by: Sebastien Chabrolles <[email protected]>
- Loading branch information
1 parent
de6b123
commit 22f8838
Showing
8 changed files
with
95 additions
and
1 deletion.
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 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 |
---|---|---|
|
@@ -8,3 +8,5 @@ proxy_url: "" | |
no_proxy: "" | ||
enable_local_registry: false | ||
|
||
chronyconfig: | ||
enabled: false |
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,17 @@ | ||
- name: Create temporary chrony.conf file | ||
template: | ||
src: chrony.conf.j2 | ||
dest: /tmp/chrony.conf.tmp | ||
|
||
- name: slurp contents of temporary chrony.conf file | ||
slurp: | ||
src: /tmp/chrony.conf.tmp | ||
register: chronybase64 | ||
|
||
- name: Generate Chrony machineconfig | ||
template: | ||
src: chrony-machineconfig.j2 | ||
dest: "{{ workdir }}/manifests/99-{{item}}-chrony-configuration.yaml" | ||
loop: | ||
- master | ||
- worker |
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
25 changes: 25 additions & 0 deletions
25
playbooks/roles/ocp-config/templates/chrony-machineconfig.j2
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,25 @@ | ||
apiVersion: machineconfiguration.openshift.io/v1 | ||
kind: MachineConfig | ||
metadata: | ||
labels: | ||
machineconfiguration.openshift.io/role: {{item}} | ||
name: 99-{{item}}-chrony-configuration | ||
spec: | ||
config: | ||
ignition: | ||
config: {} | ||
security: | ||
tls: {} | ||
timeouts: {} | ||
version: 2.2.0 | ||
networkd: {} | ||
passwd: {} | ||
storage: | ||
files: | ||
- contents: | ||
source: data:text/plain;charset=utf-8;base64,{{ chronybase64.content }} | ||
verification: {} | ||
filesystem: root | ||
mode: 420 | ||
path: /etc/chrony.conf | ||
osImageURL: "" |
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,7 @@ | ||
{% for item in chronyconfig.content %} | ||
server {{ item.server }} {{ item.options }} | ||
{% endfor %} | ||
driftfile /var/lib/chrony/drift | ||
makestep 1.0 3 | ||
rtcsync | ||
logdir /var/log/chrony |