Giter VIP home page Giter VIP logo

ansible-role-docker's Introduction

gabops.docker

Build Status

Installs and Configures Docker Community Edition.

Requirements

None.

Role Variables

Variable Default value Description
docker_engine_version latest Defines the version of Docker Engine to be installed.
docker_cli_version latest Defines the version of Docker CLI to be installed.
docker_release_channel stable Defines the release channel to install Docker from. Possible values are stable, test and nigthly.
docker_service_enabled true Controls if the Docker service should be enabled or not in order to be started when the system boots.
docker_service_state started Defines the status of the Docker service. Typical values here are started or stopped
docker_daemon_config {} Defines the settings to be applied on /etc/docker/daemon.json in order to configure the Docker service.
docker_user_config [] Defines the configuration to be applied to users on $HOME/.docker/config.json. If a user defined in the key user does not exist the role will fail.
docker_group_members [] Defines the users and/or groups to be added to the docker group. Note that this role does not create users nor groups, it just appends existing users and groups to the docker group.

Notes:

  • On Debian family distributions could be required to specifiy the epoch number when declaring the version on docker_engine_version and/or docker_cli_version. For example:
    docker_engine_version: "5:18.09"
    docker_cli_version: "5:19.03"
  • The role will detect automatically the home dir of the users defined on docker_user_config by consulting the value on /etc/passwd.

  • For some values (p.g psFormat) in the key config defined on docker_user_config you may need to use the prefix !unsafe. The reason for this is avoiding to render the double curly braces that Docker uses, otherwise Ansible will assume is a Jinja value and will try to render it. See Example Playbook.

Dependencies

None.

Example Playbook

- hosts: docker
  vars:
    docker_engine_version: "18.09"
    docker_cli_version: "19.03.2"
    docker_daemon_config:
      data-root: "/mnt/docker"
      log-level: "debug"
      storage-driver: "vfs"
      log-driver: "json-file"
      log-opts:
        max-size: "10m"
        max-file: "3"
    docker_user_config:
      - user: jenkins
        config:
          credsStore: "ecr-login"
      - user: devops
        config:
          psFormat: !unsafe "table {{.ID}}\\t{{.Labels}}"
          imagesFormat: !unsafe "table {{.ID}}\\t{{.Repository}}\\t{{.Tag}}\\t{{.CreatedAt}}"
      - user: developer
        config:
          proxies:
            default:
              httpProxy:  http://user:[email protected]:3128
              httpsProxy: http://user:[email protected]:3128
        
    docker_group_members:
      - jenkins
      - devops
      - developer

  roles:
    - role: gabops.docker

License

MIT

Author Information

Gabriel Suarez (Gabops)

ansible-role-docker's People

Contributors

dependabot[bot] avatar gabops avatar

Watchers

 avatar  avatar  avatar

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.