Skip to content

Commit c6d35e1

Browse files
committed
Adds support for configuring chrony
Chrony is already bundled in the generic cloud image so we just have to configure it. For this I am using an off the shelf role. I've chosen mrlesmithjr.chrony as it is also used in kayobe (so we can share development effort)
1 parent 9816980 commit c6d35e1

File tree

6 files changed

+43
-0
lines changed

6 files changed

+43
-0
lines changed

ansible/bootstrap.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,14 @@
5252
- import_role:
5353
name: proxy
5454

55+
- hosts: chrony
56+
gather_facts: false
57+
tags: chrony
58+
become: yes
59+
tasks:
60+
- import_role:
61+
name: chrony
62+
5563
- hosts: cluster
5664
gather_facts: false
5765
become: yes

ansible/roles/compute_init/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ it also requires an image build with the role name added to the
4040
| bootstrap.yml | (wait for ansible-init) | Not relevant during boot | n/a |
4141
| bootstrap.yml | resolv_conf | Fully supported | No |
4242
| bootstrap.yml | etc_hosts | Fully supported | No |
43+
| bootstrap.yml | chrony | Fully supported | No |
4344
| bootstrap.yml | proxy | None at present | No |
4445
| bootstrap.yml | (/etc permissions) | None required - use image build | No |
4546
| bootstrap.yml | (ssh /home fix) | None required - use image build | No |

ansible/roles/compute_init/files/compute-init.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
enable_manila: "{{ os_metadata.meta.manila | default(false) | bool }}"
1515
enable_basic_users: "{{ os_metadata.meta.basic_users | default(false) | bool }}"
1616
enable_eessi: "{{ os_metadata.meta.eessi | default(false) | bool }}"
17+
enable_chrony: "{{ os_metadata.meta.chrony | default(false) | bool }}"
1718

1819
# TODO: "= role defaults" - could be moved to a vars_file: on play with similar precedence effects
1920
resolv_conf_nameservers: []
@@ -97,6 +98,10 @@
9798

9899
# TODO: should /mnt/cluster now be UNMOUNTED to avoid future hang-ups?
99100

101+
- name: Run chrony role
102+
ansible.builtin.include_role:
103+
name: mrlesmithjr.chrony
104+
100105
- name: Configure resolve.conf
101106
block:
102107
- name: Set nameservers in /etc/resolv.conf

ansible/roles/compute_init/tasks/install.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@
3636
dest: tasks/tuned.yml
3737
- src: ../../stackhpc.nfs/tasks/nfs-clients.yml
3838
dest: tasks/nfs-clients.yml
39+
- src: ../../mrlesmithjr.chrony
40+
dest: roles/
3941

4042
- name: Add filter_plugins to ansible.cfg
4143
lineinfile:

docs/configuration.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Configuration
2+
3+
This page provides configuration snippets for various services.
4+
5+
## Chrony
6+
7+
Use variables from the [mrlesmithjr.chrony](https://github.com/mrlesmithjr/ansible-chrony) role.
8+
9+
For example in: `environments/<environment>/inventory/group_vars/all/chrony`:
10+
11+
```
12+
---
13+
chrony_ntp_servers:
14+
- server: ntp-0.example.org
15+
options:
16+
- option: iburst
17+
- option: minpoll
18+
val: 8
19+
- server: ntp-1.example.org
20+
options:
21+
- option: iburst
22+
- option: minpoll
23+
val: 8
24+
25+
```

requirements.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ roles:
2222
- src: https://github.com/stackhpc/ansible-role-os-manila-mount.git
2323
name: stackhpc.os-manila-mount
2424
version: v25.1.1
25+
- src: mrlesmithjr.chrony
26+
version: v0.1.4
2527

2628
collections:
2729
- name: containers.podman

0 commit comments

Comments
 (0)