Skip to content

Commit a02fa81

Browse files
authored
Merge pull request #54 from bgraef/main
fix for ol attach block volumes
2 parents f80cb7f + 21bbdbd commit a02fa81

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ Temporary Items
3434

3535
# Ansible playbook runtime
3636
*/buffer/*
37+
*.ansible/*
3738

3839
# VS Code files for those working on multiple tools
3940
**/.vscode/*

ol/block.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@
1212
oracle.oci.oci_blockstorage_volume:
1313
compartment_id: "{{ my_compartment_id }}"
1414
availability_domain: "{{ my_availability_domain }}"
15-
display_name: "blockvolume-{{ item.value.instance_name | default('instance-'~timestamp) }}"
15+
display_name: "blockvolume-vd{{ block_devices[ansible_loop.index0] }}"
1616
size_in_gbs: "{{ block_volume_size_in_gbs }}"
17+
key_by: [compartment_id, display_name]
1718
register: result
1819
vars:
1920
timestamp: "{{ now().strftime('%Y%m%d-%H%M%S') }}"
@@ -32,8 +33,10 @@
3233
volume_id: "{{ volume_id }}"
3334
compartment_id: "{{ my_compartment_id }}"
3435
device: "/dev/oracleoci/oraclevd{{ block_devices[ansible_loop.index0] }}"
36+
display_name: "blockvolume-vd{{ block_devices[ansible_loop.index0] }}"
3537
is_read_only: false
3638
is_shareable: false
39+
key_by: [compartment_id, display_name]
3740
retries: 10
3841
delay: 30
3942
until: result is not failed

ol/build.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@
8383
ansible.builtin.include_tasks: "block.yml"
8484
loop: "{{ query('sequence', 'start=1 end=' + (block_count) | string) }}"
8585
loop_control:
86+
loop_var: blk_devices
8687
extended: true
8788
vars:
8889
block_devices:
@@ -91,6 +92,9 @@
9192
- d
9293
- e
9394
- f
95+
- g
96+
- h
97+
- i
9498

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

0 commit comments

Comments
 (0)