{"id":20031368,"url":"https://github.com/goldstrike77/ansible-role-linux-docker","last_synced_at":"2026-05-10T02:18:00.384Z","repository":{"id":130073062,"uuid":"152247548","full_name":"goldstrike77/ansible-role-linux-docker","owner":"goldstrike77","description":"Ansible role installs and configure docker on Linux system.","archived":false,"fork":false,"pushed_at":"2022-08-20T01:27:32.000Z","size":74,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"v0.1","last_synced_at":"2025-03-02T05:25:44.634Z","etag":null,"topics":["ansible","ansible-role","docker"],"latest_commit_sha":null,"homepage":"","language":"Jinja","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/goldstrike77.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":"2018-10-09T12:30:56.000Z","updated_at":"2022-07-13T11:03:05.000Z","dependencies_parsed_at":"2023-04-26T22:12:03.931Z","dependency_job_id":null,"html_url":"https://github.com/goldstrike77/ansible-role-linux-docker","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/goldstrike77/ansible-role-linux-docker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goldstrike77%2Fansible-role-linux-docker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goldstrike77%2Fansible-role-linux-docker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goldstrike77%2Fansible-role-linux-docker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goldstrike77%2Fansible-role-linux-docker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/goldstrike77","download_url":"https://codeload.github.com/goldstrike77/ansible-role-linux-docker/tar.gz/refs/heads/v0.1","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goldstrike77%2Fansible-role-linux-docker/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260759832,"owners_count":23058493,"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-role","docker"],"created_at":"2024-11-13T09:32:40.160Z","updated_at":"2026-05-10T02:18:00.330Z","avatar_url":"https://github.com/goldstrike77.png","language":"Jinja","funding_links":[],"categories":[],"sub_categories":[],"readme":"![](https://img.shields.io/badge/Ansible-docker-green.svg?logo=angular\u0026style=for-the-badge)\n\n\u003e__Please note that the original design goal of this role was more concerned with the initial installation and bootstrapping environment, which currently does not involve performing continuous maintenance, and therefore are only suitable for testing and development purposes,  should not be used in production environments.__\n\n\u003e__请注意，此角色的最初设计目标更关注初始安装和引导环境，目前不涉及执行连续维护，因此仅适用于测试和开发目的，不应在生产环境中使用。__\n___\n\n\u003cp\u003e\u003cimg src=\"https://raw.githubusercontent.com/goldstrike77/goldstrike77.github.io/master/img/logo/logo_docker.png\" align=\"right\" /\u003e\u003c/p\u003e\n\n__Table of Contents__\n\n- [Overview](#overview)\n- [Requirements](#requirements)\n  * [Operating systems](#operating-systems)\n  * [Docker Versions](#docker-versions)\n- [ Role variables](#Role-variables)\n  * [Main Configuration](#Main-parameters)\n  * [Other Configuration](#Other-parameters)\n- [Dependencies](#dependencies)\n- [Example Playbook](#example-playbook)\n  * [Hosts inventory file](#Hosts-inventory-file)\n  * [Vars in role configuration](#vars-in-role-configuration)\n  * [Combination of group vars and playbook](#combination-of-group-vars-and-playbook)\n- [License](#license)\n- [Author Information](#author-information)\n- [Donations](#Donations)\n\n## Overview\nDocker is a set of platform as a service product that uses OS-level virtualization to deliver software in packages called containers. Containers are isolated from one another and bundle their own software, libraries and configuration files, they can communicate with each other through well-defined channels. Docker enables developers to package applications into containers-standardized executable components that combine application source code with all the operating system (OS) libraries and dependencies required to run the code in any environment. While developers can create containers without Docker, Docker makes it easier, simpler, and safer to build, deploy, and manage containers. It’s essentially a toolkit that enables developers to build, deploy, run, update, and stop containers using simple commands and work-saving automation.\n\n## Requirements\n### Operating systems\nThis Ansible role installs Docker on the Linux operating system, including establishing a filesystem structure and server configuration with some common operational features, Will works on the following operating systems:\n\n  * CentOS 7\n  * Rocky 8\n\n### docker versions\n\nThe following list of supported the docker releases:\n\n* Docker 18.0x.x+\n\n## Role variables\n### Main parameters #\nThere are some variables in defaults/main.yml which can (Or needs to) be overridden:\n##### General parameters\n* `docker_edition`: Specify the Docker edition.\n* `docker_version`: Specify the Docker version.\n* `docker_channel`: Define Docker distribution.\n* `docker_native_cgroupdriver`: Specifies the management of the container's cgroups, cgroupfs or systemd.\n* `docker_path`: Specify the Docker data folder.\n* `docker_bip`: Specify network bridge IP.\n* `docker_registry_mirrors`: Registry mirrors.\n* `docker_proxy_server`: Proxy server.\n* `docker_dns`: DNS server.\n* `docker_insecure_registries`: Configures Docker to entirely disregard security for registry.\n\n##### Syslog parameters\n* `syslog`: A boolean value,  Enable or Disable send console and access log to remote Syslog server.\n* `syslog_port`: Syslog server port.\n* `syslog_protocol`: Syslog server protocol.\n* `syslog_server`: List of syslog server list.\n\n##### Docker System Variables\n* `docker_arg.max_concurrent_downloads`: Set the max concurrent downloads for each pull.\n* `docker_arg.max_concurrent_uploads`: Set the max concurrent uploads for each push.\n* `docker_arg.icc`: Enable or disable inter-container communication.\n* `docker_arg.live_restore`: Live restore of docker when containers are still running.\n* `docker_arg.log_level`: Set the logging level.\n* `docker_arg.userland_proxy`: Userland proxy for loopback traffic.\n* `docker_arg.prune_interval`: Docker system prune job interval.\n* `docker_arg.prune_keep`: Only remove unused containers, images, and networks created before given time.\n* `docker_arg.storage_driver`: Storage driver to use.\n* `docker_arg.storage_opts`: Options per storage driver.\n\n##### Listen port\n* `docker_port`: Prometheus exporter port.\n\n##### Service Mesh\n* `environments`: Define the service environment.\n* `datacenter`: Define the DataCenter.\n* `domain`: Define the Domain.\n* `customer`: Define the customer name.\n* `tags`: Define the service custom label.\n* `exporter_is_install`: Whether to install prometheus exporter.\n* `consul_public_register`: Whether register a exporter service with public consul client.\n* `consul_public_exporter_token`: Public Consul client ACL token.\n* `consul_public_http_prot`: The consul Hypertext Transfer Protocol.\n* `consul_public_clients`: List of public consul clients.\n* `consul_public_http_port`: The consul HTTP API port.\n\n### Other parameters\nThere are some variables in vars/main.yml:\n\n## Dependencies\n- Ansible versions \u003e= 2.8\n- Python \u003e= 2.7.5\n\n## Example\n\n### Hosts inventory file\nSee tests/inventory for an example.\n\n    node01 ansible_host='192.168.1.10' docker_version='18.09.9'\n\n### Vars in role configuration\nIncluding an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too:\n\n```yaml\n- hosts: all\n  roles:\n     - role: ansible-role-linux-docker\n       docker_version: '18.09.9'\n```\n\n### Combination of group vars and playbook\nYou can also use the group_vars or the host_vars files for setting the variables needed for this role. File you should change: group_vars/all or host_vars/`group_name`.\n\n```yaml\ndocker_edition: 'ce'\ndocker_version: '18.09.9'\ndocker_channel: 'stable'\ndocker_native_cgroupdriver: 'systemd'\ndocker_path: '/data'\ndocker_bip: '172.17.0.1/16'\ndocker_registry_mirrors:\n  - 'http://dockerhub.azk8s.cn'\n  - 'http://reg-mirror.qiniu.com'\ndocker_dns:\n  - '223.5.5.5'\n  - '119.29.29.29'\n  - '8.8.8.8'\ndocker_insecure_registries:\n  - 'https://gcr.azk8s.cn'\n  - 'https://sharedprdpaasacr0.azurecr.cn'\nsyslog: false\nsyslog_port: '12201'\nsyslog_protocol: 'udp'\nsyslog_server:\n  - '127.0.0.1'\ndocker_arg:\n  max_concurrent_downloads: '3'\n  max_concurrent_uploads: '5'\n  icc: false\n  live_restore: true\n  log_level: 'info'\n  userland_proxy: false\n  prune_interval: 'monthly'\n  prune_keep: '720h'\n  storage_driver: 'overlay2'\n  storage_opts:\n    overlay2_override_kernel_check: true\ndocker_port:\n  docker_metrics: '9323'\n  containerd_metrics: '1338'\ndocker_compose:\n  install: true\n  version: '1.27.4'\n  path: '/usr/local/bin/docker-compose'\nenvironments: 'prd'\ndatacenter: 'dc01'\ndomain: 'local'\ncustomer: 'demo'\ntags:\n  subscription: 'default'\n  owner: 'nobody'\n  department: 'Infrastructure'\n  organization: 'The Company'\n  region: 'China'\nexporter_is_install: false\nconsul_public_register: false\nconsul_public_exporter_token: '00000000-0000-0000-0000-000000000000'\nconsul_public_http_prot: 'https'\nconsul_public_http_port: '8500'\nconsul_public_clients:\n  - '127.0.0.1'\n```\n\n## License\n![](https://img.shields.io/badge/MIT-purple.svg?style=for-the-badge)\n\n## Author Information\nPlease send your suggestions to make this role better.\n\n## Donations\nPlease donate to the following monero address.\n\n    46CHVMbb6wQV2PJYEbahb353SYGqXhcdFQVEWdCnHb6JaR5125h3kNQ6bcqLye5G7UF7qz6xL9qHLDSAY3baagfmLZABz75\n\u003cp\u003e\u003cimg src=\"https://raw.githubusercontent.com/goldstrike77/goldstrike77.github.io/master/img/xmr_address.png\" align=\"left\" /\u003e\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoldstrike77%2Fansible-role-linux-docker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgoldstrike77%2Fansible-role-linux-docker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoldstrike77%2Fansible-role-linux-docker/lists"}