Skip to content

Commit

Permalink
add loop control and index0
Browse files Browse the repository at this point in the history
  • Loading branch information
bgraef committed Sep 20, 2024
1 parent a662def commit f461aa1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion ol/block.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
type: paravirtualized
volume_id: "{{ volume_id }}"
compartment_id: "{{ my_compartment_id }}"
device: "{{ block_devices[ansible_loop.index] }}"
device: "/dev/oracleoci/oraclevd{{ block_devices[ansible_loop.index0] }}"
is_read_only: false
is_shareable: false
retries: 10
Expand Down
12 changes: 7 additions & 5 deletions ol/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,15 @@
- name: Add block storage to an instance
ansible.builtin.include_tasks: "block.yml"
loop: "{{ query('sequence', 'start=1 end='+(block_count)|string) }}"
loop_control:
extended: true
vars:
block_devices:
- sdb
- sdc
- sdd
- sde
- sdf
- b
- c
- d
- e
- f

- name: Print the public and private ip of the newly created instance
ansible.builtin.debug:
Expand Down

0 comments on commit f461aa1

Please sign in to comment.