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