Merge "Add support for deploying mcapi control plane k8s on debian-12"

This commit is contained in:
Zuul 2024-09-02 15:00:01 +00:00 committed by Gerrit Code Review
commit 0fc47826b0
3 changed files with 26 additions and 3 deletions

View File

@ -1,8 +1,8 @@
collections:
- name: vexxhost.kubernetes
source: https://github.com/vexxhost/ansible-collection-kubernetes
source: https://github.com/jrosser/ansible-collection-kubernetes
type: git
version: v1.14.1
version: venv-support
- name: osa_ops.mcapi_vexxhost
type: git
version: master

View File

@ -14,3 +14,6 @@ openstack_host_nf_conntrack_max: 1572864
# OSA containers dont run ssh by default so cannot use synchronize
upload_helm_chart_method: copy
# Run ansible modules in a venv on the target hosts
ansible_collection_kubernetes_target_venv: /opt/mcapi_ansible_venv

View File

@ -13,11 +13,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.
- name: Gather k8s facts
- name: Initial facts gathering and venv setup
hosts: k8s_all
gather_facts: false
tags:
- always
- k8s-venv
tasks:
- name: Gather minimal facts for k8s
setup:
@ -26,6 +27,22 @@
- min
when: osa_gather_facts | default(True)
- name: ensure python3 virtualenv is present
ansible.builtin.package:
name:
- python3-venv
- python3-setuptools
when: ansible_facts['os_family'] == 'Debian'
- name: ensure ansible target venv is present
ansible.builtin.pip:
name:
- packaging
virtualenv_command: "python3 -m venv"
virtualenv: "{{ ansible_collection_kubernetes_target_venv }}"
when: ansible_collection_kubernetes_target_venv is defined
- name: Create and configure k8s container
hosts: k8s_all
serial: "{{ k8s_serial | default('20%') }}"
@ -104,6 +121,7 @@
vars:
k8s_node_labels:
openstack-control-plane: enabled
ansible_python_interpreter: "{{ ansible_collection_kubernetes_target_venv ~ '/bin/python' }}"
roles:
- role: "vexxhost.containers.containerd"
- role: "vexxhost.kubernetes.kubernetes"
@ -126,6 +144,8 @@
hosts: k8s_all
gather_facts: true
user: root
vars:
ansible_python_interpreter: "{{ ansible_collection_kubernetes_target_venv ~ '/bin/python' }}"
roles:
- role: "vexxhost.kubernetes.cert_manager"
- role: "vexxhost.kubernetes.cluster_api"