From a13a7a017b60696c1905deb920d5ff1e0e144327 Mon Sep 17 00:00:00 2001 From: Roberto Alfieri Date: Wed, 14 Aug 2024 17:34:15 +0200 Subject: [PATCH] [reproducer] Enable configuration of NTP service on controller-0 controller-0 was the only vm deployed by the framework where the NTP service wasn't enabled and that led to some issues while parsing log files. We are going to use the `timesync` role from the `linux-system-roles` collection just like we do in EDPM compute nodes in the `edpm-ansible` collection. By default the configuration will enable all the NTP servers provided by the dhcp server, plus `pool.ntp.org` server that can be overridden declaring the `cifmw_ntp_server` variable. Closes: https://issues.redhat.com/browse/OSPRH-9299 Signed-off-by: Roberto Alfieri --- docs/source/usage/01_usage.md | 1 + galaxy.yml | 1 + requirements.yml | 3 +++ roles/reproducer/tasks/configure_controller.yml | 16 ++++++++++++++++ 4 files changed, 21 insertions(+) diff --git a/docs/source/usage/01_usage.md b/docs/source/usage/01_usage.md index 0caed9361f..f69c55fbcc 100644 --- a/docs/source/usage/01_usage.md +++ b/docs/source/usage/01_usage.md @@ -71,6 +71,7 @@ are shared among multiple roles: - `cifmw_run_compute_compliance_scans`: (Bool) Specifies whether to run compliance scans on the first compute. Defaults to `false`. - `cifmw_run_id`: (String) CI Framework run identifier. This is used in libvirt_manager, to add some uniqueness to some types of virtual machines (anything that's not OCP, CRC nor controller). If not set, the Framework will generate a random string for you, and store it on the target host, in `{{ cifmw_basedir }}/artifacts/run-id` +- `cifmw_ntp_server`: (String) Specifies an ntp server to use. Now it's only used in `controller-0` environment. Defaults to `pool.ntp.org`. ```{admonition} Words of caution :class: danger diff --git a/galaxy.yml b/galaxy.yml index 59e5b351ce..d0e53c0f95 100644 --- a/galaxy.yml +++ b/galaxy.yml @@ -85,6 +85,7 @@ dependencies: 'git+https://github.com/ansible-collections/mellanox.onyx': 'master' 'git+https://github.com/openshift/community.okd': 'main' 'git+https://github.com/ovirt/ovirt-ansible-collection': 'master' + 'fedora.linux_system_roles': '1.87.1' # The URL of the originating SCM repository repository: https://github.com/openstack-k8s-operators/ci-framework diff --git a/requirements.yml b/requirements.yml index 995e244dd0..f9043fc9a0 100644 --- a/requirements.yml +++ b/requirements.yml @@ -13,6 +13,9 @@ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. +roles: + - name: https://github.com/linux-system-roles/timesync.git + version: 1.9.0 collections: - name: https://github.com/ansible-collections/ansible.posix diff --git a/roles/reproducer/tasks/configure_controller.yml b/roles/reproducer/tasks/configure_controller.yml index bf4d14d997..e31b7ea8e0 100644 --- a/roles/reproducer/tasks/configure_controller.yml +++ b/roles/reproducer/tasks/configure_controller.yml @@ -9,6 +9,11 @@ ) | path_join }} +- name: Install linux-system-roles.timesync role + community.general.ansible_galaxy_install: + type: role + name: linux-system-roles.timesync + # The dynamic inventory sets the ansible_ssh_user to zuul once we get the proper # ssh configuration accesses set. - name: Configure controller-0 @@ -472,3 +477,14 @@ register: _sync_dep_install_result until: _sync_dep_install_result.finished retries: 20 + + - name: Configure the NTP service + become: true + vars: + timesync_dhcp_ntp_servers: true + timesync_ntp_servers: + - hostname: "{{ cifmw_ntp_server | default('pool.ntp.org') }}" + block: + - name: Include timesync role + ansible.builtin.include_role: + name: linux-system-roles.timesync