{"id":17149835,"url":"https://github.com/tinyblargon/ansible-role-docker-deploy","last_synced_at":"2026-04-09T00:03:43.005Z","repository":{"id":163948836,"uuid":"639380667","full_name":"Tinyblargon/ansible-role-docker-deploy","owner":"Tinyblargon","description":"Ansible role to deploy a docker compose stack (file).","archived":false,"fork":false,"pushed_at":"2025-12-13T16:45:24.000Z","size":61,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-15T09:54:43.830Z","etag":null,"topics":["ansible","compose","debian","docker","docker-compose","ubuntu"],"latest_commit_sha":null,"homepage":"https://galaxy.ansible.com/ui/standalone/roles/tinyblargon/docker_deploy/","language":null,"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/Tinyblargon.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-05-11T11:03:57.000Z","updated_at":"2025-12-13T16:45:28.000Z","dependencies_parsed_at":"2025-12-13T19:07:47.963Z","dependency_job_id":null,"html_url":"https://github.com/Tinyblargon/ansible-role-docker-deploy","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/Tinyblargon/ansible-role-docker-deploy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tinyblargon%2Fansible-role-docker-deploy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tinyblargon%2Fansible-role-docker-deploy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tinyblargon%2Fansible-role-docker-deploy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tinyblargon%2Fansible-role-docker-deploy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Tinyblargon","download_url":"https://codeload.github.com/Tinyblargon/ansible-role-docker-deploy/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tinyblargon%2Fansible-role-docker-deploy/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29433304,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-14T02:20:56.896Z","status":"ssl_error","status_checked_at":"2026-02-14T02:11:29.478Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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","compose","debian","docker","docker-compose","ubuntu"],"created_at":"2024-10-14T21:34:13.848Z","updated_at":"2026-04-09T00:03:42.991Z","avatar_url":"https://github.com/Tinyblargon.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ansible Role: docker_deploy\n\n[![CI](https://github.com/Tinyblargon/ansible-role-docker-deploy/actions/workflows/ci.yml/badge.svg)](https://github.com/Tinyblargon/ansible-role-docker-deploy)\n\nAnsible role to deploy a docker compose stack (file).\n\n## Requirements\n\n### Local system\n\n- `rsync`\n\n### Deployed system\n\n- `docker-ce`\n- `docker-ce-cli`\n- `containerd.io`\n\n- `docker-compose-plugin` or `docker-compose`\n\n## Role Variables\n\n| **Variable Name**            | **Type**| **Default Value**        | **Description**\n|:-----------------------------|:-------:|:------------------------:|:---------------\n| docker_deploy_source:        | string  | \"docker-deploy\"          | The local directory containing the docker deployment and compose file. This directory is relative to the main playbooks directory.\n| docker_deploy_destination:   | string  | \"/opt/docker-deploy\"     | The destination folder the deployment should be cloned to.\n| docker_deploy_compose_file:  | string  | \"docker-compose.yml\"     | The name of the docker compose file to bring up.\n| docker_deploy_files:         | list map| []                       | A list of files that should be copied to the `docker_deploy_destination:`, more information about the map can be found in the following chapter [Docker_deploy_files](#docker_deploy_files).\n| docker_deploy_compatibility: | bool    | true                     | Enable the `--compatibility` flag when bringing up the compose file.\n| docker_deploy_remove_orphans:| bool    | true                     | Enable the `--remove-orphans` flag when bringing up the compose file.\n| docker_deploy_build:         | bool    | false                    | Enable the `--build` flag when any of the files in `docker_deploy_source:` or `docker_deploy_files:` have changed.\n| docker_deploy_recreate:      | bool    | false                    | Enable the `--force-recreate` flag when any of the files in `docker_deploy_source:` or `docker_deploy_files:` have changed.\n| docker_deploy_recreate_anon: | bool    | false                    | Enable the `--renew-anon-volumes` flag when any of the files in `docker_deploy_source:` or `docker_deploy_files:` have changed.\n| docker_deploy_compose_plugin:| bool    | true                     | Specify if the `docker compose` or `docker-compose` command should be used, `true` for `docker compose`, `false` for `docker-compose`.\n| docker_deploy_prune:         | list    | [\"image\"]                | Which prune commands should be executed after a change was made to the compose deployment. The value can be a combination of any of the following options `\"builder\"`, `\"container\"`, `\"image\"`, `\"network\"`, `\"system\"`, `\"volume\"`.\n| docker_deploy_state:         | string  | \"present\"                | When `\"present\"` the `docker_deploy_source:` wil be synced to the `docker_deploy_destination:` and the `docker_deploy_compose_file:` will be brought up. When `\"absent\"` the `docker_deploy_compose_file:` in `docker_deploy_destination:` will be brought down.\n| docker_deploy_rsync_opts:    | list    | ['--exclude=\"*.example\"']| Specify additional rsync options by passing in an array. All `dest` specified in`docker_deploy_files:` will automatically be excluded from rsync.\n| docker_deploy_show_warnings: | bool    | true                     | Show the docker compose warnings.\n| docker_deploy_absent_volume: | bool    | false                    | Only applies when `docker_deploy_state:` is `\"absent\"`. Enables the --volumes flag when bringing down the compose file, this will delete all volumes that are specified in the compose file.\n| docker_deploy_absent_remove: | bool    | false                    | Only applies when `docker_deploy_state:` is `\"absent\"`. when `true` the `docker_deploy_destination:` will be deleted.\n\n### Docker_deploy_files\n\n| **Variable Name**| **Type**| **Default Value**| **Description**\n|:-----------------|:-------:|:----------------:|:---------------\n| content:         | string  | \"\"               | When used instead of `src`, sets the contents of a file directly to the specified value. Works only when `dest` is a file. Creates the file if it does not exist.\n| dest:            | string  |                  | Remote path relative to the `docker_deploy_destination:` where the file should be copied to. If `src` is a directory, this must be a directory too. If `dest` is a non-existent path and if either dest ends with “/” or `src` is a directory, `dest` is created. If `dest` is a relative path, the starting directory is determined by the remote host. If `src` and `dest` are files, the parent directory of `dest` is not created and the task fails if it does not already exist. All `dest` will automatically be excluded from rsync.\n| group:           | string  | \"root\"           | Name of the group that should own the filesystem object, as would be fed to chown.\n| mode:            | string  |                  | The permissions of the destination file or directory. [Ansible documentation for further details](https://docs.ansible.com/ansible/latest/collections/ansible/builtin/copy_module.html#parameter-mode)\n| owner:           | string  | \"root\"           | Name of the user that should own the filesystem object, as would be fed to chown. Specifying a numeric username will be assumed to be a user ID and not a username. Avoid numeric usernames to avoid this confusion.\n| src:             | string  |                  | Local path to a file to copy to the remote server. This can be absolute or relative. If path is a directory, it is copied recursively. In this case, if path ends with “/”, only inside contents of that directory are copied to destination. Otherwise, if it does not end with “/”, the directory itself with all contents is copied. This behavior is similar to the rsync command line tool.\n| no_log:          | bool    | false            | If `true`, the content can not be logged.\n\nWhen `content:` and `src:` are both unspecified, an empty file is created at the destination.\n\n## Example Playbooks\n\n### Present\n\n```yaml\n- hosts: all\n  roles:\n    - role: tinyblargon.docker_deploy\n      vars:\n        docker_deploy_source: \"docker-deploy\"\n        docker_deploy_destination: \"/opt/docker-deploy\"\n        docker_deploy_compose_file: \"docker-compose.yml\"\n        docker_deploy_files:\n          - dest: \".env\"\n            src: \".env\"\n          - dest: \".secrets/password.txt\"\n            content: \"{{ lookup('file', 'password.txt') }}\"\n            owner: \"root\"\n            group: \"root\"\n            mode: \"0600\"\n            no_log: true\n        docker_deploy_compatibility: true\n        docker_deploy_remove_orphans: true\n        docker_deploy_recreate: true\n        docker_deploy_compose_plugin: false\n        docker_deploy_prune: [\"system\"]\n        docker_deploy_state: \"present\"\n```\n\n### Absent\n\n```yaml\n- hosts: all\n  roles:\n    - role: tinyblargon.docker_deploy\n      vars:\n        docker_deploy_destination: \"/opt/docker-deploy\"\n        docker_deploy_compose_file: \"docker-compose.yml\"\n        docker_deploy_compose_plugin: false\n        docker_deploy_prune: [\"system\", \"volume\"]\n        docker_deploy_state: \"absent\"\n        docker_deploy_absent_volume: true\n        docker_deploy_absent_remove: true\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftinyblargon%2Fansible-role-docker-deploy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftinyblargon%2Fansible-role-docker-deploy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftinyblargon%2Fansible-role-docker-deploy/lists"}