aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrzegorz Koper <grzegorzk@stackhpc.com>2025-03-20 20:20:54 +0100
committerGrzegorz Koper <grzegorzk@stackhpc.com>2025-04-02 10:30:46 +0200
commitc8fdb5550b15f98ed8f331f8d4b88ce150ccf3a5 (patch)
treeadbbca5362730329a67d7809a10e2840d2934ca0
parent830a10922565c9e482d799e7feca47ffe16624b0 (diff)
downloadkolla-c8fdb5550b15f98ed8f331f8d4b88ce150ccf3a5.tar.gz
kolla-c8fdb5550b15f98ed8f331f8d4b88ce150ccf3a5.zip
bifrost: bump Ansible version to 11
Depends-on: https://review.opendev.org/c/openstack/kolla-ansible/+/945498 Change-Id: I0e7ce418508f6684a20539c6b6129a134f91c71c
-rw-r--r--docker/bifrost/bifrost-base/Dockerfile.j232
-rw-r--r--releasenotes/notes/bifrost-ansible-11-d14b635f9f766675.yaml4
2 files changed, 32 insertions, 4 deletions
diff --git a/docker/bifrost/bifrost-base/Dockerfile.j2 b/docker/bifrost/bifrost-base/Dockerfile.j2
index a1306728c..26d36effd 100644
--- a/docker/bifrost/bifrost-base/Dockerfile.j2
+++ b/docker/bifrost/bifrost-base/Dockerfile.j2
@@ -7,18 +7,34 @@ LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build
{% import "macros.j2" as macros with context %}
+{% set venv_path='/var/lib/kolla/venv' %}
+
{{ macros.configure_user(name='bifrost') }}
{# NOTE(mgoddard): EPEL required for nginx #}
{{ macros.enable_extra_repos(['epel']) }}
{% set bifrost_base_packages = [
- 'cpio',
+ 'cpio'
] %}
+{% if base_package_type == 'rpm' %}
+ {% set bifrost_base_packages = bifrost_base_packages + [
+ 'python3.12',
+ 'python3.12-devel'
+ ] %}
+{% endif %}
+
{{ macros.install_packages(bifrost_base_packages | customizable("packages")) }}
-ENV VENV /var/lib/kolla/venv
+{# Ensure we use Python 3.12 on RPM-based systems #}
+{% if base_package_type == 'rpm' %}
+RUN cd /usr/bin && \
+ rm -f python3 && \
+ ln -s python3.12 python3
+{% endif %}
+
+ENV VENV {{ venv_path }}
{% set bifrost_base_pip_packages = [
'/bifrost'
@@ -26,7 +42,16 @@ ENV VENV /var/lib/kolla/venv
ADD bifrost-base-archive /bifrost-base-source
COPY build_arg.yml /tmp/build_arg.yml
+
+RUN mkdir -p /requirements \
+ && curl -o /requirements/upper-constraints.txt ${UPPER_CONSTRAINTS_FILE:-https://releases.openstack.org/constraints/upper/{{ openstack_release }}} \
+ && python3 -m venv --system-site-packages {{ venv_path }} \
+ && KOLLA_DISTRO_PYTHON_VERSION=$(/usr/bin/python3 -c "import sys; print('{}.{}'.format(sys.version_info.major, sys.version_info.minor))") \
+ && cd {{ venv_path }}/lib \
+ && ln -s python${KOLLA_DISTRO_PYTHON_VERSION} {{ venv_path }}/lib/python3
+
RUN ln -s bifrost-base-source/* bifrost \
+ && {{ macros.install_pip(['pip', 'wheel', 'setuptools']) }} \
&& {{ macros.install_pip(bifrost_base_pip_packages | customizable("pip_packages")) }}
WORKDIR /bifrost
@@ -37,11 +62,10 @@ ENV ANSIBLE_GATHER_TIMEOUT=30
{% block bifrost_ansible_install %}
{%- if base_package_type == 'deb' %}
RUN apt-get --error-on=any update && \
- bash -c '$VENV/bin/pip install "ansible>=9,<10" && \
{%- else %}
RUN echo " " && \
- bash -c '$VENV/bin/pip install "ansible>=8,<9" && \
{%- endif %}
+ bash -c '$VENV/bin/pip install "ansible>=11,<12" && \
$VENV/bin/ansible-galaxy collection install -r /bifrost/ansible-collections-requirements.yml && \
$VENV/bin/ansible-playbook -vvvv -i /bifrost/playbooks/inventory/target \
/bifrost/playbooks/install.yaml \
diff --git a/releasenotes/notes/bifrost-ansible-11-d14b635f9f766675.yaml b/releasenotes/notes/bifrost-ansible-11-d14b635f9f766675.yaml
new file mode 100644
index 000000000..c24477881
--- /dev/null
+++ b/releasenotes/notes/bifrost-ansible-11-d14b635f9f766675.yaml
@@ -0,0 +1,4 @@
+---
+upgrade:
+ - |
+ Bifrost is now using Ansible 11.x.