Skip to content

Commit 5ab2ffd

Browse files
committed
merge in iscsi ol bv code
2 parents a47231b + dd9d034 commit 5ab2ffd

File tree

3 files changed

+40
-2
lines changed

3 files changed

+40
-2
lines changed

ol/block.yml

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
# See LICENSE.TXT for details.
66

77
- name: Add block volumes to the instance
8-
when:
9-
- add_block_storage
8+
when: add_block_storage
109
block:
1110
- name: Create block volume
1211
oracle.oci.oci_blockstorage_volume:
@@ -40,3 +39,39 @@
4039
retries: 10
4140
delay: 30
4241
until: result is not failed
42+
43+
- name: Add block volumes to the instance
44+
when: item.value.add_bv | default('false') | bool
45+
block:
46+
- name: Create block volume
47+
oracle.oci.oci_blockstorage_volume:
48+
compartment_id: "{{ my_compartment_id }}"
49+
availability_domain: "{{ my_availability_domain }}"
50+
display_name: "blockvolume-vd{{ block_devices[ansible_loop.index0] }}"
51+
size_in_gbs: "{{ block_volume_size_in_gbs }}"
52+
key_by: [compartment_id, display_name]
53+
register: result
54+
vars:
55+
timestamp: "{{ now().strftime('%Y%m%d-%H%M%S') }}"
56+
retries: 10
57+
delay: 30
58+
until: result is not failed
59+
60+
- name: Set the block volume id
61+
ansible.builtin.set_fact:
62+
volume_id: "{{ result.volume.id }}"
63+
64+
- name: Attach the block volume
65+
oracle.oci.oci_compute_volume_attachment:
66+
instance_id: "{{ instance_id }}"
67+
type: "{{ volume_type }}"
68+
volume_id: "{{ volume_id }}"
69+
compartment_id: "{{ my_compartment_id }}"
70+
device: "/dev/oracleoci/oraclevd{{ block_devices[ansible_loop.index0] }}"
71+
display_name: "blockvolume-vd{{ block_devices[ansible_loop.index0] }}"
72+
is_read_only: false
73+
is_shareable: false
74+
key_by: [compartment_id, display_name]
75+
retries: 10
76+
delay: 30
77+
until: result is not failed

ol/default_vars.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ use_nfs: false
5151
use_quay_ha: false
5252
use_pcp: false
5353
use_ocfs2: false
54+
use_iscsi: false
5455

5556
use_vbox: false
5657
virtualbox_version: "7.1"

ol/templates/ingress_security_rules.j2

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,8 @@ instance_ingress_security_rules:
107107
destination_port_range:
108108
max: 7777
109109
min: 7777
110+
{% endif %}
111+
{% if use_iscsi %}
110112
- source: "10.0.0.0/24"
111113
protocol: 6
112114
tcp_options:

0 commit comments

Comments
 (0)