Skip to content

Commit a13a7a0

Browse files
rebtooropenshift-merge-bot[bot]
authored andcommitted
[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 <[email protected]>
1 parent 1d7b650 commit a13a7a0

File tree

4 files changed

+21
-0
lines changed

4 files changed

+21
-0
lines changed

docs/source/usage/01_usage.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ are shared among multiple roles:
7171
- `cifmw_run_compute_compliance_scans`: (Bool) Specifies whether to run compliance scans on the first compute. Defaults to `false`.
7272
- `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).
7373
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`
74+
- `cifmw_ntp_server`: (String) Specifies an ntp server to use. Now it's only used in `controller-0` environment. Defaults to `pool.ntp.org`.
7475

7576
```{admonition} Words of caution
7677
:class: danger

galaxy.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ dependencies:
8585
'git+https://github.com/ansible-collections/mellanox.onyx': 'master'
8686
'git+https://github.com/openshift/community.okd': 'main'
8787
'git+https://github.com/ovirt/ovirt-ansible-collection': 'master'
88+
'fedora.linux_system_roles': '1.87.1'
8889

8990
# The URL of the originating SCM repository
9091
repository: https://github.com/openstack-k8s-operators/ci-framework

requirements.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
1414
# License for the specific language governing permissions and limitations
1515
# under the License.
16+
roles:
17+
- name: https://github.com/linux-system-roles/timesync.git
18+
version: 1.9.0
1619

1720
collections:
1821
- name: https://github.com/ansible-collections/ansible.posix

roles/reproducer/tasks/configure_controller.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@
99
) | path_join
1010
}}
1111
12+
- name: Install linux-system-roles.timesync role
13+
community.general.ansible_galaxy_install:
14+
type: role
15+
name: linux-system-roles.timesync
16+
1217
# The dynamic inventory sets the ansible_ssh_user to zuul once we get the proper
1318
# ssh configuration accesses set.
1419
- name: Configure controller-0
@@ -472,3 +477,14 @@
472477
register: _sync_dep_install_result
473478
until: _sync_dep_install_result.finished
474479
retries: 20
480+
481+
- name: Configure the NTP service
482+
become: true
483+
vars:
484+
timesync_dhcp_ntp_servers: true
485+
timesync_ntp_servers:
486+
- hostname: "{{ cifmw_ntp_server | default('pool.ntp.org') }}"
487+
block:
488+
- name: Include timesync role
489+
ansible.builtin.include_role:
490+
name: linux-system-roles.timesync

0 commit comments

Comments
 (0)