-
Notifications
You must be signed in to change notification settings - Fork 44
/
Copy pathtests_ntp_provider1.yml
44 lines (39 loc) · 1.03 KB
/
tests_ntp_provider1.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
---
- name: Configure NTP with default provider
hosts: all
vars:
timesync_ntp_servers:
- hostname: 172.16.123.1
roles:
- linux-system-roles.timesync
pre_tasks:
- name: Common test setup tasks
include_tasks: tasks/setup.yml
vars:
__timesync_ostree_unsupported: true
- name: Remove provider packages
check_mode: false
tags: tests::setup
block:
- name: Remove NTP providers
package:
name: "{{ item }}"
state: absent
with_items:
- chrony
- ntp
post_tasks:
- name: Verify provider is working
tags: tests::verify
block:
- name: Wait for services to start
wait_for:
timeout: 2
- name: Get list of currently used time sources
shell: chronyc -n sources || ntpq -pn
register: sources
changed_when: false
- name: Check time sources
assert:
that:
- "'172.16.123.1' in sources.stdout"