|
- ---
- - name: list subnet
- include: list.yml
- vars:
- subnet: "{{ item }}"
- when:
- - action is defined
- - action == 'list'
- - (subnets | default([], true) | length) > 0
- with_items: "{{ subnets }}"
-
- - name: In subnet state
- include: "{{ item.state | default('present', true) }}.yml"
- vars:
- subnet: "{{ item }}"
- when:
- - action is undefined
- - (subnets | default([], true) | length) > 0
- with_items: "{{ subnets }}"
-
- - name: Update/create subnet
- include: present.yml
- vars:
- subnet: "{{ item }}"
- when:
- - action is defined
- - action == 'present'
- - (subnets | default([], true) | length) > 0
- with_items: "{{ subnets }}"
-
- - name: Delete subnet
- include: absent.yml
- vars:
- subnet: "{{ item }}"
- when:
- - action is defined
- - action == 'absent'
- - (subnets | default([], true) | length) > 0
- with_items: "{{ subnets }}"
- ...
|