Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions group_vars/all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ cifmw_installyamls_repos_relative: src/github.com/openstack-k8s-operators/instal
cifmw_installyamls_repos: "{{ ansible_user_dir }}/{{ cifmw_installyamls_repos_relative }}"
cifmw_architecture_repo_relative: src/github.com/openstack-k8s-operators/architecture
cifmw_architecture_repo: "{{ ansible_user_dir }}/{{ cifmw_architecture_repo_relative }}"

cifmw_openstack_namespace: "{{ cifmw_install_yamls_defaults['NAMESPACE'] | default('openstack') }}"
6 changes: 3 additions & 3 deletions hooks/playbooks/apply_cinder_replication_kustomization.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
KUBECONFIG: "{{ cifmw_openshift_kubeconfig }}"
PATH: "{{ cifmw_path }}"
ansible.builtin.command:
cmd: oc get openstackcontrolplane -n openstack -o yaml
cmd: "oc get openstackcontrolplane -n {{ cifmw_openstack_namespace }} -o yaml"
register: current_controlplane_config

- name: Parse existing Cinder backend configuration
Expand Down Expand Up @@ -58,7 +58,7 @@
kind: OpenStackControlPlane
metadata:
name: controlplane
namespace: openstack
namespace: "{{ cifmw_openstack_namespace }}"
spec:
cinder:
template:
Expand All @@ -70,4 +70,4 @@
KUBECONFIG: "{{ cifmw_openshift_kubeconfig }}"
PATH: "{{ cifmw_path }}"
ansible.builtin.command:
cmd: oc wait --for=condition=Ready openstackcontrolplane/controlplane -n openstack --timeout=1200s
cmd: "oc wait --for=condition=Ready openstackcontrolplane/controlplane -n {{ cifmw_openstack_namespace }} --timeout=1200s"
2 changes: 1 addition & 1 deletion hooks/playbooks/delete_all_pre_adoption_resources.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
- name: Fetch cloud config to host
kubernetes.core.k8s_cp:
kubeconfig: "{{ cifmw_resource_delete_kubeconfig }}"
namespace: openstack
namespace: "{{ cifmw_openstack_namespace }}"
pod: openstackclient
remote_path: /home/cloud-admin/.config/openstack/
local_path: "/home/zuul/.config/openstack/"
Expand Down
8 changes: 4 additions & 4 deletions hooks/playbooks/dz_storage_post_deploy_az.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
PATH: "{{ cifmw_path | default(ansible_env.PATH) }}"
ansible.builtin.command: >-
oc rsh
-n openstack
-n "{{ cifmw_openstack_namespace }}"
openstackclient
openstack project show service -c id -f value
register: service_project_result
Expand All @@ -26,7 +26,7 @@
PATH: "{{ cifmw_path | default(ansible_env.PATH) }}"
ansible.builtin.command: >-
oc rsh
-n openstack
-n "{{ cifmw_openstack_namespace }}"
openstackclient
openstack volume type create --private
--project "{{ service_project_id }}"
Expand All @@ -44,7 +44,7 @@
PATH: "{{ cifmw_path | default(ansible_env.PATH) }}"
ansible.builtin.command: >-
oc rsh
-n openstack
-n "{{ cifmw_openstack_namespace }}"
openstackclient
openstack aggregate create {{ item }} --zone {{ item }}
loop:
Expand All @@ -59,7 +59,7 @@
PATH: "{{ cifmw_path | default(ansible_env.PATH) }}"
ansible.builtin.command: >-
oc rsh
-n openstack
-n "{{ cifmw_openstack_namespace }}"
openstackclient
openstack aggregate add host {{ item.az }} {{ item.host }}
loop:
Expand Down
19 changes: 9 additions & 10 deletions hooks/playbooks/dz_storage_pre_test_images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,14 @@
cirros_version: "0.6.2"
cirros_image_name: "cirros-{{ cirros_version }}-x86_64-disk.img"
cirros_download_url: "https://github.com/cirros-dev/cirros/releases/download/{{ cirros_version }}/{{ cirros_image_name }}"
openstack_namespace: "{{ cifmw_openstack_namespace | default('openstack') }}"
tasks:
- name: Check if cirros image already exists
environment:
KUBECONFIG: "{{ cifmw_openshift_kubeconfig | default('/home/' + ansible_user | default('zuul') + '/.kube/config') }}"
PATH: "{{ cifmw_path | default(ansible_env.PATH) }}"
ansible.builtin.command: >-
oc rsh
-n {{ openstack_namespace }}
-n {{ cifmw_openstack_namespace }}
openstackclient
openstack image show {{ cirros_image_name }}
register: _image_exists
Expand All @@ -31,7 +30,7 @@
PATH: "{{ cifmw_path | default(ansible_env.PATH) }}"
ansible.builtin.command: >-
oc rsh
-n {{ openstack_namespace }}
-n {{ cifmw_openstack_namespace }}
openstackclient
openstack endpoint list --service keystone --interface public -f value -c URL
register: keystone_url
Expand All @@ -41,7 +40,7 @@
KUBECONFIG: "{{ cifmw_openshift_kubeconfig | default('/home/' + ansible_user | default('zuul') + '/.kube/config') }}"
PATH: "{{ cifmw_path | default(ansible_env.PATH) }}"
ansible.builtin.command: >-
oc get secret osp-secret -n {{ openstack_namespace }} -o jsonpath='{.data.AdminPassword}'
oc get secret osp-secret -n {{ cifmw_openstack_namespace }} -o jsonpath='{.data.AdminPassword}'
register: admin_password_b64

