Giter Site home page Giter Site logo

geerlingguy / ansible-role-docker Goto Github PK

View Code? Open in Web Editor NEW
1.7K 33.0 828.0 189 KB

Ansible Role - Docker

Home Page: https://galaxy.ansible.com/geerlingguy/docker/

License: MIT License

ansible role docker containers server management infrastructure centos redhat ubuntu

ansible-role-docker's Introduction

Ansible Role: Docker

CI

An Ansible Role that installs Docker on Linux.

Requirements

None.

Role Variables

Available variables are listed below, along with default values (see defaults/main.yml):

# Edition can be one of: 'ce' (Community Edition) or 'ee' (Enterprise Edition).
docker_edition: 'ce'
docker_packages:
    - "docker-{{ docker_edition }}"
    - "docker-{{ docker_edition }}-cli"
    - "docker-{{ docker_edition }}-rootless-extras"
docker_packages_state: present

The docker_edition should be either ce (Community Edition) or ee (Enterprise Edition). You can also specify a specific version of Docker to install using the distribution-specific format: Red Hat/CentOS: docker-{{ docker_edition }}-<VERSION> (Note: you have to add this to all packages); Debian/Ubuntu: docker-{{ docker_edition }}=<VERSION> (Note: you have to add this to all packages).

You can control whether the package is installed, uninstalled, or at the latest version by setting docker_packages_state to present, absent, or latest, respectively. Note that the Docker daemon will be automatically restarted if the Docker package is updated. This is a side effect of flushing all handlers (running any of the handlers that have been notified by this and any other role up to this point in the play).

docker_service_manage: true
docker_service_state: started
docker_service_enabled: true
docker_restart_handler_state: restarted

Variables to control the state of the docker service, and whether it should start on boot. If you're installing Docker inside a Docker container without systemd or sysvinit, you should set docker_service_manage to false.

docker_install_compose_plugin: false
docker_compose_package: docker-compose-plugin
docker_compose_package_state: present

Docker Compose Plugin installation options. These differ from the below in that docker-compose is installed as a docker plugin (and used with docker compose) instead of a standalone binary.

docker_install_compose: true
docker_compose_version: "1.26.0"
docker_compose_arch: "{{ ansible_architecture }}"
docker_compose_path: /usr/local/bin/docker-compose

Docker Compose installation options.

docker_add_repo: true

Controls whether this role will add the official Docker repository. Set to false if you want to use the default docker packages for your system or manage the package repository on your own.

docker_repo_url: https://download.docker.com/linux

The main Docker repo URL, common between Debian and RHEL systems.

docker_apt_release_channel: stable
docker_apt_arch: "{{ 'arm64' if ansible_architecture == 'aarch64' else 'amd64' }}"
docker_apt_repository: "deb [arch={{ docker_apt_arch }}] {{ docker_repo_url }}/{{ ansible_distribution | lower }} {{ ansible_distribution_release }} {{ docker_apt_release_channel }}"
docker_apt_ignore_key_error: True
docker_apt_gpg_key: "{{ docker_repo_url }}/{{ ansible_distribution | lower }}/gpg"
docker_apt_filename: "docker"

(Used only for Debian/Ubuntu.) You can switch the channel to nightly if you want to use the Nightly release.

You can change docker_apt_gpg_key to a different url if you are behind a firewall or provide a trustworthy mirror. Usually in combination with changing docker_apt_repository as well. docker_apt_filename controls the name of the source list file created in sources.list.d. If you are upgrading from an older (<7.0.0) version of this role, you should change this to the name of the existing file (e.g. download_docker_com_linux_debian on Debian) to avoid conflicting lists.

docker_yum_repo_url: "{{ docker_repo_url }}/{{ (ansible_distribution == 'Fedora') | ternary('fedora','centos') }}/docker-{{ docker_edition }}.repo"
docker_yum_repo_enable_nightly: '0'
docker_yum_repo_enable_test: '0'
docker_yum_gpg_key: "{{ docker_repo_url }}/centos/gpg"

(Used only for RedHat/CentOS.) You can enable the Nightly or Test repo by setting the respective vars to 1.

You can change docker_yum_gpg_key to a different url if you are behind a firewall or provide a trustworthy mirror. Usually in combination with changing docker_yum_repository as well.

docker_users:
  - user1
  - user2

