{"id":18781542,"url":"https://github.com/devture/com.devture.ansible.role.traefik","last_synced_at":"2025-04-13T12:32:43.649Z","repository":{"id":61742166,"uuid":"554718838","full_name":"devture/com.devture.ansible.role.traefik","owner":"devture","description":"An Ansible role which installs [Traefik](https://traefik.io/) to run as a Docker container wrapped in a systemd service","archived":true,"fork":false,"pushed_at":"2024-09-27T06:47:59.000Z","size":75,"stargazers_count":6,"open_issues_count":0,"forks_count":8,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-05T14:22:04.020Z","etag":null,"topics":["ansible-role","docker","traefik"],"latest_commit_sha":null,"homepage":"","language":"Jinja","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/devture.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":"2022-10-20T09:20:07.000Z","updated_at":"2024-09-27T06:50:45.000Z","dependencies_parsed_at":"2024-06-04T09:39:25.977Z","dependency_job_id":"391f7da1-becb-48e3-a93a-b0cc9a4e540b","html_url":"https://github.com/devture/com.devture.ansible.role.traefik","commit_stats":null,"previous_names":[],"tags_count":37,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devture%2Fcom.devture.ansible.role.traefik","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devture%2Fcom.devture.ansible.role.traefik/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devture%2Fcom.devture.ansible.role.traefik/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devture%2Fcom.devture.ansible.role.traefik/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devture","download_url":"https://codeload.github.com/devture/com.devture.ansible.role.traefik/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248714726,"owners_count":21149954,"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-role","docker","traefik"],"created_at":"2024-11-07T20:32:18.760Z","updated_at":"2025-04-13T12:32:43.301Z","avatar_url":"https://github.com/devture.png","language":"Jinja","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Traefik reverse-proxy Ansible role\n\n⚠️ **WARNING**: this role is now maintained in [mother-of-all-self-hosting/ansible-role-traefik](https://github.com/mother-of-all-self-hosting/ansible-role-traefik).\n\nThis is an [Ansible](https://www.ansible.com/) role which installs [Traefik](https://traefik.io/) to run as a [Docker](https://www.docker.com/) container wrapped in a systemd service.\n\nThis role *implicitly* depends on the [`com.devture.ansible.role.systemd_docker_base` role](https://github.com/devture/com.devture.ansible.role.systemd_docker_base).\n\n## Usage\n\nExample playbook:\n\n```yaml\n- hosts: servers\n  roles:\n    - role: galaxy/com.devture.ansible.role.systemd_docker_base\n\n    - role: galaxy/com.devture.ansible.role.traefik\n\n    - role: another_role\n```\n\nExample playbook configuration (`group_vars/servers` or other):\n\n```yaml\ndevture_traefik_container_network: \"{{ my_container_network }}\"\n\ndevture_traefik_uid: \"{{ my_uid }}\"\ndevture_traefik_gid: \"{{ my_gid }}\"\n```\n\n## Security hardening\n\nTo avoid the Traefik container from mounting and using the Docker UNIX socket (`/var/run/docker.sock`) directly, you can also make it talk to the Docker API via TCP using [Tecnativa/docker-socket-proxy](https://github.com/Tecnativa/docker-socket-proxy). The Traefik container can then run with reduced privileges (non-`root` user, [dropped capabilities](https://docs.docker.com/engine/reference/run/#runtime-privilege-and-linux-capabilities), etc).\n\nTo get this socket proxy installed, you can use the [`com.devture.ansible.role.container_socket_proxy` role](https://github.com/devture/com.devture.ansible.role.container_socket_proxy).\n\nHere's some example configuration (e.g. `group_vars/servers`) which *optionally* wires them together:\n\n```yaml\n#\n# Container Socket Proxy role configuration\n#\ndevture_container_socket_proxy_enabled: true\n\ndevture_container_socket_proxy_uid: \"{{ my_uid }}\"\ndevture_container_socket_proxy_gid: \"{{ my_gid }}\"\n\n# Traefik requires read access to the containers APIs to do its job\ndevture_container_socket_proxy_api_containers_enabled: true\n\n#\n# Traefik role configuration\n#\n\n# Base Traefik configuration here (see above).\n\ndevture_traefik_config_providers_docker_endpoint: \"{{ devture_container_socket_proxy_endpoint if devture_container_socket_proxy_enabled else 'unix:///var/run/docker.sock' }}\"\n\ndevture_traefik_container_additional_networks: |\n  {{\n    ([devture_container_socket_proxy_container_network] if devture_container_socket_proxy_enabled else [])\n  }}\n\ndevture_traefik_systemd_required_services_list: |\n  {{\n    (['docker.service'])\n    +\n    ([devture_container_socket_proxy_identifier + '.service'] if devture_container_socket_proxy_enabled else [])\n  }}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevture%2Fcom.devture.ansible.role.traefik","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevture%2Fcom.devture.ansible.role.traefik","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevture%2Fcom.devture.ansible.role.traefik/lists"}