{"id":15698701,"url":"https://github.com/darkwizard242/ansible-role-docker","last_synced_at":"2025-05-08T22:12:26.560Z","repository":{"id":44609611,"uuid":"211597128","full_name":"darkwizard242/ansible-role-docker","owner":"darkwizard242","description":"Ansible role for Docker. Available on Ansible Galaxy. ","archived":false,"fork":false,"pushed_at":"2024-06-20T18:58:32.000Z","size":65,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-31T18:46:35.745Z","etag":null,"topics":["ansible","ansible-galaxy","ansible-role","containerization","docker","system"],"latest_commit_sha":null,"homepage":"https://galaxy.ansible.com/darkwizard242/docker","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/darkwizard242.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-09-29T03:25:53.000Z","updated_at":"2024-06-20T18:56:32.000Z","dependencies_parsed_at":"2024-04-09T03:30:16.107Z","dependency_job_id":"08e3a467-bd07-4113-b4e5-c8b1e6966604","html_url":"https://github.com/darkwizard242/ansible-role-docker","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darkwizard242%2Fansible-role-docker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darkwizard242%2Fansible-role-docker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darkwizard242%2Fansible-role-docker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darkwizard242%2Fansible-role-docker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/darkwizard242","download_url":"https://codeload.github.com/darkwizard242/ansible-role-docker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249869035,"owners_count":21337502,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ansible","ansible-galaxy","ansible-role","containerization","docker","system"],"created_at":"2024-10-03T19:32:25.440Z","updated_at":"2025-04-20T08:33:27.816Z","avatar_url":"https://github.com/darkwizard242.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![build-test](https://github.com/darkwizard242/ansible-role-docker/workflows/build-and-test/badge.svg?branch=master)](https://github.com/darkwizard242/ansible-role-docker/actions?query=workflow%3Abuild-and-test) [![release](https://github.com/darkwizard242/ansible-role-docker/workflows/release/badge.svg)](https://github.com/darkwizard242/ansible-role-docker/actions?query=workflow%3Arelease) ![Ansible Role](https://img.shields.io/ansible/role/d/darkwizard242/docker) [![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=ansible-role-docker\u0026metric=sqale_rating)](https://sonarcloud.io/dashboard?id=ansible-role-docker) [![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=ansible-role-docker\u0026metric=reliability_rating)](https://sonarcloud.io/dashboard?id=ansible-role-docker) [![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=ansible-role-docker\u0026metric=security_rating)](https://sonarcloud.io/dashboard?id=ansible-role-docker) ![GitHub tag (latest SemVer)](https://img.shields.io/github/tag/darkwizard242/ansible-role-docker?label=release) ![GitHub repo size](https://img.shields.io/github/repo-size/darkwizard242/ansible-role-docker?color=orange\u0026style=flat-square)\n\n# Ansible Role: docker\n\nRole to install (_by default_) [docker](https://www.docker.com/) package or uninstall (_if passed as var_) on **Ubuntu**, **Debian** and **CentOS** systems.\n\n## Requirements\n\nNone.\n\n## Role Variables\n\nAvailable variables are listed below (located in `defaults/main.yml`):\n\n### Variables List:\n\n```yaml\ndocker_architecture_map:\n  amd64: amd64\n  x86_64: amd64\n  armv6l: armhfv6\n  armv7l: armhfv6\n  aarch64: arm64\n  32-bit: \"386\"\n  64-bit: amd64\ndocker_apps:\n  - docker-ce\n  - docker-ce-cli\n  - containerd.io\ndocker_apps_desired_state: present\ndocker_service_name: docker\ndocker_service_desired_state: restarted\ndocker_service_desired_boot_enabled: yes\ndocker_group: docker\ndocker_group_desired_state: present\ndocker_user: docker\ndocker_user_home: \"/home/{{ docker_user }}\"\ndocker_user_shell: /bin/bash\ndocker_user_desired_state: present\ndocker_repo_gpg_key: https://download.docker.com/linux/{{ ansible_distribution | lower }}/gpg\ndocker_nonroot_users:\n  - darkwizard242\n  - ubuntu\ndocker_add_nonroot_users: false\ndocker_centos_pre_reqs:\n  - device-mapper-persistent-data\n  - lvm2\ndocker_centos_pre_reqs_desired_state: present\ndocker_repo_centos: https://download.docker.com/linux/centos/7/$basearch/stable\ndocker_repo_centos_gpg_key: https://download.docker.com/linux/centos/gpg\ndocker_repo_centos_name: docker-ce-stable\ndocker_repo_centos_description: Docker CE Stable - $basearch\ndocker_repo_centos_gpgcheck: yes\ndocker_repo_centos_enabled: yes\ndocker_repo_centos_filename: docker-ce\ndocker_repo_centos_desired_state: present\ndocker_debian_pre_reqs:\n  - apt-transport-https\n  - ca-certificates\n  - curl\n  - gnupg\n  - lsb-release\ndocker_debian_pre_reqs_desired_state: present\ndocker_repo_debian: \"deb [arch={{ ansible_architecture }}] https://download.docker.com/linux/debian {{ ansible_lsb['codename'] }} stable\"\ndocker_repo_debian_filename: docker-ce\ndocker_repo_debian_desired_state: present\n```\n\n### Variables table:\n\nVariable                             | Description\n------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\ndocker_architecture_map              | Variable for system architecture types.\ndocker_apps                          | Name of docker application packages require to be installed i.e. `docker-ce, docker-ce-cli, containerd.io`\ndocker_apps_desired_state            | State of the docker_apps packages (i.e. `docker-ce, docker-ce-cli, containerd.io` packages). Whether to install, verify if available or to uninstall (i.e. ansible apt module values: `present`, `latest`, or `absent`)\ndocker_service_name                  | Default service name for Docker.\ndocker_service_desired_state         | Desired state for Docker service.\ndocker_service_desired_boot_enabled  | Desired enabled/disabled state for Docker service.\ndocker_service_desired_boot_enabled  | Desired enabled/disabled state for Docker service.\ndocker_group                         | Name of the group that the docker owner will belong to. Any user that requires using docker app requires to be a member in the `docker` group.\ndocker_group_desired_state           | `present` indicates creating the group if it doesn't exist. Alternative is `absent`.\ndocker_user                          | Name of the user that the docker will be owned by.\ndocker_user_home                     | Home directory for docker user.\ndocker_user_shell                    | Shell for `docker_user`.\ndocker_user_desired_state            | `present` indicates creating the user if it doesn't exist. Alternative is `absent`.\ndocker_nonroot_users                 | List of users to add to the `docker` group\ndocker_add_nonroot_users             | Boolean variable. Values can either be `true` or `false`. Setting to `true` will run the task that will add additionally provided users in the variable `docker_nonroot_users` to the `docker` group. If set to `false`, the specific task that adds user to `docker` group will be skipped. Defaults to `false`\ndocker_repo_gpg_key                  | GPG repo for docker repository\ndocker_centos_pre_reqs               | Docker recommends the installation of both these packages on the EL/CentOS docker host system and as such, they are considered pre-requisites.\ndocker_centos_pre_reqs_desired_state | Desired state for Docker pre-requisite apps on EL/CentOS systems.\ndocker_repo_centos                   | Repository `baseurl` for Docker on EL/CentOS based systems.\ndocker_repo_centos_name              | Repository name for Docker on EL/CentOS based systems.\ndocker_repo_centos_description       | Description to be added in EL/CentOS based repository file for Docker.\ndocker_repo_centos_gpgcheck          | Boolean for whether to perform gpg check against Docker on EL/CentOS based systems.\ndocker_repo_centos_enabled           | Boolean to set so that Docker repository is enabled on EL/CentOS based systems.\ndocker_repo_centos_filename          | Name of the repository file that will be stored at `/yum/sources.list.d/docker-ce.repo` on EL/CentOS based systems.\ndocker_repo_centos_desired_state     | `present` indicates creating the repository file if it doesn't exist on EL/CentOS based systems. Alternative is `absent` (not recommended as it will prevent from installation of **docker** packages).\ndocker_debian_pre_reqs_desired_state | Desired state for Docker pre-requisite apps on Debian family systems.\ndocker_repo_debian                   | Docker repo URL for Debain systems. Utilized facts such as `ansible_architecture`.\ndocker_repo_debain_filename          | Name of the repository file that will be stored at `/etc/apt/sources.list.d/` on Debian based systems.\ndocker_repo_debian_desired_state     | `present` indicates creating the repository file if it doesn't exist on Debian based systems. Alternative is `absent` (not recommended as it will prevent from installation of **docker** packages).\n\n## Dependencies\n\nNone\n\n## Example Playbook\n\nFor default behaviour of role (i.e. installation of **docker** package) in ansible playbooks.\n\n```yaml\n- hosts: servers\n  roles:\n    - darkwizard242.docker\n```\n\nFor customizing behavior of role (i.e. adding a list of users to be added to docker group - example shown below is adding `ubuntu` \u0026\u0026 `darkwizard` to `docker` group) in ansible playbooks.\n\n```yaml\n- hosts: servers\n  roles:\n    - darkwizard242.docker\n  vars:\n    docker_add_nonroot_users: true\n    docker_nonroot_users:\n      - darkwizard242\n      - ubuntu\n```\n\nFor customizing behavior of role (i.e. skipping the task that adds a list of users to be added to `docker` group) in ansible playbooks.\n\n```yaml\n- hosts: servers\n  roles:\n    - darkwizard242.docker\n  vars:\n    docker_add_nonroot_users: false\n```\n\nFor customizing behavior of role (i.e. un-installation of **docker-ce, docker-ce-cli, containerd.io** packages) in ansible playbooks.\n\n```yaml\n- hosts: servers\n  roles:\n    - darkwizard242.docker\n  vars:\n    docker_apps_desired_state: absent\n```\n\n## License\n\n[MIT](https://github.com/darkwizard242/ansible-role-docker/blob/master/LICENSE)\n\n## Author Information\n\nThis role was created by [Ali Muhammad](https://www.alimuhammad.dev/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdarkwizard242%2Fansible-role-docker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdarkwizard242%2Fansible-role-docker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdarkwizard242%2Fansible-role-docker/lists"}