indigo-dc / ansible-role-docker Goto Github PK
View Code? Open in Web Editor NEWAnsible role for docker
License: Apache License 2.0
Ansible role for docker
License: Apache License 2.0
Hi,
We where doing some tests to deploy a Mesos cluster on AWS, which uses this role but the deployment fails with the following error:
TASK [indigo-dc.docker : Fail if OS distro is not Ubuntu 14.04] ****************
fatal: [34.198.199.10_22]: FAILED! => {"changed": false, "failed": true, "msg": "The role is designed only for Ubuntu 14.04"}
Can we have support for Ubuntu 16.04 for this role.
Thank you very much in advance.
Environment: Ubuntu 16.04 with Python 2.7
Latest version of pip (21) dropped support for python 2 this month.
However we are still using Ubuntu 16.04 and old python 2 version for some use-cases.
TASK [indigo-dc.docker : [Common] Install docker-py dependency] ****************
Wednesday 27 January 2021 18:19:21.176260
fatal: [192.168.100.70_1]: FAILED! => {"changed": false, "cmd": "/usr/local/bin/pip2 install -U docker", "msg": "\n:stderr: Traceback (most recent call last):\n File \"/usr/local/bin/pip2\", line 9, in <module>\n load_entry_point('pip==21.0', 'console_scripts', 'pip2')()\n File \"/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py\", line 542, in load_entry_point\n return get_distribution(dist).load_entry_point(group, name)\n File \"/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py\", line 2569, in load_entry_point\n return ep.load()\n File \"/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py\", line 2229, in load\n return self.resolve()\n File \"/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py\", line 2235, in resolve\n module = __import__(self.module_name, fromlist=['__name__'], level=0)\n File \"/usr/local/lib/python2.7/dist-packages/pip-21.0-py2.7.egg/pip/_internal/cli/main.py\", line 60\n sys.stderr.write(f\"ERROR: {exc}\")\n ^\nSyntaxError: invalid syntax\n"}
Hi,
I installed this indigo-dc.docker role. But ansible docker modules exec got an error.
[root@localhost ~]# ansible -m docker_container -a "name=test01 image=busybox detach=yes tty=yes command=sh" localhost
[WARNING]: provided hosts list is empty, only localhost is available
localhost | FAILED! => {
"changed": false,
"failed": true,
"msg": "Failed to import docker-py - cannot import name NotFound. Try pip install docker-py
"
}
[root@localhost ~]# cat /etc/redhat-release
CentOS Linux release 7.3.1611 (Core)
[root@localhost ~]# docker version
Client:
Version: 1.13.1
API version: 1.26
Go version: go1.7.5
Git commit: 092cba3
Built: Wed Feb 8 06:38:28 2017
OS/Arch: linux/amd64
Server:
Version: 1.13.1
API version: 1.26 (minimum version 1.12)
Go version: go1.7.5
Git commit: 092cba3
Built: Wed Feb 8 06:38:28 2017
OS/Arch: linux/amd64
Experimental: false
[root@localhost ~]# pip show docker-py
Name: docker-py
Version: 1.2.3
Summary: Python client for Docker.
Home-page: https://github.com/docker/docker-py/
Author: UNKNOWN
Author-email: UNKNOWN
License: UNKNOWN
Location: /usr/lib/python2.7/site-packages
Requires: requests, six, websocket-client
[root@localhost ~]# pip install -q -U docker-py
[root@localhost ~]# pip show docker-py
Name: docker-py
Version: 1.10.6
Summary: Python client for Docker.
Home-page: https://github.com/docker/docker-py/
Author: Joffrey F
Author-email: [email protected]
License: UNKNOWN
Location: /usr/lib/python2.7/site-packages
Requires: websocket-client, backports.ssl-match-hostname, ipaddress, six, requests, docker-pycreds
[root@localhost ~]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
[root@localhost ~]# ansible -m docker_container -a "name=test01 image=busybox detach=yes tty=yes command=sh" localhost
[WARNING]: provided hosts list is empty, only localhost is available
localhost | SUCCESS => {
"ansible_facts": {},
"changed": true
}
[root@localhost ~]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
163cac319573 busybox "sh" 2 seconds ago Up 1 second test01
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.