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

137 lines
2.7 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 10:49:34 +02:00
- name: remove configuration
nxos_system: &remove
provider: "{{ connection }}"
2018-05-22 10:49:34 +02:00
state: absent
register: result
ignore_errors: yes
- name: configure domain lookup
nxos_system: &dlo
domain_lookup: true
provider: "{{ connection }}"
2018-05-22 10:49:34 +02:00
state: present
register: result
- name: configure hostname and domain-name
nxos_system: &hostname
hostname: switch
domain_name: test.example.com
provider: "{{ connection }}"
2018-05-22 10:49:34 +02:00
register: result
2018-05-22 10:49:34 +02: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 10:49:34 +02:00
nxos_system: &ns
name_servers:
- 8.8.8.8
- 8.8.4.4
provider: "{{ connection }}"
2018-05-22 10:49:34 +02: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 10:49:34 +02:00
nxos_system: &nsv
name_servers:
- { server: 8.8.8.8, vrf: management }
- { server: 8.8.4.4, vrf: management }
provider: "{{ connection }}"
2018-05-22 10:49:34 +02: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
provider: "{{ connection }}"
2018-05-22 10:49:34 +02:00
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
provider: "{{ connection }}"
2018-05-22 10:49:34 +02:00
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
provider: "{{ connection }}"
2018-05-22 10:49:34 +02:00
register: result
- assert: *true
- name: Idempotence check
nxos_system: *default
register: result
- assert: *false
always:
2018-05-22 10:49:34 +02:00
- name: remove configuration
nxos_system: *remove
- name: Re-configure hostname
nxos_system: *hostname
- debug: msg="END connection={{ ansible_connection }}/sanity.yaml"