2018-02-17 04:44:50 +00:00
|
|
|
---
|
|
|
|
- debug: msg="START connection={{ ansible_connection }}/sanity.yaml"
|
|
|
|
- debug: msg="Using provider={{ connection.transport }}"
|
|
|
|
when: ansible_connection == "local"
|
|
|
|
|
|
|
|
- block:
|
2018-05-22 08:49:34 +00:00
|
|
|
- name: remove configuration
|
|
|
|
nxos_system: &remove
|
|
|
|
state: absent
|
|
|
|
register: result
|
|
|
|
ignore_errors: yes
|
|
|
|
|
|
|
|
- name: configure domain lookup
|
|
|
|
nxos_system: &dlo
|
|
|
|
domain_lookup: true
|
|
|
|
state: present
|
|
|
|
register: result
|
|
|
|
|
2018-02-17 04:44:50 +00:00
|
|
|
- name: configure hostname and domain-name
|
|
|
|
nxos_system: &hostname
|
2018-02-19 05:27:16 +00:00
|
|
|
hostname: switch
|
2018-02-17 04:44:50 +00:00
|
|
|
domain_name: test.example.com
|
2018-05-22 08:49:34 +00:00
|
|
|
register: result
|
2018-02-17 04:44:50 +00:00
|
|
|
|
2018-05-22 08:49:34 +00:00
|
|
|
- assert: &true
|
|
|
|
that:
|
|
|
|
- "result.changed == true"
|
|
|
|
|
|
|
|
- name: Idempotence check
|
|
|
|
nxos_system: *hostname
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert: &false
|
|
|
|
that:
|
|
|
|
- "result.changed == false"
|
2018-02-17 04:44:50 +00:00
|
|
|
|
|
|
|
- name: configure name servers
|
2018-05-22 08:49:34 +00:00
|
|
|
nxos_system: &ns
|
2018-02-17 04:44:50 +00:00
|
|
|
name_servers:
|
|
|
|
- 8.8.8.8
|
|
|
|
- 8.8.4.4
|
2018-05-22 08:49:34 +00:00
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert: *true
|
|
|
|
|
|
|
|
- name: Idempotence check
|
|
|
|
nxos_system: *ns
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert: *false
|
2018-02-17 04:44:50 +00:00
|
|
|
|
|
|
|
- name: configure name servers with VRF support
|
2018-05-22 08:49:34 +00:00
|
|
|
nxos_system: &nsv
|
2018-02-17 04:44:50 +00:00
|
|
|
name_servers:
|
|
|
|
- { server: 8.8.8.8, vrf: management }
|
|
|
|
- { server: 8.8.4.4, vrf: management }
|
2018-05-22 08:49:34 +00:00
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert: *true
|
|
|
|
|
|
|
|
- name: Idempotence check
|
|
|
|
nxos_system: *nsv
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert: *false
|
|
|
|
|
|
|
|
- name: configure domain lookup1
|
|
|
|
nxos_system: &ndlo
|
|
|
|
domain_lookup: false
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert: *true
|
|
|
|
|
|
|
|
- name: Idempotence check
|
|
|
|
nxos_system: *ndlo
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert: *false
|
|
|
|
|
|
|
|
- name: configure domain lookup2
|
|
|
|
nxos_system: *dlo
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert: *true
|
|
|
|
|
|
|
|
- name: Idempotence check
|
|
|
|
nxos_system: *dlo
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert: *false
|
|
|
|
|
|
|
|
- name: configure system mtu
|
|
|
|
nxos_system: &sysmtu
|
|
|
|
system_mtu: 3000
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert: *true
|
|
|
|
|
|
|
|
- name: Idempotence check
|
|
|
|
nxos_system: *sysmtu
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert: *false
|
|
|
|
|
|
|
|
- name: default configuration
|
|
|
|
nxos_system: &default
|
|
|
|
hostname: default
|
|
|
|
domain_name: default
|
|
|
|
name_servers: default
|
|
|
|
system_mtu: default
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert: *true
|
|
|
|
|
|
|
|
- name: Idempotence check
|
|
|
|
nxos_system: *default
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert: *false
|
2018-02-17 04:44:50 +00:00
|
|
|
|
|
|
|
always:
|
2018-05-22 08:49:34 +00:00
|
|
|
- name: remove configuration
|
|
|
|
nxos_system: *remove
|
|
|
|
|
2018-02-17 04:44:50 +00:00
|
|
|
- name: Re-configure hostname
|
|
|
|
nxos_system: *hostname
|
|
|
|
|
|
|
|
- debug: msg="END connection={{ ansible_connection }}/sanity.yaml"
|