mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
89b73cb535
* ios_ntp: Switch interface to GigabitEthernet0/1 for tests Lets use an interface we know that exists for testing, in some cases Loopback0 maybe not be configured. Signed-off-by: Paul Belanger <pabelanger@redhat.com> * ios_ntp: properly register result variable for testing This is currently broken, and tests don't work. Fix this by properly registering the result variable. Signed-off-by: Paul Belanger <pabelanger@redhat.com>
83 lines
1.5 KiB
YAML
83 lines
1.5 KiB
YAML
---
|
|
- name: remove NTP (if set)
|
|
ios_ntp: &remove
|
|
server: 10.75.32.5
|
|
source_int: "{{ test_interface }}"
|
|
acl: NTP_ACL
|
|
logging: true
|
|
key_id: 10
|
|
auth_key: 15435A030726242723273C21181319000A
|
|
auth: true
|
|
state: absent
|
|
ignore_errors: true
|
|
|
|
- block:
|
|
|
|
- name: configure NTP
|
|
ios_ntp: &config
|
|
server: 10.75.32.5
|
|
source_int: "{{ test_interface }}"
|
|
state: present
|
|
register: result
|
|
|
|
- assert: &true
|
|
that:
|
|
- "result.changed == true"
|
|
|
|
- name: idempotence check
|
|
ios_ntp: *config
|
|
register: result
|
|
|
|
- assert: &false
|
|
that:
|
|
- "result.changed == false"
|
|
|
|
- name: configure NTP
|
|
ios_ntp: &config1
|
|
acl: NTP_ACL
|
|
logging: true
|
|
state: present
|
|
register: result
|
|
|
|
- assert: *true
|
|
|
|
- name: idempotence check
|
|
ios_ntp: *config1
|
|
register: result
|
|
|
|
- assert: *false
|
|
|
|
- name: configure NTP with diffferen values
|
|
ios_ntp: &config2
|
|
key_id: 10
|
|
auth_key: 15435A030726242723273C21181319000A
|
|
auth: true
|
|
state: present
|
|
register: result
|
|
|
|
- assert: *true
|
|
|
|
- name: idempotence check
|
|
ios_ntp: *config2
|
|
register: result
|
|
|
|
- assert: *false
|
|
|
|
- name: remove part of config
|
|
ios_ntp: &config3
|
|
acl: NTP_ACL
|
|
logging: true
|
|
state: absent
|
|
register: result
|
|
|
|
- assert: *true
|
|
|
|
- name: idempotence check
|
|
ios_ntp: *config3
|
|
register: result
|
|
|
|
- assert: *false
|
|
|
|
always:
|
|
- name: Remove ntp config
|
|
ios_ntp: *remove
|