diff --git a/ansible-collection-requirements.yml b/ansible-collection-requirements.yml index 2e27b9ff8a..f10d6f6e37 100644 --- a/ansible-collection-requirements.yml +++ b/ansible-collection-requirements.yml @@ -48,3 +48,7 @@ collections: source: https://github.com/ansible-collections/openvswitch.openvswitch type: git version: 2.1.1 +- name: osa_ops.mcapi_vexxhost + source: https://opendev.org/openstack/openstack-ansible-ops#/mcapi_vexxhost + type: git + version: master diff --git a/etc/openstack_deploy/conf.d/k8s.yml.aio b/etc/openstack_deploy/conf.d/k8s.yml.aio new file mode 100644 index 0000000000..3829c7068e --- /dev/null +++ b/etc/openstack_deploy/conf.d/k8s.yml.aio @@ -0,0 +1,9 @@ +--- +cluster-api_hosts: + aio1: + ip: {{ bootstrap_host_public_address }} + management_ip: {{ bootstrap_host_management_address }} +{% if 'k8sHA' in bootstrap_host_scenarios_expanded %} + affinity: + k8s_container: 3 +{% endif %} diff --git a/inventory/env.d/k8s.yml b/inventory/env.d/k8s.yml new file mode 100644 index 0000000000..c16856a234 --- /dev/null +++ b/inventory/env.d/k8s.yml @@ -0,0 +1,34 @@ +--- +# Copyright 2025, BBC R&D +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +component_skel: + k8s_capi: + belongs_to: + - k8s_all + +container_skel: + k8s_container: + belongs_to: + - cluster-api_containers + contains: + - k8s_capi + +physical_skel: + cluster-api_containers: + belongs_to: + - all_containers + cluster-api_hosts: + belongs_to: + - hosts diff --git a/tests/roles/bootstrap-host/vars/main.yml b/tests/roles/bootstrap-host/vars/main.yml index e0bce7f52b..259ae31b01 100644 --- a/tests/roles/bootstrap-host/vars/main.yml +++ b/tests/roles/bootstrap-host/vars/main.yml @@ -41,6 +41,9 @@ bootstrap_host_scenarios_expanded: |- {% set _ = scenario_list.extend(['cinder', 'glance', 'neutron', 'nova', 'placement', 'horizon']) %} {% endif %} {# Service additions based on scenario presence #} + {% if ('capi' in bootstrap_host_scenarios) %} + {% set _ = scenario_list.extend(['k8s']) %} + {% endif %} {% if 'cloudkitty' in bootstrap_host_scenarios %} {% set _ = scenario_list.extend(['ceilometer', 'gnocchi']) %} {% endif %} diff --git a/tests/test_inventory.py b/tests/test_inventory.py index 76cb47d5fb..4be9a18609 100644 --- a/tests/test_inventory.py +++ b/tests/test_inventory.py @@ -193,6 +193,9 @@ class TestAnsibleInventoryFormatConstraints(unittest.TestCase): 'cloudkitty_engine', 'rating_hosts', 'rating_all', + 'cluster-api_all', + 'cluster-api_containers', + 'cluster-api_hosts', 'coordination_containers', 'coordination_hosts', 'compute-infra_all', @@ -269,6 +272,9 @@ class TestAnsibleInventoryFormatConstraints(unittest.TestCase): 'ironic-inspector_hosts', 'ironic_inspector_container', 'ironic_neutron_agent', + 'k8s_all', + 'k8s_capi', + 'k8s_container', 'key-manager_containers', 'key-manager_hosts', 'key-manager_all', diff --git a/zuul.d/jobs.yaml b/zuul.d/jobs.yaml index 8bf6af8188..fbf2bf0921 100644 --- a/zuul.d/jobs.yaml +++ b/zuul.d/jobs.yaml @@ -92,6 +92,7 @@ - name: openstack/openstack-ansible-plugins - name: openstack/openstack-ansible-rabbitmq_server - name: openstack/openstack-ansible-repo_server + - name: openstack/openstack-ansible-ops - name: openstack/ansible-role-httpd - name: openstack/ansible-role-systemd_service - name: openstack/ansible-role-systemd_mount diff --git a/zuul.d/playbooks/pre-osa-requirements.yml b/zuul.d/playbooks/pre-osa-requirements.yml index cd1e38e9b8..f605cf4eb8 100644 --- a/zuul.d/playbooks/pre-osa-requirements.yml +++ b/zuul.d/playbooks/pre-osa-requirements.yml @@ -115,7 +115,7 @@ vars: content_var: collections: |- - {% set collections = [] %} + {% set collections = osa_extra_ansible_collections | default([]) %} {% for result in zuul_collections.results %} {% if result.stat.exists %} {% set _ = collections.append({