mirror of
https://github.com/ChristianLempa/boilerplates.git
synced 2024-12-11 09:43:08 +01:00
7983a7c85f
If `become_user` is being defined on a task level, also `become` should be set on that very task. As there aren't any other tasks, the `become` on the top-level becomes obsolete.
19 lines
469 B
YAML
19 lines
469 B
YAML
---
|
|
- name: Deploy traefik v2.5
|
|
hosts: "{{ my_hosts | d([]) }}"
|
|
|
|
tasks:
|
|
- name: Deploy traefik
|
|
community.docker.docker_container:
|
|
name: traefik
|
|
image: "traefik:v2.5"
|
|
ports:
|
|
- "80:80"
|
|
- "443:443"
|
|
volumes:
|
|
- /var/run/docker.sock:/var/run/docker.sock
|
|
- /etc/traefik:/etc/traefik
|
|
restart_policy: unless-stopped
|
|
become: true
|
|
become_user: "{{ lookup('env', 'USER') }}"
|