mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
483df13626
* I seem to have forgotten the back half of tests * Set http timeout from persistent_command_timeout * Tweak URL generation and provide URL on error * Push var_options to connection process * Don't wait forever if coming from persistent * Don't send the entire contents of variables to ansible-connection
116 lines
2.1 KiB
YAML
116 lines
2.1 KiB
YAML
---
|
|
- debug: msg="START connection={{ ansible_connection }} nxos_ntp sanity test"
|
|
- debug: msg="Using provider={{ connection.transport }}"
|
|
when: ansible_connection == "local"
|
|
|
|
- name: Setup - Remove ntp if configured
|
|
nxos_ntp: &remove
|
|
server: 1.2.3.4
|
|
key_id: 32
|
|
prefer: disabled
|
|
vrf_name: management
|
|
source_addr: 5.5.5.5
|
|
state: absent
|
|
ignore_errors: yes
|
|
|
|
- block:
|
|
|
|
- name: Configure ntp
|
|
nxos_ntp: &config
|
|
server: 1.2.3.4
|
|
key_id: 32
|
|
prefer: enabled
|
|
vrf_name: management
|
|
source_addr: 5.5.5.5
|
|
state: present
|
|
register: result
|
|
|
|
- assert: &true
|
|
that:
|
|
- "result.changed == true"
|
|
|
|
- name: Idempotence Check
|
|
nxos_ntp: *config
|
|
register: result
|
|
|
|
- assert: &false
|
|
that:
|
|
- "result.changed == false"
|
|
|
|
- name: Configure ntp with some defaults
|
|
nxos_ntp: &config1
|
|
peer: 1.2.3.4
|
|
key_id: default
|
|
prefer: enabled
|
|
vrf_name: default
|
|
source_addr: default
|
|
state: present
|
|
register: result
|
|
|
|
- assert: *true
|
|
|
|
- name: Idempotence Check
|
|
nxos_ntp: *config1
|
|
register: result
|
|
|
|
- assert: *false
|
|
|
|
- name: Remove ntp config
|
|
nxos_ntp: *remove
|
|
register: result
|
|
|
|
- assert: *true
|
|
|
|
- name: Remove Idempotence Check
|
|
nxos_ntp: *remove
|
|
register: result
|
|
|
|
- assert: *false
|
|
|
|
- name: Configure ntp again
|
|
nxos_ntp: &config2
|
|
source_int: Ethernet1/3
|
|
peer: 1.2.3.4
|
|
prefer: enabled
|
|
state: present
|
|
register: result
|
|
|
|
- assert: *true
|
|
|
|
- name: Idempotence Check
|
|
nxos_ntp: *config2
|
|
register: result
|
|
|
|
- assert: *false
|
|
|
|
- name: Remove source interface
|
|
nxos_ntp: &config3
|
|
source_int: default
|
|
state: present
|
|
register: result
|
|
|
|
- assert: *true
|
|
|
|
- name: Idempotence Check
|
|
nxos_ntp: *config3
|
|
register: result
|
|
|
|
- assert: *false
|
|
|
|
- name: Remove ntp
|
|
nxos_ntp: *remove
|
|
register: result
|
|
|
|
- assert: *true
|
|
|
|
- name: Remove Idempotence Check
|
|
nxos_ntp: *remove
|
|
register: result
|
|
|
|
- assert: *false
|
|
|
|
always:
|
|
- name: Remove ntp config
|
|
nxos_ntp: *remove
|
|
|
|
- debug: msg="END connection={{ ansible_connection }} nxos_ntp sanity test"
|