ansible/test/integration/targets/nxos_system/tests/common/sanity.yaml

129 lines
2.4 KiB
YAML
Raw Normal View History

---
- 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
- name: configure hostname and domain-name
nxos_system: &hostname
hostname: switch
domain_name: test.example.com
2018-05-22 08:49:34 +00:00
register: result
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"
- name: configure name servers
2018-05-22 08:49:34 +00:00
nxos_system: &ns
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
- name: configure name servers with VRF support
2018-05-22 08:49:34 +00:00
nxos_system: &nsv
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
always:
2018-05-22 08:49:34 +00:00
- name: remove configuration
nxos_system: *remove
- name: Re-configure hostname
nxos_system: *hostname
- debug: msg="END connection={{ ansible_connection }}/sanity.yaml"