Skip to content

Commit 2994985

Browse files
committed
feat/os_mirror: add OS image mirror role
1 parent a202fdf commit 2994985

File tree

14 files changed

+189
-27
lines changed

14 files changed

+189
-27
lines changed

playbooks/create_all.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@
1717
vars:
1818
mode: create
1919

20+
- name: OKD Installer | Create all | os_mirror
21+
ansible.builtin.import_playbook: os_mirror.yaml
22+
when: os_mirror | d(false)
23+
2024
- name: OKD Installer | Create all | create stack | network
2125
ansible.builtin.import_playbook: stack_network.yaml
2226

playbooks/os_mirror.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
- name: okd-installer | Create Stack | Compute | Load Config
3+
ansible.builtin.import_playbook: config.yaml
4+
vars:
5+
mode: load
6+
7+
- name: okd-installer | OS Mirror
8+
hosts: localhost
9+
connection: local
10+
11+
roles:
12+
- os_mirror
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
# placeholder
3+
okd_cluster_destroy_instances_compartment_id: "{{ oci_compartment_id }}"
4+
okd_cluster_destroy_instances:
5+
- name: "{{ cluster_state.infra_id }}-bootstrap"
6+
- name: "{{ cluster_state.infra_id }}-master-01"
7+
- name: "{{ cluster_state.infra_id }}-master-02"
8+
- name: "{{ cluster_state.infra_id }}-master-03"
9+
- name: "{{ cluster_state.infra_id }}-worker-01"
10+
- name: "{{ cluster_state.infra_id }}-worker-02"
11+
- name: "{{ cluster_state.infra_id }}-worker-03"
12+
- name: "{{ cluster_state.infra_id }}-opct-01"
13+
wait: yes
14+
wait_timeout: 120
15+
16+
okd_cluster_destroy_dns_compartment_id: "{{ oci_compartment_id_dns | d(oci_compartment_id) }}"
17+
okd_cluster_destroy_dns_records:
18+
zone_name_or_id: "{{ cluster_state.dns.base_domain }}"
19+
patch_items_spec:
20+
- operation: REMOVE
21+
domain: "api.{{ cluster_state.dns.cluster_domain }}"
22+
- operation: REMOVE
23+
domain: "api-int.{{ cluster_state.dns.cluster_domain }}"
24+
- operation: REMOVE
25+
domain: "*.apps.{{ cluster_state.dns.cluster_domain }}"
26+
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
# placeholder
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
# placeholder

playbooks/vars/oci/profiles/ha/node-bootstrap.yaml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,12 @@ compute_resources:
5757
- provider: oci
5858
type: machine
5959
# name: "{{ cluster_state.infra_id }}-bootstrap{{ _machine_suffix }}"
60-
61-
# cloud_compute role to discovery for OCI:
62-
image_name: "{{ custom_image_id }}"
60+
61+
# RHCOS Custom Image
62+
image_name: "{{ cluster_state.compute.image_id }}"
63+
image_compartment_id: "{{ oci_compartment_id_image | d(oci_compartment_id) }}"
64+
65+
# Network details
6366
vnic_subnet_name: "{{ cluster_state.infra_id }}-net-public"
6467
network_security_group_names:
6568
- "{{ cluster_state.infra_id }}-nsg-controlplane"

playbooks/vars/oci/profiles/ha/node-compute.yaml

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,12 @@ compute_resources:
2222
#
2323
- provider: oci
2424
type: machine
25-
26-
# cloud_compute role to discovery for OCI:
27-
image_name: "{{ custom_image_id }}"
25+
26+
# RHCOS Custom Image
27+
image_name: "{{ cluster_state.compute.image_id }}"
28+
image_compartment_id: "{{ oci_compartment_id_image | d(oci_compartment_id) }}"
29+
30+
# Network details
2831
vnic_subnet_name: "{{ cluster_state.infra_id }}-net-private"
2932
network_security_group_names:
3033
- "{{ cluster_state.infra_id }}-nsg-compute"
@@ -53,6 +56,8 @@ compute_resources:
5356

5457
source_details:
5558
source_type: image
59+
boot_volume_size_in_gbs: 120
60+
boot_volume_vpus_per_gb: 20
5661

5762
create_vnic_details:
5863
display_name: "{{ cluster_state.infra_id }}-worker-01-vnic0"
@@ -77,9 +82,12 @@ compute_resources:
7782
#
7883
- provider: oci
7984
type: machine
80-
81-
# cloud_compute role to discovery for OCI:
82-
image_name: "{{ custom_image_id }}"
85+
86+
# RHCOS Custom Image
87+
image_name: "{{ cluster_state.compute.image_id }}"
88+
image_compartment_id: "{{ oci_compartment_id_image | d(oci_compartment_id) }}"
89+
90+
# Network details
8391
vnic_subnet_name: "{{ cluster_state.infra_id }}-net-private"
8492
network_security_group_names:
8593
- "{{ cluster_state.infra_id }}-nsg-compute"
@@ -108,6 +116,8 @@ compute_resources:
108116

109117
source_details:
110118
source_type: image
119+
boot_volume_size_in_gbs: 120
120+
boot_volume_vpus_per_gb: 20
111121

