-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ospdo adoption dataplane adoption (#692)
* Add Director Operator dataplane_adoption scripts for adoption Related CI patch and background: https://gitlab.cee.redhat.com/ci-framework/ci-framework-jobs/-/merge_requests/966 Jiras: https://issues.redhat.com/browse/OSPRH-1891 https://issues.redhat.com/browse/OSPRH-2984 * fix lint * fix lint * fix lint * fix lint * update vars * update org_ns var
- Loading branch information
1 parent
730b675
commit 7065044
Showing
4 changed files
with
169 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Take the private ssh key (id_ra) from the /home/cloud-admin/.ssh/ directory of the openstackclient pod and create a secret in the osp18 namespace | ||
- name: Create secret from openstackclient pod | ||
ansible.builtin.shell: | | ||
{{ shell_header }} | ||
{{ oc_header }} | ||
oc apply -f - <<EOF | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: dataplane-adoption-secret | ||
namespace: {{ rhoso_namespace }} | ||
data: | ||
ssh-privatekey: | | ||
$(oc exec -n {{ org_namespace }} -t openstackclient openstackclient -- cat /home/cloud-admin/.ssh/id_rsa | base64 | sed 's/^/ /') | ||
EOF | ||
# needed for : https://github.com/openstack-k8s-operators/openstack-operator/blob/37f12745cc6971241f6d24fa9b0a28d39a428be7/config/services/dataplane_v1beta1_openstackdataplaneservice_libvirt.yaml#L8 | ||
- name: Create secret for OpenStackDataPlaneService | ||
ansible.builtin.shell: | | ||
LIBVIRT_PASSWORD=$(grep <"${PASSWORD_FILE}" ' LibvirtTLSPassword:' | awk -F ': ' '{ print $2; }') | ||
oc apply -f - <<EOF | ||
apiVersion: v1 | ||
data: | ||
LibvirtPassword: $(echo -n "${LIBVIRT_PASSWORD}" | base64) | ||
kind: Secret | ||
metadata: | ||
name: libvirt-secret | ||
namespace: {{ rhoso_namespace }} | ||
type: Opaque | ||
EOF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
# Specific OSPdO Adoption vars | ||
# ospdo nodes deployment configuration template | ||
edpm_nodes: | ||
compute-0: | ||
# Use a FQDN here to avoid issues with value specified in netconfig.yaml | ||
hostName: compute-0.osptest.test.metalkube.org | ||
ansible: | ||
ansibleHost: 172.22.0.170 | ||
ansibleUser: cloud-admin | ||
networks: | ||
- name: ctlplane | ||
fixedIP: 172.22.0.170 | ||
subnetName: ctlplane | ||
- name: internalapi | ||
fixedIP: 172.17.0.170 | ||
subnetName: internalapi | ||
- name: storage | ||
fixedIP: 172.18.0.170 | ||
subnetName: storage | ||
- name: tenant | ||
fixedIP: 172.20.0.170 | ||
subnetName: tenant | ||
compute-1: | ||
# Use a FQDN here to avoid issues with value specified in netconfig.yaml | ||
hostName: compute-1.osptest.test.metalkube.org | ||
ansible: | ||
ansibleHost: 172.22.0.180 | ||
ansibleUser: cloud-admin | ||
networks: | ||
- name: ctlplane | ||
fixedIP: 172.22.0.180 | ||
subnetName: ctlplane | ||
- name: internalapi | ||
fixedIP: 172.17.0.180 | ||
subnetName: internalapi | ||
- name: storage | ||
fixedIP: 172.18.0.180 | ||
subnetName: storage | ||
- name: tenant | ||
fixedIP: 172.20.0.180 | ||
subnetName: tenant | ||
|
||
edpm_network_config_template: | | ||
--- | ||
{% set mtu_list = [ctlplane_mtu] %} | ||
{% for network in nodeset_networks %} | ||
{{ mtu_list.append(lookup('vars', networks_lower[network] ~ '_mtu')) }} | ||
{%- endfor %} | ||
{% set min_viable_mtu = mtu_list | max %} | ||
network_config: | ||
# BMH provisioning interface used for ctlplane | ||
- type: interface | ||
name: nic 1 | ||
mtu: 1500 | ||
use_dhcp: false | ||
dns_servers: {{ ctlplane_dns_nameservers }} | ||
domain: {{ dns_search_domains }} | ||
addresses: | ||
- ip_netmask: {{ ctlplane_ip }}/{{ ctlplane_cidr }} | ||
routes: {{ ctlplane_host_routes }} | ||
# Disable OCP cluster interface | ||
- type: interface | ||
name: nic2 | ||
mtu: 1500 | ||
use_dhcp: false | ||
{% for network in nodeset_networks %} | ||
{% if network in ["external"] %} | ||
- type: ovs_bridge | ||
name: {{ neutron_physical_bridge_name }} | ||
mtu: 1500 | ||
dns_servers: {{ ctlplane_dns_nameservers }} | ||
use_dhcp: false | ||
members: | ||
- type: interface | ||
name: nic3 | ||
mtu: {{ lookup('vars', networks_lower[network] ~ '_mtu') }} | ||
primary: true | ||
{% endif %} | ||
{% endfor %} | ||
- type: ovs_bridge | ||
name: br-tenant | ||
mtu: {{ min_viable_mtu }} | ||
use_dhcp: false | ||
members: | ||
- type: interface | ||
name: nic4 | ||
mtu: {{ min_viable_mtu }} | ||
use_dhcp: false | ||
primary: true | ||
{% for network in nodeset_networks %} | ||
{% if network not in ["external"] %} | ||
- type: vlan | ||
mtu: {{ lookup('vars', networks_lower[network] ~ '_mtu') }} | ||
vlan_id: {{ lookup('vars', networks_lower[network] ~ '_vlan_id') }} | ||
addresses: | ||
- ip_netmask: | ||
{{ lookup('vars', networks_lower[network] ~ '_ip') }}/{{ lookup('vars', networks_lower[network] ~ '_cidr') }} | ||
routes: {{ lookup('vars', networks_lower[network] ~ '_host_routes') }} | ||
{% endif %} | ||
{% endfor %} | ||
|
||
|
||
neutron_physical_bridge_name: br-ex | ||
neutron_public_interface_name: nic3 | ||
edpm_ovn_bridge_mappings: datacentre:br-ex | ||
|
||
edpm_sshd_allowed_ranges: | ||
- 192.168.122.0/24 | ||
- 172.22.0.0/24 |