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.
88 lines
2.0 KiB
YAML
88 lines
2.0 KiB
YAML
7 years ago
|
---
|
||
|
- debug: msg="START TRANSPORT:{{ connection.transport }} nxos_ntp_auth sanity test"
|
||
|
|
||
|
- name: Configure text ntp authentication
|
||
|
nxos_ntp_auth: &setup
|
||
|
key_id: 32
|
||
|
md5string: hello
|
||
|
state: absent
|
||
|
provider: "{{ connection }}"
|
||
|
ignore_errors: yes
|
||
|
|
||
|
- block:
|
||
|
|
||
|
- name: Configure text ntp authentication
|
||
|
nxos_ntp_auth: &configure_text
|
||
|
key_id: 32
|
||
|
md5string: hello
|
||
|
auth_type: text
|
||
|
trusted_key: true
|
||
|
authentication: on
|
||
|
state: present
|
||
|
provider: "{{ connection }}"
|
||
|
register: result
|
||
|
|
||
|
- assert: &true
|
||
|
that:
|
||
|
- "result.changed == true"
|
||
|
|
||
|
- name: "Check Idempotence - Configure text ntp authentication"
|
||
|
nxos_ntp_auth: *configure_text
|
||
|
register: result
|
||
|
|
||
|
- assert: &false
|
||
|
that:
|
||
|
- "result.changed == false"
|
||
|
|
||
|
- name: Remove text ntp authentication
|
||
|
nxos_ntp_auth: &remove_text
|
||
|
key_id: 32
|
||
|
md5string: hello
|
||
|
auth_type: text
|
||
|
trusted_key: true
|
||
|
authentication: on
|
||
|
state: absent
|
||
|
provider: "{{ connection }}"
|
||
|
register: result
|
||
|
|
||
|
- assert: *true
|
||
|
|
||
|
- name: Configure encrypt ntp authentication
|
||
|
nxos_ntp_auth: &configure_encrypt
|
||
|
key_id: 32
|
||
|
md5string: hello
|
||
|
auth_type: encrypt
|
||
|
trusted_key: true
|
||
|
authentication: on
|
||
|
state: present
|
||
|
provider: "{{ connection }}"
|
||
|
register: result
|
||
|
|
||
|
- assert: *true
|
||
|
|
||
|
- name: "Check Idempotence - Configure encrypt ntp authentication"
|
||
|
nxos_ntp_auth: *configure_encrypt
|
||
|
register: result
|
||
|
|
||
|
- assert: *false
|
||
|
|
||
|
- name: Remove encrypt ntp authentication
|
||
|
nxos_ntp_auth: &remove_encrypt
|
||
|
key_id: 32
|
||
|
md5string: hello
|
||
|
auth_type: encrypt
|
||
|
trusted_key: true
|
||
|
authentication: on
|
||
|
state: absent
|
||
|
provider: "{{ connection }}"
|
||
|
register: result
|
||
|
|
||
|
- assert: *true
|
||
|
|
||
|
always:
|
||
|
- name: Cleanup ntp auth config
|
||
|
nxos_ntp_auth: *setup
|
||
|
ignore_errors: yes
|
||
|
|
||
|
- debug: msg="END TRANSPORT:{{ connection.transport }} nxos_ntp_auth sanity test"
|