- name: Decode admin password
Expand All @@ -61,15 +60,15 @@
ansible.builtin.command: >-
oc cp
"/tmp/{{ cirros_image_name }}"
"{{ openstack_namespace }}/openstackclient:/home/cloud-admin/{{ cirros_image_name }}"
"{{ cifmw_openstack_namespace }}/openstackclient:/home/cloud-admin/{{ cirros_image_name }}"

- name: Create cirros image in default glance store (az0)
environment:
KUBECONFIG: "{{ cifmw_openshift_kubeconfig | default('/home/' + ansible_user | default('zuul') + '/.kube/config') }}"
PATH: "{{ cifmw_path | default(ansible_env.PATH) }}"
ansible.builtin.command: >-
oc rsh
-n {{ openstack_namespace }}
-n {{ cifmw_openstack_namespace }}
openstackclient
openstack image create
--disk-format qcow2
Expand All @@ -85,7 +84,7 @@
PATH: "{{ cifmw_path | default(ansible_env.PATH) }}"
ansible.builtin.command: >-
oc rsh
-n {{ openstack_namespace }}
-n {{ cifmw_openstack_namespace }}
openstackclient
openstack image show {{ cirros_image_name }} -f value -c status
register: image_status
Expand All @@ -99,7 +98,7 @@
PATH: "{{ cifmw_path | default(ansible_env.PATH) }}"
ansible.builtin.command: >-
oc rsh
-n {{ openstack_namespace }}
-n {{ cifmw_openstack_namespace }}
openstackclient
openstack image show {{ cirros_image_name }} -f value -c id
register: image_id
Expand All @@ -110,7 +109,7 @@
PATH: "{{ cifmw_path | default(ansible_env.PATH) }}"
ansible.builtin.command: >-
oc rsh
-n {{ openstack_namespace }}
-n {{ cifmw_openstack_namespace }}
openstackclient
glance --os-auth-url {{ keystone_url.stdout | trim }}
--os-project-name admin
Expand All @@ -128,7 +127,7 @@
PATH: "{{ cifmw_path | default(ansible_env.PATH) }}"
ansible.builtin.command: >-
oc rsh
-n {{ openstack_namespace }}
-n {{ cifmw_openstack_namespace }}
openstackclient
openstack image show {{ image_id.stdout | trim }} -c properties -f value
register: image_stores
Expand Down
3 changes: 1 addition & 2 deletions hooks/playbooks/install_custom_ca_certs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
connection: local
vars:
_custom_ca_cert_filepath: "{{ custom_ca_cert_filepath | default('/tmp/ca_cert.txt') }}"
_namespace: "{{ namespace | default('openstack') }}"
tasks:
- name: Download cert
ansible.builtin.get_url:
Expand Down Expand Up @@ -33,6 +32,6 @@
type: Opaque
metadata:
name: custom-ca-certs
namespace: "{{ _namespace }}"
namespace: "{{ cifmw_openstack_namespace }}"
data:
CustomCACerts: "{{ custom_ca_certs.content }}"
2 changes: 1 addition & 1 deletion hooks/playbooks/ipa-controlplane-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
kind: Secret
metadata:
name: keystone-domains
namespace: openstack
namespace: "{{ cifmw_openstack_namespace }}"
type: Opaque
stringData: "{{ {keystone_conf_key: keystone_ldap_config_content} }}"
vars:
Expand Down
5 changes: 2 additions & 3 deletions hooks/playbooks/ironic_enroll_nodes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
gather_facts: false
vars:
_baremetal_info_path: "{{ cifmw_basedir }}/parameters/baremetal-info.yml"
_namespace: openstack
_ironic_node_name_prefix: ironic-
_ironic_network_interface: flat
_ironic_network_physical_network: ironic
Expand Down Expand Up @@ -67,7 +66,7 @@
- name: Enroll ironic nodes
ansible.builtin.shell: |
set -xe -o pipefail
oc project {{ _namespace }}
oc cp {{ cifmw_basedir }}/parameters/ironic_nodes.yaml {{ _namespace }}/openstackclient:/tmp/
oc project {{ cifmw_openstack_namespace }}
oc cp {{ cifmw_basedir }}/parameters/ironic_nodes.yaml {{ cifmw_openstack_namespace }}/openstackclient:/tmp/
oc rsh openstackclient \
openstack baremetal create /tmp/ironic_nodes.yaml
3 changes: 1 addition & 2 deletions hooks/playbooks/ironic_flavor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
hosts: "{{ cifmw_target_hook_host | default('localhost') }}"
gather_facts: false
vars:
_namespace: openstack
_flavor_name: baremetal
_flavor_id: 123456789-1234-1234-1234-000000000001
_boot_mode: uefi
Expand All @@ -14,7 +13,7 @@
- name: Create baremetal flavor
ansible.builtin.shell: |
set -xe -o pipefail
oc project {{ _namespace }}
oc project {{ cifmw_openstack_namespace }}
oc rsh openstackclient \
openstack flavor create {{ _flavor_name }} \
--id {{ _flavor_id }} \
Expand Down
5 changes: 2 additions & 3 deletions hooks/playbooks/ironic_network.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
hosts: "{{ cifmw_target_hook_host | default('localhost') }}"
gather_facts: false
vars:
_namespace: openstack
_subnet_range: '172.20.1.0/24'
_subnet_gateway: '172.20.1.1'
_subnet_nameserver: '192.168.122.80'
Expand All @@ -23,7 +22,7 @@
- name: Create baremetal network
ansible.builtin.shell: |
set -xe -o pipefail
oc project {{ _namespace }}
oc project {{ cifmw_openstack_namespace }}
oc rsh openstackclient \
openstack network create provisioning \
--share \
Expand Down Expand Up @@ -52,7 +51,7 @@
- name: Create router for IPv6 provisioning network
ansible.builtin.shell: |
set -xe -o pipefail
oc project {{ _namespace }}
oc project {{ cifmw_openstack_namespace }}
oc rsh openstackclient \
openstack router create provisioning
oc rsh openstackclient \
Expand Down
4 changes: 1 addition & 3 deletions hooks/playbooks/ironic_network_agent_cleanup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,14 @@
- name: Delete neutron network agents for Baremetal Nodes
hosts: "{{ cifmw_target_hook_host | default('localhost') }}"
gather_facts: false
vars:
_namespace: openstack
environment:
KUBECONFIG: "{{ cifmw_openshift_kubeconfig }}"
PATH: "{{ cifmw_path }}"
tasks:
- name: Delete baremetal network agents
ansible.builtin.shell: |
set -xe -o pipefail
oc project {{ _namespace }}
oc project {{ cifmw_openstack_namespace }}

