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