diff options
| author | Zuul <zuul@review.openstack.org> | 2018-05-17 10:01:32 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2018-05-17 10:01:32 +0000 |
| commit | 7ef718f8ae94ae672497bf06bb7dae31caae1c8c (patch) | |
| tree | bfeef4eb6f92c802493106c5323b442785227038 /docker | |
| parent | 25f2e6b754366471aaff9faeeac0d7570bb006fc (diff) | |
| parent | ce31fa4b1c85de4c21ffb63f3cf58e02bfd3d0a4 (diff) | |
| download | kolla-7ef718f8ae94ae672497bf06bb7dae31caae1c8c.tar.gz kolla-7ef718f8ae94ae672497bf06bb7dae31caae1c8c.zip | |
Merge "Move ansible to virtualenv in kolla_toolbox"
Diffstat (limited to 'docker')
| -rw-r--r-- | docker/kolla-toolbox/Dockerfile.j2 | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/docker/kolla-toolbox/Dockerfile.j2 b/docker/kolla-toolbox/Dockerfile.j2 index ccc8cb7c5..448688b51 100644 --- a/docker/kolla-toolbox/Dockerfile.j2 +++ b/docker/kolla-toolbox/Dockerfile.j2 @@ -3,7 +3,8 @@ LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build {% block kolla_toolbox_header %}{% endblock %} -{% set os_client_config='/usr/lib/python2.7/site-packages/os_client_config/defaults.json' %} +{% set virtualenv_path='/opt/ansible' %} +{% set os_client_config= virtualenv_path + '/lib/python2.7/site-packages/os_client_config/defaults.json' %} {% import "macros.j2" as macros with context %} @@ -69,6 +70,15 @@ RUN curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py \ && rm get-pip.py {% endblock %} +{% set kolla_toolbox_pip_virtualenv_packages = [ + 'virtualenv' + ] %} + +RUN {{ macros.install_pip(kolla_toolbox_pip_virtualenv_packages|customizable("pip_packages"), constraints=false) }} \ + && virtualenv --system-site-packages {{ virtualenv_path }} + +ENV PATH {{ virtualenv_path }}/bin:$PATH + {% set kolla_toolbox_pip_packages = [ 'ansible==2.2.0.0', 'MySQL-python', @@ -81,12 +91,13 @@ RUN curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py \ 'shade==1.27.1' ] %} -RUN {{ macros.install_pip(kolla_toolbox_pip_packages | customizable("pip_packages"), constraints = false) }} - -RUN mkdir -p /etc/ansible /usr/share/ansible \ - && echo 'localhost ansible_connection=local' > /etc/ansible/hosts \ +RUN {{ macros.install_pip(kolla_toolbox_pip_packages | customizable("pip_packages"), constraints=false) }} \ + && 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 }} +ENV ANSIBLE_LIBRARY /usr/share/ansible:$ANSIBLE_LIBRARY + COPY find_disks.py kolla_keystone_service.py kolla_keystone_user.py kolla_sanity.py /usr/share/ansible/ COPY ansible.cfg /var/lib/ansible/.ansible.cfg |
