Improve kolla-toolbox offline support.

* Use structure that allow for custom package version and base URL.

Change-Id: I169e51c0f5c691518ada1837990b5bdd2a3d1481
Closes-bug: #2020761
(cherry picked from commit 7f38e1df71eafb250b14c4e125c7313bd9218f7d)
(cherry picked from commit 8558004ab70919cc2a822107c953a24710227f9e)
This commit is contained in:
Gaël THEROND (Fl1nt) 2023-05-25 16:39:25 +02:00 committed by Maksim Malchuk
parent a76d93dfb9
commit 0cdce9f776
2 changed files with 11 additions and 3 deletions

View File

@ -84,15 +84,18 @@ ENV PATH {{ virtualenv_path }}/bin:$PATH
'pyudev',
] %}
COPY requirements.yml /var/lib/ansible/
RUN {{ macros.install_pip(['pip', 'wheel', 'setuptools']) }} \
&& {{ macros.install_pip(kolla_toolbox_pip_packages | customizable("pip_packages")) }} \
&& mkdir -p /etc/ansible /usr/share/ansible \
&& echo 'localhost ansible_connection=local ansible_python_interpreter={{ virtualenv_path }}/bin/python' > /etc/ansible/hosts \
&& sed -i 's| "identity_api_version": "2.0",| "identity_api_version": "3",|' {{ os_client_config }} \
&& ansible-galaxy collection install -p /usr/share/ansible/collections -r /var/lib/ansible/requirements.yml
&& sed -i 's| "identity_api_version": "2.0",| "identity_api_version": "3",|' {{ os_client_config }}
{% block kolla_toolbox_collections_install %}
COPY requirements.yml /var/lib/ansible/
RUN ansible-galaxy collection install -p /usr/share/ansible/collections -r /var/lib/ansible/requirements.yml
ENV ANSIBLE_LIBRARY /usr/share/ansible:$ANSIBLE_LIBRARY
{% endblock %}
COPY find_disks.py /usr/share/ansible/
COPY ansible.cfg /etc/ansible/ansible.cfg

View File

@ -0,0 +1,5 @@
---
fixes:
- |
Fixes missing way for kolla-toolbox to be built offline.
`LP#2020761 <https://launchpad.net/bugs/2020761>`__