Skip to content

Commit

Permalink
Adds support for configuring chrony
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
jovial committed Feb 13, 2025
1 parent 9816980 commit c6d35e1
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 0 deletions.
8 changes: 8 additions & 0 deletions ansible/bootstrap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,14 @@
- import_role:
name: proxy

- hosts: chrony
gather_facts: false
tags: chrony
become: yes
tasks:
- import_role:
name: chrony

- hosts: cluster
gather_facts: false
become: yes
Expand Down
1 change: 1 addition & 0 deletions ansible/roles/compute_init/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ it also requires an image build with the role name added to the
| bootstrap.yml | (wait for ansible-init) | Not relevant during boot | n/a |
| bootstrap.yml | resolv_conf | Fully supported | No |
| bootstrap.yml | etc_hosts | Fully supported | No |
| bootstrap.yml | chrony | Fully supported | No |
| bootstrap.yml | proxy | None at present | No |
| bootstrap.yml | (/etc permissions) | None required - use image build | No |
| bootstrap.yml | (ssh /home fix) | None required - use image build | No |
Expand Down
5 changes: 5 additions & 0 deletions ansible/roles/compute_init/files/compute-init.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
enable_manila: "{{ os_metadata.meta.manila | default(false) | bool }}"
enable_basic_users: "{{ os_metadata.meta.basic_users | default(false) | bool }}"
enable_eessi: "{{ os_metadata.meta.eessi | default(false) | bool }}"
enable_chrony: "{{ os_metadata.meta.chrony | default(false) | bool }}"

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

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

- name: Run chrony role
ansible.builtin.include_role:
name: mrlesmithjr.chrony

- name: Configure resolve.conf
block:
- name: Set nameservers in /etc/resolv.conf
Expand Down
2 changes: 2 additions & 0 deletions ansible/roles/compute_init/tasks/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
dest: tasks/tuned.yml
- src: ../../stackhpc.nfs/tasks/nfs-clients.yml
dest: tasks/nfs-clients.yml
- src: ../../mrlesmithjr.chrony
dest: roles/

- name: Add filter_plugins to ansible.cfg
lineinfile:
Expand Down
25 changes: 25 additions & 0 deletions docs/configuration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Configuration

This page provides configuration snippets for various services.

## Chrony

Use variables from the [mrlesmithjr.chrony](https://github.com/mrlesmithjr/ansible-chrony) role.

For example in: `environments/<environment>/inventory/group_vars/all/chrony`:

```
---
chrony_ntp_servers:
- server: ntp-0.example.org
options:
- option: iburst
- option: minpoll
val: 8
- server: ntp-1.example.org
options:
- option: iburst
- option: minpoll
val: 8
```
2 changes: 2 additions & 0 deletions requirements.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ roles:
- src: https://github.com/stackhpc/ansible-role-os-manila-mount.git
name: stackhpc.os-manila-mount
version: v25.1.1
- src: mrlesmithjr.chrony
version: v0.1.4

collections:
- name: containers.podman
Expand Down

0 comments on commit c6d35e1

Please sign in to comment.