Skip to content

Commit 3bcf567

Browse files
grzegorzkoperAlex-Welsh
authored andcommitted
bifrost: bump Ansible version to 11
Depends-on: https://review.opendev.org/c/openstack/kolla-ansible/+/945498 Change-Id: I0e7ce418508f6684a20539c6b6129a134f91c71c
1 parent a71d715 commit 3bcf567

File tree

2 files changed

+32
-4
lines changed

2 files changed

+32
-4
lines changed

docker/bifrost/bifrost-base/Dockerfile.j2

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,26 +7,51 @@ LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build
77

88
{% import "macros.j2" as macros with context %}
99

10+
{% set venv_path='/var/lib/kolla/venv' %}
11+
1012
{{ macros.configure_user(name='bifrost') }}
1113

1214
{# NOTE(mgoddard): EPEL required for nginx #}
1315
{{ macros.enable_extra_repos(['epel']) }}
1416

1517
{% set bifrost_base_packages = [
16-
'cpio',
18+
'cpio'
1719
] %}
1820

21+
{% if base_package_type == 'rpm' %}
22+
{% set bifrost_base_packages = bifrost_base_packages + [
23+
'python3.12',
24+
'python3.12-devel'
25+
] %}
26+
{% endif %}
27+
1928
{{ macros.install_packages(bifrost_base_packages | customizable("packages")) }}
2029

21-
ENV VENV /var/lib/kolla/venv
30+
{# Ensure we use Python 3.12 on RPM-based systems #}
31+
{% if base_package_type == 'rpm' %}
32+
RUN cd /usr/bin && \
33+
rm -f python3 && \
34+
ln -s python3.12 python3
35+
{% endif %}
36+
37+
ENV VENV {{ venv_path }}
2238

2339
{% set bifrost_base_pip_packages = [
2440
'/bifrost'
2541
] %}
2642

2743
ADD bifrost-base-archive /bifrost-base-source
2844
COPY build_arg.yml /tmp/build_arg.yml
45+
46+
RUN mkdir -p /requirements \
47+
&& curl -o /requirements/upper-constraints.txt ${UPPER_CONSTRAINTS_FILE:-https://releases.openstack.org/constraints/upper/{{ openstack_release }}} \
48+
&& python3 -m venv --system-site-packages {{ venv_path }} \
49+
&& KOLLA_DISTRO_PYTHON_VERSION=$(/usr/bin/python3 -c "import sys; print('{}.{}'.format(sys.version_info.major, sys.version_info.minor))") \
50+
&& cd {{ venv_path }}/lib \
51+
&& ln -s python${KOLLA_DISTRO_PYTHON_VERSION} {{ venv_path }}/lib/python3
52+
2953
RUN ln -s bifrost-base-source/* bifrost \
54+
&& {{ macros.install_pip(['pip', 'wheel', 'setuptools']) }} \
3055
&& {{ macros.install_pip(bifrost_base_pip_packages | customizable("pip_packages")) }}
3156

3257
WORKDIR /bifrost
@@ -37,11 +62,10 @@ ENV ANSIBLE_GATHER_TIMEOUT=30
3762
{% block bifrost_ansible_install %}
3863
{%- if base_package_type == 'deb' %}
3964
RUN apt-get --error-on=any update && \
40-
bash -c '$VENV/bin/pip install "ansible>=9,<10" && \
4165
{%- else %}
4266
RUN echo " " && \
43-
bash -c '$VENV/bin/pip install "ansible>=8,<9" && \
4467
{%- endif %}
68+
bash -c '$VENV/bin/pip install "ansible>=11,<12" && \
4569
$VENV/bin/ansible-galaxy collection install -r /bifrost/ansible-collections-requirements.yml && \
4670
$VENV/bin/ansible-playbook -vvvv -i /bifrost/playbooks/inventory/target \
4771
/bifrost/playbooks/install.yaml \
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
upgrade:
3+
- |
4+
Bifrost is now using Ansible 11.x.

0 commit comments

Comments
 (0)