mongrelion.docker

docker logo

Ansible Role: Docker

Build Status License Ansible Role

Description

This role installs and sets up the Docker container platform.

Requirements

  • Ansible version 2.4 or higher

Role Variables

You can customize these variables by modifying the defaults/main.yml file or using the table below.

Name Default Value Description
docker_compose yes Install the Docker Compose package
docker_proxy no Enable HTTP proxy setup
docker_http_proxy "" Address for the HTTP proxy server
docker_https_proxy "" Address for the HTTPS proxy server
docker_no_proxy "" List of hosts that won't use the HTTP proxy
docker_version "17.06" Version of Docker to install on the target server. Use latest for updates
docker_default_config [ storage-driver: devicemapper, log-level: info ] Configuration for the Docker daemon
docker_users [] Users to be added to the Docker group. Users must exist prior to being added. You can specify the user used for Ansible connection like `- {{ ansible_env['SUDO_USER']

Example

Playbooks

To install Docker with the default configuration:

- hosts: servers
  roles:
    - mongrelion.docker

To install and configure the Docker daemon:

- hosts: servers
  roles:
    - role: mongrelion.docker
      docker_config:
        live-restore: true
        userland-proxy: false

Local Testing

To test this role locally, use Docker and molecule (version 2.x). You need Docker installed on your system. Check the "Get started" section for a suitable Docker package for your system.

We use tox to make testing across different Ansible versions easier. To install tox, run:

pip install tox

To run tests across all Ansible versions (Note: this may take a while):

tox

To run a specific molecule command in a custom environment with just the default test scenario:

tox -e py27-ansible25 -- molecule test -s default

For more details about using molecule, visit their documentation.

To run tests on a remote Docker host, set the DOCKER_HOST variable before running tox tests.

License

This project is licensed under the MIT License. See LICENSE for more information.

Author Information

You can find me on Twitter: @mongrelion

Contributors

Installa
ansible-galaxy install mongrelion.docker
Licenza
mit
Download
60.6k
Proprietario
Automation Junkie Took the "Cloud Native" thing too serious and now I'm a hang glider pilot