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