I have the below playbook which creates 20 volumes
i have parameter called type which has 2 values [ rw and dp].
my req is: how to create 10 volumes with type rw and 10 volumes type dp in one playbook.
tasks:
- name: Create FlexVol
na_ontap_volume:
state: absent
name: vol1{{item}}
is_infinite: False
aggregate_name: aggr1
type:
size: 10
size_unit: gb
junction_path: “/vol{{ item }}”
tiering_policy: auto
policy: default
percent_snapshot_space: 20
vserver: systemic_iscsi_aggr3svm1
wait_for_completion: True
space_slo: none
nvfail_enabled: False
comment: ansible created volume
hostname: “{{aiqumip }}”
username: “{{ aiqumusername }}”
password: “{{ aiqumpassword }}”
with_sequence: start=1 end=20
loop_control:
loop_var: volume_item
register: volcreate
ignore_errors: True - name: 100 volumes created successfully
debug: msg “{{ volcreate }}”