Skip to content

Commit 2e54587

Browse files
psathyanopenshift-merge-bot[bot]
authored andcommitted
[devscripts] refactoring role to align with layout.
Signed-off-by: Pragadeeswaran Sathyanarayanan <[email protected]>
1 parent 47482bf commit 2e54587

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+875
-1180
lines changed

docs/dictionary/en-custom.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@ ipam
192192
ipi
193193
ips
194194
ipv
195+
iscsi
195196
itldwuw
196197
iybbbnnpymxlig
197198
iywxdcgpmc

roles/devscripts/README.md

Lines changed: 41 additions & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -6,38 +6,46 @@ libvirt/kvm virtual machines.
66

77
## Privilege escalation
88

9-
Yes, requires privilege escalation to install dependant packages on the system. Along with performing
10-
network configuration, repository setup and libvirt networks.
9+
Yes, requires privilege escalation to install dependant packages on the system.
10+
Along with performing network configuration, repository setup and libvirt
11+
networks.
1112

1213
## Exposed tags
1314

14-
* `devscripts_prepare`: Selects tasks related to "preparing the host" and building the various
15-
needed files.
16-
* `devscripts_deploy`: Overlaps with the previous tag, and adds the actual deployment of devscripts
17-
managed services.
15+
* `devscripts_prepare`: Selects tasks related to "preparing the host" and
16+
building the various needed files.
17+
* `devscripts_deploy`: Overlaps with the previous tag, and adds the actual
18+
deployment of devscripts managed services.
1819
* `devscripts_post`: Only runs the post-installation tasks.
1920

2021
## Parameters
2122

