Explorar el Código

fix: fix use of `become`/`become_user`

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.
Christoph Schug hace 2 años
padre
commit
7983a7c85f
Se han modificado 1 ficheros con 2 adiciones y 2 borrados
  1. 2 2
      ansible/deployment/traefik/deploy-traefik.yaml

+ 2 - 2
ansible/deployment/traefik/deploy-traefik.yaml

@@ -1,11 +1,9 @@
 ---
 - name: Deploy traefik v2.5
   hosts: "{{ my_hosts | d([]) }}"
-  become: true
 
   tasks:
     - name: Deploy traefik
-      become_user: "{{ lookup('env', 'USER') }}"
       community.docker.docker_container:
         name: traefik
         image: "traefik:v2.5"
@@ -16,3 +14,5 @@
           - /var/run/docker.sock:/var/run/docker.sock
           - /etc/traefik:/etc/traefik
         restart_policy: unless-stopped
+      become: true
+      become_user: "{{ lookup('env', 'USER') }}"