echo "Discovering baremetal network agents..."

Expand Down
2 changes: 1 addition & 1 deletion hooks/playbooks/run_tofu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
- name: Fetch cloud congig to host
kubernetes.core.k8s_cp:
kubeconfig: "{{ cifmw_tofu_kubeconfig }}"
namespace: openstack
namespace: "{{ cifmw_openstack_namespace }}"
pod: openstackclient
remote_path: /home/cloud-admin/.config/openstack/
local_path: "{{ ansible_user_dir }}/.config/openstack/"
Expand Down
6 changes: 3 additions & 3 deletions hooks/playbooks/validate_podified_deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
KUBECONFIG: "{{ cifmw_openshift_kubeconfig }}"
PATH: "{{ cifmw_path }}"
ansible.builtin.shell: |
oc get pods -n {{ openstack_namespace }} --selector service=nova-api -o jsonpath={.items[*].status.phase}
oc get pods -n {{ cifmw_openstack_namespace }} --selector service=nova-api -o jsonpath={.items[*].status.phase}
register: nova_service
until: nova_service.stdout == "Running"
changed_when: false
Expand All @@ -22,5 +22,5 @@
KUBECONFIG: "{{ cifmw_openshift_kubeconfig }}"
PATH: "{{ cifmw_path }}"
ansible.builtin.shell: |
oc rsh -n {{ openstack_namespace }} openstackclient openstack compute service list;
oc rsh -n {{ openstack_namespace }} openstackclient openstack network agent list;
oc rsh -n {{ cifmw_openstack_namespace }} openstackclient openstack compute service list;
oc rsh -n {{ cifmw_openstack_namespace }} openstackclient openstack network agent list;
2 changes: 1 addition & 1 deletion playbooks/06-deploy-architecture.yml
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@
PATH: "{{ cifmw_path }}"
ansible.builtin.command: >-
oc rsh
-n openstack
-n "{{ cifmw_openstack_namespace }}"
nova-cell0-conductor-0
nova-manage cell_v2 discover_hosts --verbose

