Хочу в тестовом окружении выкатить собранный docker image и потом обновить контейнер.
Использую gitlab ci и ansible
на целевом хосте стоит anaconda и есть несколько окружений
# /opt/anaconda2/bin/conda env list
# conda environments:
#
py36 /opt/Anaconda3-4.4.0/envs/py36
py38 /opt/Anaconda3-4.4.0/envs/py38
root * /opt/Anaconda3-4.4.0
в gitlab ci использую
ansible:2.9.24-9
image: $CI_REGISTRY/platform/docker-images/ansible:2.9.24-9
и
/opt/Anaconda3-4.4.0/envs/py36
playbook
---
- name: Deploy Web on Host
hosts: '{{ target_host }}'
vars_prompt:
- name: 'target_host'
prompt: 'Enter a target host name or a group name where uploads should be installed'
private: false
vars:
ansible_python_interpreter: /opt/Anaconda3-4.4.0/envs/py36/bin/python
become: true
become_user: root
tasks:
- debug: msg='Ansible works on host {{ ansible_fqdn }}'
- name: Install pip packages
pip:
name:
- docker
- docker-py
state: forcereinstall
virtualenv: /opt/Anaconda3-4.4.0/envs/py36
- name: Pull default Docker image
docker_image:
name: "tools/web:ui_v1.0.1-dev.188"
source: pull
Задача
Pull default Docker image
возвращает ошибку
TASK [Pull default Docker image] ***********************************************
fatal: [project-dev]: FAILED! => {"changed": false, "msg": "Cannot have both the docker-py and docker python modules (old and new version of Docker SDK for Python) installed together as they use the same namespace and cause a corrupt installation. Please uninstall both packages, and re-install only the docker-py or docker python module (for test-host-0025's Python /opt/Anaconda3-4.4.0/envs/py36/bin/python). It is recommended to install the docker module if no support for Python 2.6 is required. Please note that simply uninstalling one of the modules can leave the other module in a broken state."}
проверяю /opt/Anaconda3-4.4.0/envs/py36
там docker и docker-py не появились
Итого правильно подключить окружение?