{"id":15080937,"url":"https://github.com/tibiiius/ansible-role-simple-compose","last_synced_at":"2025-06-20T22:34:42.607Z","repository":{"id":241412157,"uuid":"800201652","full_name":"TibiIius/ansible-role-simple-compose","owner":"TibiIius","description":"Super simple role to setup multiple Docker Compose projects with minimal overhead/copy\u0026paste.","archived":false,"fork":false,"pushed_at":"2025-05-27T08:15:38.000Z","size":143,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-27T09:25:36.700Z","etag":null,"topics":["ansible","ansible-role","docker","docker-compose"],"latest_commit_sha":null,"homepage":"https://galaxy.ansible.com/ui/standalone/roles/TibiIius/simple_compose/","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/TibiIius.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}},"created_at":"2024-05-13T22:25:23.000Z","updated_at":"2025-05-27T08:15:42.000Z","dependencies_parsed_at":null,"dependency_job_id":"461df5a7-6742-460e-b8d8-47399e1b1182","html_url":"https://github.com/TibiIius/ansible-role-simple-compose","commit_stats":{"total_commits":26,"total_committers":2,"mean_commits":13.0,"dds":"0.42307692307692313","last_synced_commit":"128b79978f6260f29713c8aa059ebed5f9090cda"},"previous_names":["tibiiius/ansible-role-simple-compose"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/TibiIius/ansible-role-simple-compose","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TibiIius%2Fansible-role-simple-compose","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TibiIius%2Fansible-role-simple-compose/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TibiIius%2Fansible-role-simple-compose/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TibiIius%2Fansible-role-simple-compose/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TibiIius","download_url":"https://codeload.github.com/TibiIius/ansible-role-simple-compose/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TibiIius%2Fansible-role-simple-compose/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261030623,"owners_count":23099984,"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","docker-compose"],"created_at":"2024-09-25T05:33:48.491Z","updated_at":"2025-06-20T22:34:37.587Z","avatar_url":"https://github.com/TibiIius.png","language":"Jinja","funding_links":[],"categories":[],"sub_categories":[],"readme":"Simple Compose\n=========\n\nA role meant to be kept as simple as possible whilst still trying to cover various different Docker Compose deployment variations. For now, assumes Docker Compose v2 (i.e. the plugin) is used. This will **NOT** work with Podman or similar container runtimes. The project makes heavy use of the built-in docker API provided by Ansible. It is mearly meant to reduce the amout of boilerplate code needed to deploy a Docker Compose project.\n\nPlanned\n------------\n\nThere are some things I have planned for this role, namely:\n\n- Add support for Compose v1 (even though it is deprecated, it's still used here and there, and I think it's worth supporting)\n- Add support for handlers (i.e. when a Compose project is updated, notify any given handler(s), can be useful for some Compose projects)\n- Add more configuration options (e.g. use variables for folder/file permissions, right now they're hardcoded to `0700` for the project dir and `0400` for the project files)\n\nIf you have any suggestions or want to contribute, feel free to open an issue or a pull request.\n\nRequirements\n------------\n\nYou will need a working Docker installation and use Docker Compose v2. Other than that, there is none.\n\nRole Variables\n--------------\n\nThis roles uses the following variables together with its default values:\n\n```yaml\nsimple_compose_username: \"{{ username }}\"\nsimple_compose_projects: []\n```\n\nSet `simple_compose_username` to the username of your Docker administering user. This can be any user that has access to the Docker socket (i.e. is in the `docker` group).\n\n`simple_compose_projects` is a list of dictionaries that define the projects you want to deploy. Each dictionary should have the following keys:\n- `name`: The name of the project. This will be used to differentiate the loop runs in Ansible's CLI output, and also dicates the location to the template files used for the role.\n- `directory`: The directory where the project is located. This should be an absolute path.\n- `files`: All files belonging to the compose project, like `docker-compose.yaml`, `.db.env`, `.web.env`, `.env`, etc. These **must** be template files, i.e. they have to end with `.j2`. However, the `.j2` ending of the `files` array has to be emitted.\n\nDependencies\n------------\n\nNone.\n\n(Optional): `geerlingguy.docker` if you want to easily install Docker using Ansible.\n\nExample Playbook\n----------------\n\nSimple playbook example:\n\n```yaml\n    - hosts: all\n      vars:\n        # Global variables shared between roles\n        docker_username: \"my_docker_user\"\n\n        # Varialbes specific to Geeklingguy's Docker role\n        docker_users:\n          - \"{{ docker_username }}\"\n\n        # Varialbes specific to the simple_compose role\n        simple_compose_projects:\n          - name: \"my_project\"\n            directory: \"/compose_projects/my_project\"\n            files:\n              - \"docker-compose.yaml\"\n              - \".my_project.env\"\n          - name: \"nextcloud\"\n            directory: \"/compose_projects/nextcloud\"\n            files:\n              - \"docker-compose.yaml\"\n              - \".nextcloud.env\"\n        simple_compose_username: \"{{ docker_username }}\"\n      \n      roles:\n        # This role is optional, but it makes it easier to install Docker\n        - role: geerlingguy.docker\n        # Actual magic happens here\n        - role: tibiiius.simple_compose\n```\n\nAfterward, make sure to create template files in the `template` directory. The role uses Ansible's built-in template module to render the files, so just stick to Ansible's default directory structure. The role will look for the files in `templates/{{ name }}/{{ file }}.j2` where `name` is the name of the project and `file` is the file name specified in the `files` array. It will do so for each project specified.\n\nLicense\n-------\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftibiiius%2Fansible-role-simple-compose","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftibiiius%2Fansible-role-simple-compose","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftibiiius%2Fansible-role-simple-compose/lists"}