kolla-ansible/docker/kolla-toolbox/Dockerfile.j2
Christian Berendt 76f97b4067 Create ansible home directory in kolla-toolbox container
This solves the following issue when running an ansible command inside
the kolla-toolbox container:

[Errno 13] Permission denied: '/home/ansible/.ansible'

Change-Id: I654d27c49b7fcc50e018b61146084660894352aa
Closes-bug: #1592268
2016-06-14 07:47:22 +02:00

64 lines
1.8 KiB
Django/Jinja

FROM {{ namespace }}/{{ image_prefix }}base:{{ tag }}
MAINTAINER {{ maintainer }}
{% set os_client_config='/usr/lib/python2.7/site-packages/os_client_config/defaults.json' %}
{% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %}
RUN yum -y install \
gcc \
git \
libffi-devel \
libxml2-devel \
libxslt-devel \
MariaDB-devel \
MariaDB-shared \
openssl-devel \
python-devel \
openssh-clients \
&& yum clean all
{% elif base_distro in ['ubuntu', 'debian'] %}
RUN apt-get -y --no-install-recommends install \
build-essential \
ca-certificates \
git \
libffi-dev \
libmariadbclient-dev \
libssl-dev \
libxslt1-dev \
python-dev \
&& apt-get clean
{% if base_distro == 'debian' %}
{% set os_client_config='/usr/local/lib/python2.7/dist-packages/os_client_config/defaults.json' %}
{% endif %}
{% endif %}
RUN curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py \
&& python get-pip.py \
&& rm get-pip.py \
&& pip --no-cache-dir install pytz \
&& pip --no-cache-dir install \
'ansible>2' \
MySQL-python \
os-client-config==1.16.0 \
pyudev \
shade==1.4.0
RUN useradd -m --user-group ansible --groups kolla \
&& mkdir -p /etc/ansible /usr/share/ansible \
&& echo 'localhost ansible_connection=local' > /etc/ansible/hosts \
&& sed -i 's| "identity_api_version": "2.0",| "identity_api_version": "3",|' {{ os_client_config }}
COPY find_disks.py kolla_keystone_service.py kolla_keystone_user.py kolla_sanity.py kolla_zookeeper.py /usr/share/ansible/
COPY ansible.cfg /home/ansible/.ansible.cfg
CMD ["/bin/sleep", "infinity"]
{{ include_footer }}
USER ansible