A list of system users to be added to the docker group (so they can use Docker on the server).

docker_daemon_options:
  storage-driver: "devicemapper"
  log-opts:
    max-size: "100m"

Custom dockerd options can be configured through this dictionary representing the json file /etc/docker/daemon.json.

Use with Ansible (and docker Python library)

Many users of this role wish to also use Ansible to then build Docker images and manage Docker containers on the server where Docker is installed. In this case, you can easily add in the docker Python library using the geerlingguy.pip role:

- hosts: all

  vars:
    pip_install_packages:
      - name: docker

  roles:
    - geerlingguy.pip
    - geerlingguy.docker

Dependencies

None.

Example Playbook

- hosts: all
  roles:
    - geerlingguy.docker

License

MIT / BSD

Sponsors

  • We Manage: Helping start-ups and grown-ups scaling their infrastructure in a sustainable way.

The above sponsor(s) are supporting Jeff Geerling on GitHub Sponsors. You can sponsor Jeff's work too, to help him continue improving these Ansible open source projects!

Author Information

This role was created in 2017 by Jeff Geerling, author of Ansible for DevOps.

ansible-role-docker's People

Contributors

abedk avatar adamantike avatar amotl avatar aurelien-bareille avatar bajalnyt avatar dale-c-anderson avatar eengstrom avatar fgierlinger avatar fourstepper avatar gebn avatar geerlingguy avatar jamesla avatar kakawait avatar kaysond avatar kostyrev avatar nevart avatar orbin avatar pad92 avatar rickkwa avatar riker09 avatar rnestler avatar rpetti avatar severinkaelin avatar shuuji3 avatar slicen avatar snoopotic avatar stbenjam avatar toxinu avatar yankcrime avatar yethal avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ansible-role-docker's Issues

Docker install failing on RedHat 7.x

Issues on ansible is

Error: Package: docker-ce-18.03.0.ce-1.el7.centos.x86_64 (docker-ce-stable)\n Requires: container-selinux >= 2.9\n

Can be easily reproduced on the server doing

yum install docker-ce
Loaded plugins: product-id, search-disabled-repos, subscription-manager
Resolving Dependencies
--> Running transaction check
---> Package docker-ce.x86_64 0:18.03.0.ce-1.el7.centos will be installed
--> Processing Dependency: container-selinux >= 2.9 for package: docker-ce-18.03.0.ce-1.el7.centos.x86_64
--> Processing Dependency: pigz for package: docker-ce-18.03.0.ce-1.el7.centos.x86_64
--> Running transaction check
---> Package docker-ce.x86_64 0:18.03.0.ce-1.el7.centos will be installed
--> Processing Dependency: container-selinux >= 2.9 for package: docker-ce-18.03.0.ce-1.el7.centos.x86_64
---> Package pigz.x86_64 0:2.3.4-1.el7 will be installed
--> Finished Dependency Resolution
Error: Package: docker-ce-18.03.0.ce-1.el7.centos.x86_64 (docker-ce-stable)
           Requires: container-selinux >= 2.9
**********************************************************************
yum can be configured to try to resolve such errors by temporarily enabling
disabled repos and searching for missing dependencies.
To enable this functionality please set 'notify_only=0' in /etc/yum/pluginconf.d/search-disabled-repos.conf
**********************************************************************

Error: Package: docker-ce-18.03.0.ce-1.el7.centos.x86_64 (docker-ce-stable)
           Requires: container-selinux >= 2.9
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

Changing notify_only to 0 in /etc/yum/pluginconf.d/search-disabled-repos.conf is fixing it.
Can we automate this? Or can I bypass this?

Proxy setting for docker

If you add another task:

  • name: Create directory for docker proxy settings
    become: true
    shell: |
    mkdir -p /etc/systemd/system/docker.service.d
    echo >>/etc/systemd/system/docker.service.d/http-proxy.conf Environment="HTTP_PROXY=$http_proxy"
    echo >>/etc/systemd/system/docker.service.d/http-proxy.conf Environment="HTTP_PROXY=$http_proxy"
    echo >>/etc/systemd/system/docker.service.d/http-proxy.conf Environment="NO_PROXY=$no_proxy"

that uses the environment setting on the box (/etc/environment) and populates the Docker Proxy settings, it is a big help.

Deprecated use of `includes`

When using this role, the user gets warnings as follows;