112122
create_vnic_details:
113123
display_name: "{{ cluster_state.infra_id }}-worker-02-vnic0"
@@ -132,9 +142,12 @@ compute_resources:
132142
#
133143
- provider: oci
134144
type: machine
135-
136-
# cloud_compute role to discovery for OCI:
137-
image_name: "{{ custom_image_id }}"
145+
146+
# RHCOS Custom Image
147+
image_name: "{{ cluster_state.compute.image_id }}"
148+
image_compartment_id: "{{ oci_compartment_id_image | d(oci_compartment_id) }}"
149+
150+
# Network details
138151
vnic_subnet_name: "{{ cluster_state.infra_id }}-net-private"
139152
network_security_group_names:
140153
- "{{ cluster_state.infra_id }}-nsg-compute"
@@ -163,6 +176,8 @@ compute_resources:
163176

164177
source_details:
165178
source_type: image
179+
boot_volume_size_in_gbs: 120
180+
boot_volume_vpus_per_gb: 20
166181

167182
create_vnic_details:
168183
display_name: "{{ cluster_state.infra_id }}-worker-03-vnic0"

playbooks/vars/oci/profiles/ha/node-controlplane.yaml

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,17 @@ compute_resources:
2121
#
2222
- provider: oci
2323
type: machine
24-
25-
# cloud_compute role to discovery for OCI:
26-
image_name: "{{ custom_image_id }}"
24+
25+
# RHCOS Custom Image
26+
image_name: "{{ cluster_state.compute.image_id }}"
27+
image_compartment_id: "{{ oci_compartment_id_image | d(oci_compartment_id) }}"
28+
29+
# Network details
2730
vnic_subnet_name: "{{ cluster_state.infra_id }}-net-private"
2831
network_security_group_names:
2932
- "{{ cluster_state.infra_id }}-nsg-controlplane"
3033

3134
# OCI spec
32-
3335
spec:
3436
state: present
3537
compartment_id: "{{ oci_compartment_id }}"
@@ -53,6 +55,8 @@ compute_resources:
5355

5456
source_details:
5557
source_type: image
58+
boot_volume_size_in_gbs: 120
59+
boot_volume_vpus_per_gb: 20
5660

5761
create_vnic_details:
5862
display_name: "{{ cluster_state.infra_id }}-master-01-vnic0"
@@ -77,9 +81,12 @@ compute_resources:
7781
#
7882
- provider: oci
7983
type: machine
80-
81-
# cloud_compute role to discovery for OCI:
82-
image_name: "{{ custom_image_id }}"
84+
85+
# RHCOS Custom Image
86+
image_name: "{{ cluster_state.compute.image_id }}"
87+
image_compartment_id: "{{ oci_compartment_id_image | d(oci_compartment_id) }}"
88+
89+
# Network details
8390
vnic_subnet_name: "{{ cluster_state.infra_id }}-net-private"
8491
network_security_group_names:
8592
- "{{ cluster_state.infra_id }}-nsg-controlplane"
@@ -108,6 +115,8 @@ compute_resources:
108115

109116
source_details:
110117
source_type: image
118+
boot_volume_size_in_gbs: 120
119+
boot_volume_vpus_per_gb: 20
111120

112121
create_vnic_details:
113122
display_name: "{{ cluster_state.infra_id }}-master-02-vnic0"
@@ -132,9 +141,12 @@ compute_resources:
132141
#
133142
- provider: oci
134143
type: machine
135-
136-
# cloud_compute role to discovery for OCI:
137-
image_name: "{{ custom_image_id }}"
144+
145+
# RHCOS Custom Image
146+
image_name: "{{ cluster_state.compute.image_id }}"
147+
image_compartment_id: "{{ oci_compartment_id_image | d(oci_compartment_id) }}"
148+
149+
# Network details
138150
vnic_subnet_name: "{{ cluster_state.infra_id }}-net-private"
139151
network_security_group_names:
140152
- "{{ cluster_state.infra_id }}-nsg-controlplane"
@@ -163,6 +175,8 @@ compute_resources:
163175

164176
source_details:
165177
source_type: image
178+
boot_volume_size_in_gbs: 120
179+
boot_volume_vpus_per_gb: 20
166180

167181
create_vnic_details:
168182
display_name: "{{ cluster_state.infra_id }}-master-03-vnic0"

playbooks/vars/oci/profiles/ha/node-opct.yaml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,12 @@ compute_resources:
1919

2020
- provider: oci
2121
type: machine
22-
23-
# cloud_compute role to discovery for OCI:
24-
image_name: "{{ custom_image_id }}"
22+
23+
# RHCOS Custom Image
24+
image_name: "{{ cluster_state.compute.image_id }}"
25+
image_compartment_id: "{{ oci_compartment_id_image | d(oci_compartment_id) }}"
26+
27+
# Network details
2528
vnic_subnet_name: "{{ cluster_state.infra_id }}-net-private"
2629
network_security_group_names:
2730
- "{{ cluster_state.infra_id }}-nsg-compute"
@@ -48,6 +51,8 @@ compute_resources:
4851

4952
source_details:
5053
source_type: image
54+
boot_volume_size_in_gbs: 120
55+
boot_volume_vpus_per_gb: 20
5156

5257
create_vnic_details:
5358
display_name: "{{ cluster_state.infra_id }}-opct-01-vnic0"

roles/config/tasks/create.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,7 @@
4545
{{ bin_openshift_install }} create ignition-configs --dir {{ config_install_dir }}
4646
environment: "{{ config_installer_environment | d(omit) }}"
4747

48-
49-
# Render Stream JSON
48+
# Saving JSON image stream from installer
5049
- name: Create | Check exists coreos-stream.json
5150
ansible.builtin.stat:
5251
path: "{{ config_install_dir }}/coreos-stream.json"

0 commit comments

Comments
 (0)