mirror of https://github.com/ansible/ansible.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
57 lines
1.1 KiB
YAML
57 lines
1.1 KiB
YAML
7 years ago
|
---
|
||
|
- debug: msg="START TRANSPORT:{{ connection.transport }} nxos_ntp sanity test"
|
||
|
|
||
|
- 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
|
||
|
provider: "{{ connection }}"
|
||
|
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
|
||
|
provider: "{{ connection }}"
|
||
|
register: result
|
||
|
|
||
|
- assert: &true
|
||
|
that:
|
||
|
- "result.changed == true"
|
||
|
|
||
|
- name: Idempotence Check
|
||
|
nxos_ntp: *config
|
||
|
register: result
|
||
|
|
||
|
- assert: &false
|
||
|
that:
|
||
|
- "result.changed == false"
|
||
|
|
||
|
- name: Remove ntp config
|
||
|
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 TRANSPORT:{{ connection.transport }} nxos_ntp sanity test"
|