summaryrefslogtreecommitdiffstats
path: root/ansible_collections/purestorage/fusion/tests/integration/targets/fusion_nig/tasks/main.yml
blob: 8e3ab298b463fddf1cf387a0248a8ace7523dd36 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
- name: Create new network interface group
  purestorage.fusion.fusion_nig:
    name: "foo_group"
    availability_zone: az1
    region: pure-us-west
    state: present
    mtu: 1500
    gateway: 172.17.17.1
    prefix: 172.17.17.0/24
  environment: "{{ test_env }}"
  register: result
- name: Validate the task
  ansible.builtin.assert:
    that:
      - result is success
      - result is changed

- name: Collect network_interface_groups and check the group exist
  purestorage.fusion.fusion_info:
    gather_subset: network_interface_groups
  register: fusion_info
  environment: "{{ test_env }}"
- name: Validate the task
  ansible.builtin.assert:
    that: "'pure-us-west/az1/foo_group' in fusion_info['fusion_info']['network_interface_groups']"

- name: Delete network interface group
  purestorage.fusion.fusion_nig:
    name: "foo_group"
    availability_zone: az1
    region: pure-us-west
    state: absent
  register: result
  environment: "{{ test_env }}"
- name: Validate the task
  ansible.builtin.assert:
    that:
      - result is success
      - result is changed

- name: Collect network_interface_groups and check the group does not exist
  purestorage.fusion.fusion_info:
    gather_subset: network_interface_groups
  register: fusion_info
  environment: "{{ test_env }}"
- name: Validate the task
  ansible.builtin.assert:
    that: "'pure-us-west/az1/foo_group' not in fusion_info['fusion_info']['network_interface_groups']"