Answer the question
In order to leave comments, you need to log in
How to correctly connect the environment on the host for python for ansible:2.9.24?
I want to roll out the assembled docker image in a test environment and then update the container.
I use gitlab ci and ansible
on the target host is anaconda and there are several environments
# /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
image: $CI_REGISTRY/platform/docker-images/ansible:2.9.24-9
---
- 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
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."}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question