Skip to content

Commit 6a32a4d

Browse files
committed
add iscsi block vol for ocfs2 and ingress rules
1 parent 6a7ddd0 commit 6a32a4d

File tree

4 files changed

+54
-1
lines changed

4 files changed

+54
-1
lines changed

ol/block.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
- name: Attach the block volume
3030
oracle.oci.oci_compute_volume_attachment:
3131
instance_id: "{{ instance_id }}"
32-
type: paravirtualized
32+
type: "{{ volume_type }}"
3333
volume_id: "{{ volume_id }}"
3434
compartment_id: "{{ my_compartment_id }}"
3535
device: "/dev/oracleoci/oraclevd{{ block_devices[ansible_loop.index0] }}"

ol/build.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,42 @@
9696
- h
9797
- i
9898

99+
- name: Add block volume for ocfs2
100+
when:
101+
- "{{ item.value.add_ocfs_block_storage | default('false') | bool }}"
102+
block:
103+
- name: Create block volume
104+
oracle.oci.oci_blockstorage_volume:
105+
compartment_id: "{{ my_compartment_id }}"
106+
availability_domain: "{{ my_availability_domain }}"
107+
display_name: "bv-ocfs2"
108+
size_in_gbs: "{{ block_volume_size_in_gbs }}"
109+
key_by: [compartment_id, display_name]
110+
register: result
111+
retries: 10
112+
delay: 30
113+
until: result is not failed
114+
115+
- name: Set the block volume id
116+
ansible.builtin.set_fact:
117+
volume_id: "{{ result.volume.id }}"
118+
119+
- name: Attach the block volume
120+
oracle.oci.oci_compute_volume_attachment:
121+
instance_id: "{{ instance_id }}"
122+
type: "{{ volume_type }}"
123+
volume_id: "{{ volume_id }}"
124+
compartment_id: "{{ my_compartment_id }}"
125+
device: "/dev/oracleoci/oraclevdo"
126+
display_name: "blockvolume-vdo"
127+
is_read_only: false
128+
is_shareable: true
129+
key_by: [compartment_id, display_name]
130+
retries: 10
131+
delay: 30
132+
until: result is not failed
133+
134+
99135
- name: Print the public and private ip of the newly created instance
100136
ansible.builtin.debug:
101137
msg:

ol/default_vars.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ compute_instances:
33
instance_name: "ol-node-01"
44
type: "server"
55
boot_volume_size_in_gbs: 50
6+
add_ocfs_block_storage: false
67
os: "Oracle Linux"
78
os_version: "8"
89
instance_shape: "VM.Standard.E4.Flex"
@@ -17,6 +18,7 @@ debug_enabled: false
1718
add_block_storage: false
1819
block_volume_size_in_gbs: 50
1920
block_count: 1
21+
volume_type: "paravirtualized"
2022

2123
use_vnc: false
2224
vnc_port: "1"
@@ -47,6 +49,7 @@ use_nginx: false
4749
use_nfs: false
4850
use_quay_ha: false
4951
use_pcp: false
52+
use_ocfs2: false
5053

5154
use_vbox: false
5255
virtualbox_version: "7.1"

ol/templates/ingress_security_rules.j2

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,4 +93,18 @@ instance_ingress_security_rules:
9393
destination_port_range:
9494
max: 44321
9595
min: 44321
96+
{% endif %}
97+
{% if use_ocfs2 %}
98+
- source: "10.0.0.0/24"
99+
protocol: 6
100+
tcp_options:
101+
destination_port_range:
102+
max: 7777
103+
min: 7777
104+
- source: "10.0.0.0/24"
105+
protocol: 17
106+
udp_options:
107+
destination_port_range:
108+
max: 7777
109+
min: 7777
96110
{% endif %}

0 commit comments

Comments
 (0)