|
29 | 29 | debug_enabled: false
|
30 | 30 |
|
31 | 31 | tasks:
|
32 |
| - |
33 | 32 | - name: Get location of oci_config
|
34 | 33 | ansible.builtin.set_fact:
|
35 | 34 | oci_config_file: "{{ lookup('env', 'HOME') + '/.oci/config' }}"
|
|
86 | 85 | env_lookup: "{{ lookup('ansible.builtin.env', 'OCI_COMPARTMENT_OCID') }}"
|
87 | 86 | ini_lookup: "{{ lookup('ini', 'compartment-id section={{ oci_config_section }} file={{ oci_config_file }}') }}"
|
88 | 87 | ansible.builtin.set_fact:
|
89 |
| - my_compartment_id: "{{ compartment_id | default(env_lookup, true | default(ini_lookup, true)) }}" |
| 88 | + my_compartment_id: "{{ compartment_id | default(env_lookup, true) | default(ini_lookup, true) }}" |
90 | 89 |
|
91 | 90 | - name: Create oci state file
|
92 | 91 | ansible.builtin.file:
|
|
112 | 111 |
|
113 | 112 | - name: Generate random hex string
|
114 | 113 | vars:
|
115 |
| - hex_chars: '0123456789abcdef' |
| 114 | + hex_chars: "0123456789abcdef" |
116 | 115 | ansible.builtin.set_fact:
|
117 | 116 | vcn_code: "{{ query('community.general.random_string', upper=false, lower=false, override_special=hex_chars, numbers=false) }}"
|
118 | 117 |
|
|
147 | 146 | vcn_id: "{{ my_vcn_id }}"
|
148 | 147 | is_enabled: true
|
149 | 148 | display_name: "Internet Gateway-OLV-VCN"
|
150 |
| - state: 'present' |
| 149 | + state: "present" |
151 | 150 | register: result
|
152 | 151 | retries: 10
|
153 | 152 | delay: 30
|
|
200 | 199 | - service_id: "{{ my_service_id }}"
|
201 | 200 | vcn_id: "{{ my_vcn_id }}"
|
202 | 201 | display_name: "Service Gateway-OLV-VCN"
|
203 |
| - state: 'present' |
| 202 | + state: "present" |
204 | 203 | register: result
|
205 | 204 | retries: 10
|
206 | 205 | delay: 30
|
|
224 | 223 | vcn_id: "{{ my_vcn_id }}"
|
225 | 224 | display_name: "Default Route Table for OLV-VCN"
|
226 | 225 | route_rules:
|
227 |
| - - |
228 |
| - network_entity_id: "{{ my_internet_gateway_id }}" |
| 226 | + - network_entity_id: "{{ my_internet_gateway_id }}" |
229 | 227 | destination: "0.0.0.0/0"
|
230 | 228 | destination_type: CIDR_BLOCK
|
231 |
| - state: 'present' |
| 229 | + state: "present" |
232 | 230 | register: result
|
233 | 231 | retries: 10
|
234 | 232 | delay: 30
|
|
252 | 250 | vcn_id: "{{ my_vcn_id }}"
|
253 | 251 | display_name: "Route Table for Private Subnet-OLV-VCN"
|
254 | 252 | route_rules:
|
255 |
| - - |
256 |
| - network_entity_id: "{{ my_service_gateway_id }}" |
| 253 | + - network_entity_id: "{{ my_service_gateway_id }}" |
257 | 254 | destination: "{{ my_service_cidr_block }}"
|
258 | 255 | destination_type: SERVICE_CIDR_BLOCK
|
259 |
| - state: 'present' |
| 256 | + state: "present" |
260 | 257 | register: result
|
261 | 258 | retries: 10
|
262 | 259 | delay: 30
|
|
487 | 484 | gather_facts: false
|
488 | 485 |
|
489 | 486 | tasks:
|
490 |
| - |
491 | 487 | - name: Print instance details
|
492 | 488 | ansible.builtin.debug:
|
493 | 489 | msg:
|
|
0 commit comments