22-
* `cifmw_devscripts_artifacts_dir` (str) path to the directory to store the role artifacts.
23-
* `cifmw_devscripts_config_overrides` (dict) key/value pairs to be used for overriding the default
24-
configuration. Refer [section](#supported-keys-in-cifmw_devscripts_config_overrides) for more information.
23+
* `cifmw_devscripts_artifacts_dir` (str) path to the directory to store the
24+
role artifacts.
25+
* `cifmw_devscripts_config_overrides` (dict) key/value pairs to be used for
26+
overriding the default configuration. Refer
27+
[section](#supported-keys-in-cifmw_devscripts_config_overrides) for more
28+
information.
2529
* `cifmw_devscripts_dry_run` (bool) If enabled, the workflow is evaluated.
26-
* `cifmw_devscripts_make_target` (str) Optional, the target to be used with dev-scripts.
27-
* `cifmw_devscripts_ocp_version` (str) The version of OpenShift to be deployed.
28-
* `cifmw_devscripts_osp_compute_nodes` (list) A list of nodes which has key/value pairs
29-
containing details about OpenStack compute nodes. Refer
30-
[section](#supported-keys-in-cifmw_devscripts_osp_compute_nodes) for more information.
3130
* `cifmw_devscripts_src_dir` (str) The parent folder of dev-scripts repository.
32-
* `cifmw_devscripts_use_layers` (bool) Toggle overlay support. Specifically, this boolean will instruct the role to
33-
shutdown the whole OCP cluster, dump the XML, undefine the nodes, and prevents running the "post" tasks. Defaults to `false`.
34-
* `cifmw_devscripts_remove_default_net` (bool) Remove the default virtual network. Defaults to `false`.
35-
* `cifmw_devscripts_host_routing` (bool) Enable routing via host for OCP nodes in case of OVNKubernetes. Defaults to `false`.
31+
* `cifmw_devscripts_remove_libvirt_net_default` (bool) Remove the default
32+
virtual network. Defaults to `false`.
33+
* `cifmw_devscripts_enable_ocp_nodes_host_routing` (bool) Enable routing via
34+
host for OCP nodes in case of OVNKubernetes. Defaults to `false`.
35+
* `cifmw_devscripts_enable_iscsi_on_ocp_nodes` (bool) Enable iSCSI services on
36+
the OpenShift nodes having role as `worker`. Defaults to `false`.
37+
* `cifmw_devscripts_host_bm_net_ip_addr` (str) The IP address of the host to be
38+
assigned.
39+
* `cifmw_devscripts_use_static_ip_addr` (bool) Use static IP addresses for the
40+
OCP nodes. Defaults to `false`
41+
* `cifmw_devscripts_layout_overrides` (dict) key/value pairs to be used for
42+
overriding the default devscripts test layout. Refer
43+
[cifmw_libvirt_manager_configuration](https://github.com/openstack-k8s-operators/ci-framework/tree/main/roles/libvirt_manager#structure-for-cifmw_libvirt_manager_configuration)
3644

3745
### Secrets management
3846

39-
This role calls the [manage_secrets](./manage_secrets.md) role. It allows to copy or create
40-
the needed secrets.
47+
This role calls the [manage_secrets](./manage_secrets.md) role. It allows to
48+
copy or create the needed secrets.
4149

4250
#### pull-secret
4351

@@ -76,7 +84,6 @@ If you provide neither, or both, it will fail.
7684
| --- | ------------- | ----------- |
7785
| ip_stack | `v4` | IP stack for the cluster. Supported values are `v4\|v6\|v6v4`. |
7886
| network_type | `OVNKubernetes` | Sets the network type for the OpenShift cluster. Supported values are `OpenShiftSDN\|OVNKubernetes`. |
79-
| ovn_local_gateway_mode | `false` | Enables local gateway mode, only applicable for `OVNKubernetes`. Supported values are `true\|false`. |
8087
| provisioning_network_profile | `Managed` | Allow the script to manage the provisioning network. Supported values are `Disabled\|Managed`. |
8188
| manage_pro_bridge | `y` | Allow dev-scripts to manage the provisioning bridge. Supported values are `y\|n`. |
8289
| provisioning_network | | The subnet CIDR to be used for the provisioning network. |
@@ -85,7 +92,7 @@ If you provide neither, or both, it will fail.
8592
| int_if | | The network interface to be attached to the internal cluster bridge. |
8693
| manage_br_bridge | `y` | Allow dev-scripts to manage the external bridge. Supported values are `y\|n`. |
8794
| ext_if | | The network interface to be attached to the external bridge. |
88-
| external_subnet_v4 | | The external subnet CIDR part of IPv4 family. Includes checks before default is set. |
95+
| external_subnet_v4 | `192.168.111.0/24` | The external subnet CIDR part of IPv4 family. |
8996
| external_subnet_v6 | | The external subnet CIDR belonging to IPv6 family required when IP stack is other than `v4`. |
9097
| cluster_subnet_v4 | `192.168.16.0/20` | The cluster network cidr for the OpenShift cluster. |
9198
| cluster_subnet_v6 | | The cluster network cidr belonging to IPv6 family. Required when IP stack is other than `v4`. |
@@ -111,37 +118,6 @@ If you provide neither, or both, it will fail.
111118
| extra_worker_disk | | The disk size to be set for each extra nodes. |
112119
| extra_worker_vcpu | | The number of vCPUs to be configured for each extra nodes. |
113120

114-
### Supported keys in cifmw_devscripts_osp_compute_nodes
115-
116-
| Key | Description |
117-
| --- | ----------- |
118-
| name | Name of the physical server. |
119-
| bmc | Management board details Refer [section](#supported-keys-in-bmc) |
120-
| boot_mac_addr | MAC address of physical system connected to provisioning network. |
121-
| boot_mode | The mode to be used for booting. Choices are `legacy \| UEFI \| UEFISecureBoot`. |
122-
| extra_spec | Key/value pairs as supported by [baremetal-operator](https://github.com/metal3-io/baremetal-operator/blob/main/docs/api.md) |
123-
124-
#### Supported keys in bmc
125-
126-
The keys supported in `cifmw_devscripts_osp_compute_nodes.bmc` are
127-
128-
| Key | Description |
129-
| --- | ----------- |
130-
| address | URL to the servers BMC. Refer notes for additional information. |
131-
| username | Name of the BMC user encoded with base64. |
132-
| password | Password for the above user encoded with base64. |
133-
134-
##### Notes
135-
136-
The BMC address format is `<protocol>://<fqdn_or_ip_address>[:port]/[redfish-system-id]`. Some of the examples are
137-
138-
* `redfish-virtualmedia://compute-bmc.foo.bar/redfish/v1/Systems/<uuid>`
139-
* `idrac://compute-bmc.subdomain.domain`
140-
* `idrac-virtualmedia://compute-bmc.foo.bar/redfish/v1/Systems/<uuid>`
141-
* `redfish://compute-bmc.foo.bar/redfish/v1/Systems/<uuid>`
142-
143-
Additional information can be found [here](https://github.com/metal3-io/baremetal-operator/blob/main/docs/api.md#bmc)
144-
145121
## Examples
146122

147123
* Sample config for deploying a compact OpenShift platform with extra nodes, existing external network,
@@ -152,14 +128,17 @@ Additional information can be found [here](https://github.com/metal3-io/baremeta
152128
...
153129
cifmw_use_devscripts: True
154130

155-
cifmw_devscripts_ci_token: REDACTED
156-
cifmw_devscripts_pull_secret: |
157-
REDACTED
131+
cifmw_manage_secrets_citoken_file: "{{ lookup('env', 'HOME')/ci_token }}"
132+
cifmw_manage_secrets_pullsecret_file: "{{ lookup('env', 'HOME')/pull_secret }}"
158133

159-
cifmw_devscripts_src_dir: "/home/ciuser/src/dev-scripts"
134+
cifmw_devscripts_config_overrides:
135+
provisioning_network_profile: "Disabled"
136+
num_extra_workers: 2
137+
extra_worker_memory_mb: 16384
138+
extra_worker_disk: 50
139+
worker_vcpu: 8
160140

161-
cifmw_devscripts_ocp_version: '4.13.13'
162-
cifmw_devscripts_crb_repo: 'https://mirror.stream.centos.org/9-stream/CRB/x86_64/os/'
141+
cifmw_devscripts_extra_networks: ['osp_trunk']
163142
...
164143
```
165144

@@ -169,57 +148,18 @@ Additional information can be found [here](https://github.com/metal3-io/baremeta
169148
```YAML
170149
cifmw_use_devscripts: True
171150

172-
cifmw_devscripts_ci_token: REDACTED
173-
cifmw_devscripts_pull_secret: |
151+
cifmw_manage_secrets_citoken_content: REDACTED
152+
cifmw_manage_secrets_pullsecret_content: |
174153
REDACTED
175154
176-
cifmw_devscripts_ocp_version: '4.13.13'
177-
178155
cifmw_devscripts_config_overrides:
179-
provisioning_network_profile: "Managed"
180-
provisioning_network: "172.22.0.0/16"
156+
openshift_version: "4.16.0"
181157
num_workers: 3
182158
worker_memory: 16384
183159
worker_disk: 100
184160
worker_vcpu: 10
185161
```
186162
187-
* Sample vars for a hybrid test environment (virtual OpenShift with physical servers for OpenStack compute).
188-
189-
```YAML
190-
cifmw_use_devscripts: True
191-
192-
cifmw_devscripts_ci_token: REDACTED
193-
cifmw_devscripts_pull_secret: |
194-
REDACTED
195-
196-
cifmw_devscripts_ocp_version: '4.13.13'
197-
198-
cifmw_devscripts_config_overrides:
199-
provisioning_network_profile: "Managed"
200-
provisioning_network: "172.22.0.0/16"
201-
num_workers: 3
202-
worker_memory: 16384
203-
worker_disk: 100
204-
worker_vcpu: 10
205-
206-
cifmw_devscripts_osp_compute_nodes:
207-
- name: osp-compute-0
208-
bmc:
209-
address: "idrac://osp-compute-0.bmc.foo.bar"
210-
username: "Zm9v"
211-
password: "YmFy"
212-
boot_mac_addr: "00:00:00:00:00:00"
213-
boot_mode: UEFI
214-
- name: osp-compute-1
215-
bmc:
216-
address: "redfish://osp-compute-1.bmc.foo.bar/redfish/v1/Systems/1"
217-
username: "Zm9v"
218-
password: "YmFy"
219-
boot_mac_addr: "00:00:00:00:00:01"
220-
boot_mode: "legacy"
221-
```
222-
223163
## References
224164
225165
* [dev-scripts](https://github.com/openshift-metal3/dev-scripts)

roles/devscripts/defaults/main.yml

Lines changed: 41 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,49 @@
1818
# All variables intended for modification should be placed in this file.
1919
# All variables within this role should have a prefix of "cifmw_devscripts"
2020

21-
cifmw_devscripts_dry_run: false
22-
cifmw_devscripts_debug: false
21+
cifmw_devscripts_data_dir: >-
22+
{{
23+
cifmw_basedir |
24+
default(ansible_user_dir ~ '/ci-framework-data')
25+
}}
26+
cifmw_devscripts_artifacts_dir: >-
27+
{{
28+
(
29+
cifmw_devscripts_data_dir,
30+
'artifacts'
31+
) | ansible.builtin.path_join
32+
}}
33+
cifmw_devscripts_logs_dir: >-
34+
{{
35+
(
36+
cifmw_devscripts_data_dir,
37+
'devscripts',
38+
'logs'
39+
) | ansible.builtin.path_join
40+
}}
41+
cifmw_devscripts_output_dir: >-
42+
{{
43+
(
44+
cifmw_devscripts_data_dir,
45+
'devscripts',
46+
'output'
47+
) | ansible.builtin.path_join
48+
}}
49+
cifmw_devscripts_repo_dir: >-
50+
{{
51+
(
52+
ansible_user_dir,
53+
'src/github.com/openshift-metal3/dev-scripts'
54+
) | ansible.builtin.path_join
55+
}}
2356
24-
cifmw_devscripts_data_dir: "{{ cifmw_basedir | default(ansible_user_dir ~ '/ci-framework-data') }}"
25-
cifmw_devscripts_artifacts_dir: "{{ (cifmw_devscripts_data_dir, 'artifacts') | path_join }}"
26-
cifmw_devscripts_logs_dir: "{{ (cifmw_devscripts_data_dir, 'devscripts', 'logs') | path_join }}"
27-
cifmw_devscripts_output_dir: "{{ (cifmw_devscripts_data_dir, 'devscripts', 'output') | path_join }}"
28-
cifmw_devscripts_repo_dir: "{{ (ansible_user_dir, 'src/github.com/openshift-metal3/dev-scripts') | path_join }}"
57+
cifmw_devscripts_debug: false
58+
cifmw_devscripts_dry_run: false
59+
cifmw_devscripts_enable_ocp_nodes_host_routing: false
60+
cifmw_devscripts_enable_iscsi_on_ocp_nodes: false
61+
cifmw_devscripts_remove_libvirt_net_default: false
62+
cifmw_devscripts_use_static_ip_addr: false
2963

3064
cifmw_devscripts_user: "{{ ansible_user_id }}"
31-
cifmw_devscripts_restart_virtproxyd: true
32-
cifmw_devscripts_use_layers: false
33-
cifmw_devscripts_remove_default_net: false
34-
cifmw_devscripts_host_routing: false
35-
36-
cifmw_devscripts_osp_compute_nodes: []
3765

3866
cifmw_devscripts_config_overrides: {}

roles/devscripts/files/add_bridge_port.sh

Lines changed: 0 additions & 47 deletions
This file was deleted.

roles/devscripts/files/iscsi.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
apiVersion: machineconfiguration.openshift.io/v1
3+
kind: MachineConfig
4+
metadata:
5+
name: 90-enable-iscsi
6+
labels:
7+
machineconfiguration.openshift.io/role: worker
8+
service: cinder
9+
spec:
10+
config:
11+
ignition:
12+
version: 3.2.0
13+
systemd:
14+
units:
15+
- enabled: true
16+
name: iscsid.service
Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,11 @@
11
--- a/02_configure_host.sh
22
+++ b/02_configure_host.sh
3-
@@ -21,11 +21,13 @@ early_deploy_validation
3+
@@ -21,7 +21,7 @@ early_deploy_validation
44
manage_libvirtd() {
55
case ${DISTRO} in
66
centos9|rhel9)
77
- for i in qemu network nodedev nwfilter secret storage interface; do
8-
+ for i in qemu interface network nodedev nwfilter secret storage; do
8+
+ for i in qemu interface network nodedev nwfilter secret storage proxy; do
99
sudo systemctl enable --now virt${i}d.socket
1010
sudo systemctl enable --now virt${i}d-ro.socket
1111
sudo systemctl enable --now virt${i}d-admin.socket
12-
done
13-
+ sudo systemctl enable virtproxyd.service
14-
+ sudo systemctl enable --now virtproxyd{,-ro,-admin}.socket
15-
;;
16-
*)
17-
sudo systemctl restart libvirtd.service

0 commit comments

Comments
 (0)