Expand Down
2 changes: 1 addition & 1 deletion roles/ci_dcn_site/tasks/add_node.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
- name: Run Nova cell discovery for new DCN hosts
kubernetes.core.k8s_exec:
api_key: "{{ _auth_results.openshift_auth.api_key }}"
namespace: openstack
namespace: "{{ cifmw_openstack_namespace }}"
pod: nova-cell0-conductor-0
command: nova-manage cell_v2 discover_hosts --verbose

Expand Down
6 changes: 3 additions & 3 deletions roles/ci_dcn_site/tasks/az.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
ignore_errors: true
kubernetes.core.k8s_exec:
api_key: "{{ _auth_results.openshift_auth.api_key }}"
namespace: openstack
namespace: "{{ cifmw_openstack_namespace }}"
pod: openstackclient
command: >-
openstack aggregate show {{ _az }} -c hosts -f value
Expand All @@ -36,7 +36,7 @@
- az_hosts.rc == 1
kubernetes.core.k8s_exec:
api_key: "{{ _auth_results.openshift_auth.api_key }}"
namespace: openstack
namespace: "{{ cifmw_openstack_namespace }}"
pod: openstackclient
command: >-
openstack aggregate create {{ _az }} --zone {{ _az }}
Expand All @@ -49,7 +49,7 @@
- item.key not in az_hosts_list
kubernetes.core.k8s_exec:
api_key: "{{ _auth_results.openshift_auth.api_key }}"
namespace: openstack
namespace: "{{ cifmw_openstack_namespace }}"
pod: openstackclient
command: >-
openstack aggregate add host {{ _az }} {{ item.key }}.ctlplane.example.com
2 changes: 1 addition & 1 deletion roles/ci_dcn_site/tasks/deploy_site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
- name: Run Nova cell discovery for new DCN hosts
kubernetes.core.k8s_exec:
api_key: "{{ _auth_results.openshift_auth.api_key }}"
namespace: openstack
namespace: "{{ cifmw_openstack_namespace }}"
pod: nova-cell0-conductor-0
command: nova-manage cell_v2 discover_hosts --verbose

Expand Down
Loading
Loading