[DEPRECATION WARNING]: The use of 'include' for tasks has been deprecated. Use 'import_tasks' for static inclusions or
'include_tasks' for dynamic inclusions. This feature will be removed in a future release. Deprecation warnings can be disabled by
setting deprecation_warnings=False in ansible.cfg.

There are currently three pull requests that fix this issue:

It may make sense to wait a couple more releases before making this merge as pointed out in comments on #37

I'm opening this ticket so people find this before opening another PR. :)

Feature Request: Make sure docker daemon is up with systemd

If you're setting restart policies on your containers and you reboot, if the docker daemon is not up automatically, you have to restart services by hand. The docker documentation shows us that we can:

$ sudo systemctl enable docker

I think that'd be nice to have this configurable in this role.

If we're in agreement, I'll submit a PR.

Role won't succeed on ubuntu 14.04

Looks like the older version of Python and it's lack of SNI support strikes again.

This role won't succeed against Ubuntu 14.04, due to its python 2.7.5 version and the lack of support for SNI.

I guess download.docker.com didn't used to require SNI? This sort of thing sometimes happens when services change CDN providers.

Might consider adding ubuntu 14.04 to travis, to catch situations like this.

Log attached:

TASK [geerlingguy.docker : Add Docker apt key.] ********************************
changed: [ubuntu_16_04]
fatal: [ubuntu_14_04]: FAILED! => {"changed": false, "failed": true, "msg": "Failed to validate the SSL certificate for download.docker.com:443. Make sure your managed systems have a valid CA certificate installed. If the website serving the url uses SNI you need python >= 2.7.9 on your managed machine or you can install the `urllib3`, `pyopenssl`, `ndg-httpsclient`, and `pyasn1` python modules to perform SNI verification in python >= 2.6. You can use validate_certs=False if you do not need to confirm the servers identity but this is unsafe and not recommended. Paths checked for this platform: /etc/ssl/certs, /etc/pki/ca-trust/extracted/pem, /etc/pki/tls/certs, /usr/share/ca-certificates/cacert.org, /etc/ansible. The exception msg was: [Errno 1] _ssl.c:510: error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure."}```

Support ubuntu 18.04 Bionic?

Hi,

I have tried to use this repo with ubuntu 18.04, but it fails.
Also I have seen this commit declaring that its not compatible.

Are you planning to add support for Ubuntu 18.04 in the next time?

It seems that this role requires `become: true`

In my opinion, a role should be able to run without defining become: true in the playbook. Only certain blocks should require become: true:

TASK [geerlingguy.docker : Ensure old versions of Docker are not installed.] *************************************************************************
ok: [localhost] => (item=docker)
ok: [localhost] => (item=docker-common)
ok: [localhost] => (item=docker-engine)

TASK [geerlingguy.docker : Add Docker GPG key.] ******************************************************************************************************
fatal: [localhost]: FAILED! => {"changed": false, "msg": "error: cannot open Packages index using db5 - Permission denied (13)\nerror: cannot open Packages database in /var/lib/rpm\nerror: /tmp/tmp783Lbf: key 1 import failed.\n"}
	to retry, use: --limit @/home/user/dev/ansible/dev-machine.retry

PLAY RECAP *******************************************************************************************************************************************
localhost

Adding docker-ce

Hello Jeff,

I'm wondering how long are we all going to run on 1.x versions of docker, and running the latest docker version - 17.3.xx?

Invoking "apt" only once while using a loop via squash_actions is deprecated

Using version 2.5.0, I receive the following while executing the role using the devel branch:

TASK [geerlingguy.docker : Ensure dependencies are installed.] ***********************************************************************************************************************
[DEPRECATION WARNING]: Invoking "apt" only once while using a loop via squash_actions is deprecated. Instead of using a loop to supply multiple items and specifying `name: {{ item 
}}`, please use `name: [u'apt-transport-https', u'ca-certificates']` and remove the loop. This feature will be removed in version 2.11. Deprecation warnings can be disabled by 
setting deprecation_warnings=False in ansible.cfg.
ok: [hostname] => (item=[u'apt-transport-https', u'ca-certificates'])

The fix looks trivial, and will actually make the role more efficient. From the apt module notes:

When used with a loop: each package will be processed individually, it is much more efficient to pass the list directly to the name option.

Role fails on debian9 AWS ami

I have been using the role with success on to create amis based off the following search patterns (and always getting the most recent result):

*debian-jessie-amd64-hvm*
*ubuntu-bionic-18.04-amd64-server*
*ubuntu-xenial-16.04-amd64-server*

However when attempting with:

*debian-stretch-amd64-hvm*

the role fails as follows:

    amazon-ebs: TASK [docker : Add Docker repository.] *****************************************
    amazon-ebs: Wednesday 21 November 2018  16:18:44 +0200 (0:00:00.092)       0:01:05.876 ****
    amazon-ebs: An exception occurred during task execution. To see the full traceback, use -vvv. The error was: Shared connection to 127.0.0.1 closed.
    amazon-ebs: fatal: [default]: FAILED! => changed=false
    amazon-ebs:   module_stderr: |-
    amazon-ebs:     Traceback (most recent call last):
    amazon-ebs:       File "/home/admin/.ansible/tmp/ansible-tmp-1542809924.26-27445738831388/AnsiballZ_apt_repository.py", line 113, in <module>
    amazon-ebs:         _ansiballz_main()
    amazon-ebs:       File "/home/admin/.ansible/tmp/ansible-tmp-1542809924.26-27445738831388/AnsiballZ_apt_repository.py", line 105, in _ansiballz_main
    amazon-ebs:         invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
    amazon-ebs:       File "/home/admin/.ansible/tmp/ansible-tmp-1542809924.26-27445738831388/AnsiballZ_apt_repository.py", line 48, in invoke_module
    amazon-ebs:         imp.load_module('__main__', mod, module, MOD_DESC)
    amazon-ebs:       File "/tmp/ansible_apt_repository_payload_a7mtty/__main__.py", line 550, in <module>
    amazon-ebs:       File "/tmp/ansible_apt_repository_payload_a7mtty/__main__.py", line 542, in main
    amazon-ebs:       File "/usr/lib/python2.7/dist-packages/apt/cache.py", line 464, in update
    amazon-ebs:         raise FetchFailedException(e)
    amazon-ebs:     apt.cache.FetchFailedException: E:The repository 'https://download.docker.com/linux/debian NA Release' does not have a Release file.

Docker 'EE' 404's on RedHat Linux

It doesn't seem like the EE version of Docker is available in the source we are looking up here 🤔

Request failed", "response": "HTTP Error 404: Not Found", "state": "absent", "status_code": 404, "url": "https://download.docker.com/linux/centos/docker-ee.repo"}

Feature request - select docker version

Currently there's no option to specify a specific docker version, which is desired in the case for something like a Kubernetes (which at the moment requires a 17.03.x version), or keeping all installations consistent across a set of servers without necessarily moving them all to the latest version.

At the moment I fixed this by overriding the docker_package variable for those specific hosts like this, but this only works for Ubuntu hosts:

# Explicitly set the version of docker to be installed to the one here:
docker_version: '17.03.2'
docker_package: 'docker-{{docker_edition}}={{docker_version}}~{{docker_edition}}-0~{{ansible_distribution|lower}}-{{ansible_distribution_release}}'

Not sure how this would be handled best, but you need some version specific handling per distribution, since the "version" part of the package name already uses a different separator between apt (which uses =) and yum (which uses -).

It would be nice if this could be generalized somehow, but I don't need yum support at the moment, so my 'quick hack' works at the moment.

Edit daemon.json

Hi, amazing role !
I'd like to have the daemon.json configured as this when installing with the role:

{
    "default-runtime": "nvidia",
    "default-shm-size": "1G",
    "runtimes": {
        "nvidia": {
            "path": "nvidia-container-runtime",
            "runtimeArgs": []
        }
    }
}

Which approach do you think would support doing that.
Can I extend your role somehow and deploy the file manually ?
Thanks.

Install on Debian buster does not work due to ansible bug

ansible_distribution_release does not work properly on Debian buster for unclear reasons (it resolves to NA rather than buster). See ansible/ansible#19874

Using ansible_lsb.codename rather than ansible_distribution_release for the docker apt repository would solve this problem, or potentially checking for buster and setting manually as a workaround. I realize that the underlying issue is in ansible itself, but that still makes this not work by default which makes for a frustrating experience.

flush_handlers task does not support when conditional

Using version 2.5.0, I receive the following while executing the role using the devel branch:

TASK [geerlingguy.docker : Ensure Docker is started and enabled at boot.] ************************************************************************************************************
ok: [hostname]
 [WARNING]: flush_handlers task does not support when conditional

As the flush always triggers, regardless of when, I propose removing the when to fix the warning.

Failed to import docker-py

fatal: [174.138.8.0]: FAILED! => {"changed": false, "msg": "Failed to import docker-py - No module named requests.exceptions. Try pip install docker-py"}

[Centos7] Install of docker-compose

Hello,

For strange reasons, when I install docker and docker-compose with this role, the docker-compose binary is not available for all users. It work with the 'root' user but not with users with restricted privileges (i believe this is a $PATH issue).

I have solved the problem by creating a symlink to the current binary:
ln -s /usr/local/bin/docker-compose /bin/docker-compose.

I can add the symlink to the role, but maybe there is a better way ?

I use a fresh VM with minimal installation of the latest Centos7.

DOCKER iptables chain problem when used with geerlingguy.firewall

I have a simple playbook

- hosts: virt
  vars:
    firewall_allowed_tcp_ports:
    - "22"
  roles:
    - firewall
    - docker

After successfull completion running docker run -p 1234:1234 hello-world results in:

docker: Error response from daemon: driver failed programming external connectivity on endpoint amazing_mestorf (3dcbb599298bbd13e3769ef93d5659c25185f143f819250dc9a67f80caefe31c): (iptables failed: iptables --wait -t filter -A DOCKER ! -i docker0 -o docker0 -p tcp -d 172.17.0.2 --dport 1234 -j ACCEPT: iptables: No chain/target/match by that name. (exit status 1)).

Workaround is to restart the Docker service

Re-login user when adding herself to `docker_users`

Hi @geerlingguy ,
thanks for implemeting this almost perfect role! One of last steps towards perfection would be to re-login user when she was added to the 'docker' group, at least when username matches ansible remote user:

roles:
    - { role: geerlingguy.docker, docker_users: ['{{ ansible_user_id }}'], become: yes }

Problem is that I cannot use the docker_container in the same play otherwise (without privilege escalation), because login+logout is required for group assigment to take effect.

Switch to using docker-ce and docker-ee

Since Docker loves changing the entire ecosystem every year or so, in the time between creating this role and now, the recommended installation method has changed entirely: https://docs.docker.com/engine/installation/linux/centos/#install-using-the-repository

I haven't looked at the docs on Debian quite yet, but I need to update all the things for CentOS at least:

  • Use docker-ce as the package to install by default (but leave this configurable so people can install docker-ee if they need it).
  • Switch the Yum repo URL (and make it a configurable option so people can install from the EE repos if they like).
  • Set up the Yum repo to allow the choice of the Edge release channel.

User's primary group shouldn't be updated

When the docker_users var is used, the user's primary group is set to docker. This is probably undesirable in most cases, and instead docker be added to the list of the user's supplementary groups.

'Using tests as filters' deprecation warning in Ansible 2.5+

I'm seeing the following two deprecation warnings when running this role under Ansible 2.5 or later:

TASK [geerlingguy.docker : Ensure curl is present (on older systems without SNI).] *************************************
[DEPRECATION WARNING]: Using tests as filters is deprecated. Instead of using `result|failed` instead use `result is 
failed`. This feature will be removed in version 2.9. Deprecation warnings can be disabled by setting 
deprecation_warnings=False in ansible.cfg.
skipping: [192.168.44.3]

TASK [geerlingguy.docker : Add Docker apt key (alternative for older systems without SNI).] ****************************
[DEPRECATION WARNING]: Using tests as filters is deprecated. Instead of using `result|failed` instead use `result is 
failed`. This feature will be removed in version 2.9. Deprecation warnings can be disabled by setting 
deprecation_warnings=False in ansible.cfg.
skipping: [192.168.44.3]

Install docker and docker-compose from Fedora repos

# fc29
dnf install -y docker docker-compose

# docker-1.13.1-62.git9cb56fd.fc29.src.rpm
# docker-compose-1.22.0-2.fc29.src.rpm

# fc32
dnf install -y moby-engine docker-compose

What's a good way to make this (only installing from a limited set of package repos) optional?

Add Docker Compose

Docker Compose isn't installed by default on Linux, so we need to install it separately (optionally). See the Install Docker Compose documentation.

It looks like it's as simple as downloading the binary straight to a path in $PATH, but I want to make sure there are no particular gotchas and it's as configurable as it needs to be.

Ubuntu cosmic failing

The full traceback is:
  File "/tmp/ansible_apt_repository_payload_jonrxkbo/__main__.py", line 542, in main
    cache.update()
  File "/usr/lib/python3/dist-packages/apt/cache.py", line 549, in update
    raise FetchFailedException(e)

fatal: [default]: FAILED! => {
    "changed": false,
    "invocation": {
        "module_args": {
            "codename": null,
            "filename": null,
            "install_python_apt": true,
            "mode": null,
            "repo": "deb [arch=amd64] https://download.docker.com/linux/ubuntu cosmic stable",
            "state": "present",
            "update_cache": true,
            "validate_certs": true
        }
    },
    "msg": "E:The repository 'https://download.docker.com/linux/ubuntu cosmic Release' does not have a Release file."
}
        to retry, use: --limit @/Users/romanvg/dev/NGB-deploy/site.retry

PLAY RECAP *********************************************************************
default                    : ok=5    changed=2    unreachable=0    failed=1

Pin version

Is there a way to pin to a specific version so that apt-get upgrade does not upgrade Docker and Docker Compose?

getting 'Could not find the requested service docker: host'

It seems that we are looking for a docker service that is nonexistant.

I am testing this in a docker container 'centos:7'. so it fails on line /geerlingguy.docker/tasks/main.yml:11

any ideas? Docker in Docker should not cause issues right?

Docker with AWSLinux

Just to leave a comment that may help other people. I am using AWSLinux on Vagrant (image hbsmith/awslinux).
To install docker on it, you have to set docker_packageto docker and you are all good.

Feature Request - Swarm clustering

I've had some trouble getting your Kubernetes role to work in a Vagrant environment so I decided to try Docker Swarm and it was a whole lot easier to create a cluster. Yeah, I know it's not as complicated but it would be nice to have some functionality similar to your Kubernetes role in this role. I've got an idea on how to set it up and I'd like to get a pull request in for it. Please let me know if this something you'd be interested in having as a part of this role.

docker-compose not upgraded

although

docker_compose_version: "1.22.0" is defined

the local version remains outdated

docker-compose --version
docker-compose version 1.13.0, build 1719ceb

after running this role

Debugging

It seems that the full path has to be specified as just running docker-compose fails, while docker-compose itself exists in /usr/local/bin

TASK [geerlingguy.docker : debug] **********************************************
ok: [localhost] => {
    "docker_compose_current_version": {
        "changed": false, 
        "cmd": "docker-compose --version", 
        "failed": false, 
        "failed_when_result": false, 
        "msg": "[Errno 2] No such file or directory", 
        "rc": 2
    }
}

Errors installing Docker 18.09 on systemd systems

When using this role on a freshly-deployed Ubuntu 16.04 host, we are getting the following error:

Unable to restart service docker: Job for docker.service failed because the control process exited with error code. See \"systemctl status docker.service\" and \"journalctl -xe\" for details.\n

become: true needed on most of the tasks

I have to assume you run your ansible as root. When I try to run your scripts, it all fails with permissions. I have to update each task with become: true, then it all runs perfect.

Add `docker` python package

It's plausible someone is installing this role because they're planning to execute an Ansible docker_container task, however this task depends on the python docker package to function.

It'd be great if this role added this package directly, to avoid having to check for it in dependent roles.

Allow for upgrading of docker-compose version

With the current logic, you're stuck with the version of Docker Compose you originally downloaded, forever. Make it so the role upgrades if you set a newer docker_compose_version.

Role is always deleting and reinstalling Docker compose

This role seems to delete and reinstall Docker Compose every time on both a macOS 10.13.6 target and a Centos 7 target.

TASK [geerlingguy.docker : Delete existing docker-compose version if it's different.] *************
changed: [hostname]

TASK [geerlingguy.docker : Install Docker Compose (if configured).] *******************************
changed: [hostname]

Not sure if I have something configured incorrectly. These are the only configurations that I think are related to the role:

# geerlingguy.docker settings
pip_install_packages:
  - name: docker
  - name: docker-compose
docker_users:
  - user1
  - user2

Let me know what kind of other information you'd like me to share.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.