diff --git a/ansible/.gitignore b/ansible/.gitignore index 62c9a543c..18b8d7e52 100644 --- a/ansible/.gitignore +++ b/ansible/.gitignore @@ -98,3 +98,5 @@ roles/* !roles/eessi/** !roles/topology/ !roles/topology/** +!roles/journald/ +!roles/journald/** diff --git a/ansible/bootstrap.yml b/ansible/bootstrap.yml index 50d024676..069d3f947 100644 --- a/ansible/bootstrap.yml +++ b/ansible/bootstrap.yml @@ -28,6 +28,15 @@ to update these variable names. ** NB: The actual secrets will not be changed.** when: "'secrets_openhpc_' in (hostvars[inventory_hostname] | join)" +- hosts: journald + gather_facts: false + tags: + - logging + - journald + tasks: + - import_role: + name: journald + - hosts: resolv_conf become: yes gather_facts: false diff --git a/ansible/roles/compute_init/README.md b/ansible/roles/compute_init/README.md index 7a95d2b74..9107cafc9 100644 --- a/ansible/roles/compute_init/README.md +++ b/ansible/roles/compute_init/README.md @@ -40,6 +40,7 @@ it also requires an image build with the role name added to the | hooks/pre.yml | ? | None at present | n/a | | validate.yml | n/a | Not relevant during boot | n/a | | bootstrap.yml | (wait for ansible-init) | Not relevant during boot | n/a | +| bootstrap.yml | journald | Fully supported | No | | bootstrap.yml | resolv_conf | Fully supported | No | | bootstrap.yml | etc_hosts | Fully supported | No | | bootstrap.yml | chrony | Fully supported | No | diff --git a/ansible/roles/journald/README.md b/ansible/roles/journald/README.md new file mode 100644 index 000000000..bc1b81004 --- /dev/null +++ b/ansible/roles/journald/README.md @@ -0,0 +1,4 @@ +# journald + +This role is used to configue journald. Please see the [role +defaults](defaults/main.yml) for a full list of configuration options. diff --git a/ansible/roles/journald/defaults/main.yml b/ansible/roles/journald/defaults/main.yml new file mode 100644 index 000000000..9dcd9d49a --- /dev/null +++ b/ansible/roles/journald/defaults/main.yml @@ -0,0 +1,4 @@ +--- +# Journald storage. One of: volatile, persistent, auto, or none. Defaults to +# `persistent`. +journald_storage: persistent diff --git a/ansible/roles/journald/tasks/main.yml b/ansible/roles/journald/tasks/main.yml new file mode 100644 index 000000000..f49355543 --- /dev/null +++ b/ansible/roles/journald/tasks/main.yml @@ -0,0 +1,32 @@ +--- +- name: Create /var/log/journal + become: true + file: + path: /var/log/journal + owner: "root" + group: "systemd-journal" + mode: 02755 + state: directory + notify: Flush journal to disk + when: journald_storage == "persistent" + +- name: Ensure journald drop in directory exists + file: + path: "/etc/systemd/journald.conf.d/" + owner: "root" + group: "root" + mode: 0770 + state: directory + become: true + +- name: Ensure journald.conf overrides are set + copy: + content: | + [Journal] + Storage={{ journald_storage }} + dest: /etc/systemd/journald.conf.d/ansible-slurm-appliance.conf + owner: root + group: root + mode: 0660 + become: true + notify: Restart journald diff --git a/docs/experimental/isolated-clusters.md b/docs/experimental/isolated-clusters.md index c136e99ea..6895f4803 100644 --- a/docs/experimental/isolated-clusters.md +++ b/docs/experimental/isolated-clusters.md @@ -44,6 +44,7 @@ See above for definition of "Default" features. In the "Isolated?" column: | gateway | n/a | n/a - build only | | grafana | Y | Y | | hpctests | Y | Y | +| journald | Y | Y | | k3s_agent | - | ? | | k3s_server | - | ? | | k9s | - | ? | diff --git a/docs/monitoring-and-logging.md b/docs/monitoring-and-logging.md index 46b405a3e..b8565c0fb 100644 --- a/docs/monitoring-and-logging.md +++ b/docs/monitoring-and-logging.md @@ -301,6 +301,9 @@ slurm-stats is configured `slurm-stats` role in the [slurm_openstack_tools colle The `slurm_stats` group controls the placement of the `slurm_stats` service. This should be configured to be a group with a single host. That host must be co-located on the same host as the `filebeat` service that scrapes its output. +## Logging configuration +### Journald - +The [journald](../ansible/roles/journald/README.md) role is used to customise +journald configuration. diff --git a/environments/common/inventory/groups b/environments/common/inventory/groups index 6926355ed..85ad73322 100644 --- a/environments/common/inventory/groups +++ b/environments/common/inventory/groups @@ -26,6 +26,9 @@ login openhpc additional +[journald] +# Hosts where journald should be configured. See ansible/roles/journald/README.md. + [builder] # Do not add hosts here manually - used as part of Packer image build pipeline. See packer/README.md. diff --git a/environments/site/inventory/groups b/environments/site/inventory/groups index b78197df0..fa6b992f8 100644 --- a/environments/site/inventory/groups +++ b/environments/site/inventory/groups @@ -81,6 +81,10 @@ cluster # Hosts to recompile Slurm for - allows supporting Slurm autodetection method 'nvml' cuda +[journald:children] +# Hosts where journald should be configured. See ansible/roles/journald/README.md. +cluster + [eessi:children] # Hosts on which EESSI stack should be configured openhpc