Skip to content

Commit

Permalink
Moved the tasks above and changed failed_when to ignore_errors
Browse files Browse the repository at this point in the history
  • Loading branch information
y0rune committed Apr 4, 2023
1 parent 3b24d42 commit 0e3ead4
Showing 1 changed file with 33 additions and 34 deletions.
67 changes: 33 additions & 34 deletions tests/integration/targets/meraki_ms_l3_interface/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,40 +25,6 @@
state: present
delegate_to: localhost

- name: Query all l3 interfaces
cisco.meraki.meraki_ms_l3_interface:
auth_key: "{{ auth_key }}"
state: query
serial: "{{ serial_switch_l3 }}"
delegate_to: localhost
register: query_all

- name: Set fact interface_id_1
ansible.builtin.set_fact:
interface_id_1: "{{query_all.data.1.interface_id}}"
failed_when: false
changed_when: false

- name: Assert query_all
ansible.builtin.assert:
that:
- query_all.data is defined
- query_all.data | length > 0

- name: Query one l3 interface
cisco.meraki.meraki_ms_l3_interface:
auth_key: "{{ auth_key }}"
state: query
serial: "{{ serial_switch_l3 }}"
name: Test L3 interface
delegate_to: localhost
register: query_one

- name: Assert query_one
ansible.builtin.assert:
that:
- query_one.data is defined

- name: Create l3 interface in check mode
cisco.meraki.meraki_ms_l3_interface:
auth_key: "{{ auth_key }}"
Expand Down Expand Up @@ -112,6 +78,39 @@
- create.data is defined
- create is changed

- name: Query all l3 interfaces
cisco.meraki.meraki_ms_l3_interface:
auth_key: "{{ auth_key }}"
state: query
serial: "{{ serial_switch_l3 }}"
delegate_to: localhost
register: query_all

- name: Set fact interface_id_1
ansible.builtin.set_fact:
interface_id_1: "{{query_all.data.1.interface_id}}"
ignore_errors: true

- name: Assert query_all
ansible.builtin.assert:
that:
- query_all.data is defined
- query_all.data | length > 0

- name: Query one l3 interface
cisco.meraki.meraki_ms_l3_interface:
auth_key: "{{ auth_key }}"
state: query
serial: "{{ serial_switch_l3 }}"
name: Test L3 interface
delegate_to: localhost
register: query_one

- name: Assert query_one
ansible.builtin.assert:
that:
- query_one.data is defined

- name: Update l3 interface with check mode
cisco.meraki.meraki_ms_l3_interface:
auth_key: "{{ auth_key }}"
Expand Down

0 comments on commit 0e3ead4

Please sign in to comment.