
env-setup script removes epel-release and this breaks our CI template overrides. It is also more geared towards using in opendev CI - let's just install proper Ansible version instead. Change-Id: I68f645bef05dd15eba41479e3ef6713100fb87d0
65 lines
2.0 KiB
Django/Jinja
65 lines
2.0 KiB
Django/Jinja
FROM {{ namespace }}/{{ image_prefix }}openstack-base:{{ tag }}
|
|
{% block labels %}
|
|
LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build_date }}"
|
|
{% endblock %}
|
|
|
|
{% block bifrost_base_header %}{% endblock %}
|
|
|
|
{% import "macros.j2" as macros with context %}
|
|
|
|
{{ macros.configure_user(name='bifrost') }}
|
|
|
|
{# NOTE(mgoddard): EPEL required for nginx #}
|
|
{{ macros.enable_extra_repos(['epel']) }}
|
|
|
|
{% set bifrost_base_packages = [
|
|
'cpio',
|
|
] %}
|
|
|
|
{{ macros.install_packages(bifrost_base_packages | customizable("packages")) }}
|
|
|
|
ENV VENV /var/lib/kolla/venv
|
|
|
|
{% set bifrost_base_pip_packages = [
|
|
'/bifrost'
|
|
] %}
|
|
|
|
ADD bifrost-base-archive /bifrost-base-source
|
|
COPY build_arg.yml /tmp/build_arg.yml
|
|
RUN ln -s bifrost-base-source/* bifrost \
|
|
&& {{ macros.install_pip(bifrost_base_pip_packages | customizable("pip_packages")) }}
|
|
|
|
WORKDIR /bifrost
|
|
|
|
{# ANSIBLE_GATHER_TIMEOUT is a workaround for https://github.com/ansible/ansible/issues/43884 #}
|
|
ENV ANSIBLE_GATHER_TIMEOUT=30
|
|
|
|
{% block bifrost_ansible_install %}
|
|
{%- if base_package_type == 'deb' %}
|
|
RUN apt-get --error-on=any update && \
|
|
{%- else %}
|
|
RUN echo " " && \
|
|
{%- endif %}
|
|
bash -c 'export VENV=/var/lib/kolla/venv && \
|
|
$VENV/bin/pip install "ansible>=6,<7" && \
|
|
$VENV/bin/ansible-galaxy collection install -r /bifrost/ansible-collections-requirements.yml && \
|
|
ansible-playbook -vvvv -i /bifrost/playbooks/inventory/target \
|
|
/bifrost/playbooks/install.yaml \
|
|
-e git_branch={{ openstack_branch_slashed }} \
|
|
-e ipa_upstream_release={{ openstack_branch }} \
|
|
-e @/tmp/build_arg.yml && \
|
|
{%- if base_package_type == 'deb' %}
|
|
apt-get clean && rm -rf /var/lib/apt/lists/*'
|
|
{%- else %}
|
|
dnf clean all && rm -rf /var/dnf/cache'
|
|
{%- endif %}
|
|
{% endblock %}
|
|
|
|
COPY bifrost_sudoers /etc/sudoers.d/kolla_bifrost_sudoers
|
|
|
|
RUN chmod 750 /etc/sudoers.d \
|
|
&& chmod 440 /etc/sudoers.d/kolla_bifrost_sudoers \
|
|
&& chown -R bifrost:bifrost /bifrost
|
|
|
|
{% block bifrost_base_footer %}{% endblock %}
|