Skip to content

Commit 4f6ab38

Browse files
committed
adjust var names and add bv oci service for iscsi automount
1 parent fb4d8da commit 4f6ab38

File tree

2 files changed

+42
-5
lines changed

2 files changed

+42
-5
lines changed

ol/build.yml

Lines changed: 41 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# The Universal Permissive License (UPL), Version 1.0 (see COPYING or https://oss.oracle.com/licenses/upl)
55
# See LICENSE.TXT for details.
66

7-
- name: Launch an instance
7+
- name: Launch an instance using PV BV
88
oracle.oci.oci_compute_instance:
99
availability_domain: "{{ my_availability_domain }}"
1010
compartment_id: "{{ my_compartment_id }}"
@@ -33,6 +33,44 @@
3333
desired_state: DISABLED
3434
key_by: [compartment_id, availability_domain, display_name]
3535
register: result
36+
when: volume_type != "iscsi"
37+
vars:
38+
timestamp: "{{ now().strftime('%Y%m%d-%H%M%S') }}"
39+
retries: 10
40+
delay: 30
41+
until: result is not failed
42+
43+
- name: Launch an instance using iSCSI BV
44+
oracle.oci.oci_compute_instance:
45+
availability_domain: "{{ my_availability_domain }}"
46+
compartment_id: "{{ my_compartment_id }}"
47+
name: "{{ item.value.instance_name | default('instance-'~timestamp) }}"
48+
source_details:
49+
image_id: "{{ ol_image_id }}"
50+
source_type: image
51+
boot_volume_size_in_gbs: "{{ item.value.boot_volume_size_in_gbs | default(50) | int }}"
52+
shape: "{{ instance_shape }}"
53+
shape_config:
54+
ocpus: "{{ instance_ocpus }}"
55+
memory_in_gbs: "{{ instance_memory }}"
56+
create_vnic_details:
57+
assign_public_ip: true
58+
hostname_label: "{{ item.value.instance_name | default('instance-'~timestamp) }}"
59+
subnet_id: "{{ my_subnet_id }}"
60+
metadata:
61+
ssh_authorized_keys: "{{ lookup('file', lookup('env', 'HOME') + '/.ssh/' + private_key + '.pub') }}"
62+
agent_config:
63+
is_monitoring_disabled: false
64+
is_management_disabled: false
65+
are_all_plugins_disabled: false
66+
plugins_config:
67+
- name: "OS Management Service Agent"
68+
desired_state: DISABLED
69+
- name: "Block Volume Management"
70+
desired_state: ENABLED
71+
key_by: [compartment_id, availability_domain, display_name]
72+
register: result
73+
when: volume_type == "iscsi"
3674
vars:
3775
timestamp: "{{ now().strftime('%Y%m%d-%H%M%S') }}"
3876
retries: 10
@@ -96,9 +134,8 @@
96134
- h
97135
- i
98136

99-
- name: Add block volume for ocfs2
100-
when:
101-
- "{{ item.value.add_ocfs_block_storage | default('false') | bool }}"
137+
- name: Add host level block volume
138+
when: item.value.add_bv | default('false') | bool
102139
block:
103140
- name: Create block volume
104141
oracle.oci.oci_blockstorage_volume:

ol/default_vars.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +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
6+
add_bv: false
77
os: "Oracle Linux"
88
os_version: "8"
99
instance_shape: "VM.Standard.E4.Flex"

0 commit comments

Comments
 (0)