Skip to content

Commit 0e366ae

Browse files
committed
fix oci yum mirror and add it to ocne2
1 parent 0ce3ed5 commit 0e366ae

File tree

5 files changed

+112
-103
lines changed

5 files changed

+112
-103
lines changed

ocne2/create_instance.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,14 @@
295295
- name: Configure instance
296296
ansible.builtin.include_tasks: "host_setup.yml"
297297

298+
- name: Change OCI YUM region
299+
ansible.builtin.copy:
300+
content: "{{ oci_yum_region | default(omit) }}"
301+
dest: /etc/yum/vars/ociregion
302+
mode: '0644'
303+
become: true
304+
when: oci_yum_region | default(omit) | length > 0
305+
298306
- name: Update all rpm packages
299307
ansible.builtin.import_playbook: update_all_rpms.yml
300308
when: update_all

ocne2/default_vars.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,5 @@ ocne_cluster_node_options: ""
2727
ocne_cluster_name: "ocne"
2828
num_cp_nodes: 3
2929
num_wk_nodes: 3
30-
update_all: false
30+
update_all: false
31+
#oci_yum_region: ".uk-london-1"

ol/build.yml

Lines changed: 99 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -7,109 +7,109 @@
77
- name: Launch an instance using PV BV
88
when: volume_type != "iscsi"
99
block:
10-
- name: Launch an instance
11-
oracle.oci.oci_compute_instance:
12-
availability_domain: "{{ my_availability_domain }}"
13-
compartment_id: "{{ my_compartment_id }}"
14-
name: "{{ item.value.instance_name | default('instance-'~timestamp) }}"
15-
source_details:
16-
image_id: "{{ ol_image_id }}"
17-
source_type: image
18-
boot_volume_size_in_gbs: "{{ item.value.boot_volume_size_in_gbs | default(50) | int }}"
19-
shape: "{{ instance_shape }}"
20-
shape_config:
21-
ocpus: "{{ instance_ocpus }}"
22-
memory_in_gbs: "{{ instance_memory }}"
23-
create_vnic_details:
24-
assign_public_ip: true
25-
hostname_label: "{{ item.value.instance_name | default('instance-'~timestamp) }}"
26-
subnet_id: "{{ my_subnet_id }}"
27-
metadata:
28-
ssh_authorized_keys: "{{ lookup('file', lookup('env', 'HOME') + '/.ssh/' + private_key + '.pub') }}"
29-
agent_config:
30-
is_monitoring_disabled: false
31-
is_management_disabled: false
32-
are_all_plugins_disabled: false
33-
plugins_config:
34-
-
35-
name: "OS Management Service Agent"
36-
desired_state: DISABLED
37-
key_by: [compartment_id, availability_domain, display_name]
38-
register: result
39-
vars:
40-
timestamp: "{{ now().strftime('%Y%m%d-%H%M%S') }}"
41-
retries: 10
42-
delay: 30
43-
until: result is not failed
44-
45-
- name: Print instance details
46-
ansible.builtin.debug:
47-
msg:
48-
- "Launched a new instance:"
49-
- "{{ result }}"
50-
when: debug_enabled
51-
52-
- name: Set the compute instance id
53-
ansible.builtin.set_fact:
54-
instance_id: "{{ result.instance.id }}"
55-
56-
- name: Set the compute instance display_name
57-
ansible.builtin.set_fact:
58-
instance_display_name: "{{ result.instance.display_name }}"
10+
- name: Launch an instance
11+
oracle.oci.oci_compute_instance:
12+
availability_domain: "{{ my_availability_domain }}"
13+
compartment_id: "{{ my_compartment_id }}"
14+
name: "{{ item.value.instance_name | default('instance-'~timestamp) }}"
15+
source_details:
16+
image_id: "{{ ol_image_id }}"
17+
source_type: image
18+
boot_volume_size_in_gbs: "{{ item.value.boot_volume_size_in_gbs | default(50) | int }}"
19+
shape: "{{ instance_shape }}"
20+
shape_config:
21+
ocpus: "{{ instance_ocpus }}"
22+
memory_in_gbs: "{{ instance_memory }}"
23+
create_vnic_details:
24+
assign_public_ip: true
25+
hostname_label: "{{ item.value.instance_name | default('instance-'~timestamp) }}"
26+
subnet_id: "{{ my_subnet_id }}"
27+
metadata:
28+
ssh_authorized_keys: "{{ lookup('file', lookup('env', 'HOME') + '/.ssh/' + private_key + '.pub') }}"
29+
agent_config:
30+
is_monitoring_disabled: false
31+
is_management_disabled: false
32+
are_all_plugins_disabled: false
33+
plugins_config:
34+
-
35+
name: "OS Management Service Agent"
36+
desired_state: DISABLED
37+
key_by: [compartment_id, availability_domain, display_name]
38+
register: result
39+
vars:
40+
timestamp: "{{ now().strftime('%Y%m%d-%H%M%S') }}"
41+
retries: 10
42+
delay: 30
43+
until: result is not failed
44+
45+
- name: Print instance details
46+
ansible.builtin.debug:
47+
msg:
48+
- "Launched a new instance:"
49+
- "{{ result }}"
50+
when: debug_enabled
51+
52+
- name: Set the compute instance id
53+
ansible.builtin.set_fact:
54+
instance_id: "{{ result.instance.id }}"
55+
56+
- name: Set the compute instance display_name
57+
ansible.builtin.set_fact:
58+
instance_display_name: "{{ result.instance.display_name }}"
5959

