|
4 | 4 | # The Universal Permissive License (UPL), Version 1.0 (see COPYING or https://oss.oracle.com/licenses/upl)
|
5 | 5 | # See LICENSE.TXT for details.
|
6 | 6 |
|
7 |
| -- name: Launch an instance |
| 7 | +- name: Launch an instance using PV BV |
8 | 8 | oracle.oci.oci_compute_instance:
|
9 | 9 | availability_domain: "{{ my_availability_domain }}"
|
10 | 10 | compartment_id: "{{ my_compartment_id }}"
|
|
33 | 33 | desired_state: DISABLED
|
34 | 34 | key_by: [compartment_id, availability_domain, display_name]
|
35 | 35 | 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" |
36 | 74 | vars:
|
37 | 75 | timestamp: "{{ now().strftime('%Y%m%d-%H%M%S') }}"
|
38 | 76 | retries: 10
|
|
96 | 134 | - h
|
97 | 135 | - i
|
98 | 136 |
|
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 |
102 | 139 | block:
|
103 | 140 | - name: Create block volume
|
104 | 141 | oracle.oci.oci_blockstorage_volume:
|
|
0 commit comments