6060
- name: Launch an instance using iSCSI BV
6161
when: volume_type == "iscsi"
6262
block:
63-
- name: Launch an instance
64-
oracle.oci.oci_compute_instance:
65-
availability_domain: "{{ my_availability_domain }}"
66-
compartment_id: "{{ my_compartment_id }}"
67-
name: "{{ item.value.instance_name | default('instance-'~timestamp) }}"
68-
source_details:
69-
image_id: "{{ ol_image_id }}"
70-
source_type: image
71-
boot_volume_size_in_gbs: "{{ item.value.boot_volume_size_in_gbs | default(50) | int }}"
72-
shape: "{{ instance_shape }}"
73-
shape_config:
74-
ocpus: "{{ instance_ocpus }}"
75-
memory_in_gbs: "{{ instance_memory }}"
76-
create_vnic_details:
77-
assign_public_ip: true
78-
hostname_label: "{{ item.value.instance_name | default('instance-'~timestamp) }}"
79-
subnet_id: "{{ my_subnet_id }}"
80-
metadata:
81-
ssh_authorized_keys: "{{ lookup('file', lookup('env', 'HOME') + '/.ssh/' + private_key + '.pub') }}"
82-
agent_config:
83-
is_monitoring_disabled: false
84-
is_management_disabled: false
85-
are_all_plugins_disabled: false
86-
plugins_config:
87-
- name: "OS Management Service Agent"
88-
desired_state: DISABLED
89-
- name: "Block Volume Management"
90-
desired_state: ENABLED
91-
key_by: [compartment_id, availability_domain, display_name]
92-
register: result
93-
vars:
94-
timestamp: "{{ now().strftime('%Y%m%d-%H%M%S') }}"
95-
retries: 10
96-
delay: 30
97-
until: result is not failed
98-
99-
- name: Print instance details
100-
ansible.builtin.debug:
101-
msg:
102-
- "Launched a new instance:"
103-
- "{{ result }}"
104-
when: debug_enabled
105-
106-
- name: Set the compute instance id
107-
ansible.builtin.set_fact:
108-
instance_id: "{{ result.instance.id }}"
109-
110-
- name: Set the compute instance display_name
111-
ansible.builtin.set_fact:
112-
instance_display_name: "{{ result.instance.display_name }}"
63+
- name: Launch an instance
64+
oracle.oci.oci_compute_instance:
65+
availability_domain: "{{ my_availability_domain }}"
66+
compartment_id: "{{ my_compartment_id }}"
67+
name: "{{ item.value.instance_name | default('instance-'~timestamp) }}"
68+
source_details:
69+
image_id: "{{ ol_image_id }}"
70+
source_type: image
71+
boot_volume_size_in_gbs: "{{ item.value.boot_volume_size_in_gbs | default(50) | int }}"
72+
shape: "{{ instance_shape }}"
73+
shape_config:
74+
ocpus: "{{ instance_ocpus }}"
75+
memory_in_gbs: "{{ instance_memory }}"
76+
create_vnic_details:
77+
assign_public_ip: true
78+
hostname_label: "{{ item.value.instance_name | default('instance-'~timestamp) }}"
79+
subnet_id: "{{ my_subnet_id }}"
80+
metadata:
81+
ssh_authorized_keys: "{{ lookup('file', lookup('env', 'HOME') + '/.ssh/' + private_key + '.pub') }}"
82+
agent_config:
83+
is_monitoring_disabled: false
84+
is_management_disabled: false
85+
are_all_plugins_disabled: false
86+
plugins_config:
87+
- name: "OS Management Service Agent"
88+
desired_state: DISABLED
89+
- name: "Block Volume Management"
90+
desired_state: ENABLED
91+
key_by: [compartment_id, availability_domain, display_name]
92+
register: result
93+
vars:
94+
timestamp: "{{ now().strftime('%Y%m%d-%H%M%S') }}"
95+
retries: 10
96+
delay: 30
97+
until: result is not failed
98+
99+
- name: Print instance details
100+
ansible.builtin.debug:
101+
msg:
102+
- "Launched a new instance:"
103+
- "{{ result }}"
104+
when: debug_enabled
105+
106+
- name: Set the compute instance id
107+
ansible.builtin.set_fact:
108+
instance_id: "{{ result.instance.id }}"
109+
110+
- name: Set the compute instance display_name
111+
ansible.builtin.set_fact:
112+
instance_display_name: "{{ result.instance.display_name }}"
113113

114114
- name: Get the vnic attachment details of instance
115115
oracle.oci.oci_compute_vnic_attachment_facts:

ol/create_instance.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -297,11 +297,11 @@
297297

298298
- name: Change OCI YUM region
299299
ansible.builtin.copy:
300-
content: "{{ oci_yum_region }}"
300+
content: "{{ oci_yum_region | default(omit) }}"
301301
dest: /etc/yum/vars/ociregion
302302
mode: '0644'
303303
become: true
304-
when: oci_yum_region | length > 0
304+
when: oci_yum_region | default(omit) | length > 0
305305

306306
- name: Configure passwordless SSH
307307
ansible.builtin.include_tasks: "passwordless_setup.yml"

ol/default_vars.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ cleanup_tmp: no
4343

4444
update_all: false
4545
passwordless_ssh: false
46-
#oci_yum_region: uk-london-1
46+
#oci_yum_region: ".uk-london-1"
4747
use_podman: false
4848
use_haproxy: false
4949
use_nginx: false

0 commit comments

Comments
 (0)