From 16af48fbf3fb551b6abb46b6259ae3b058d0cbe9 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 19 Jan 2024 08:55:25 +0100 Subject: [PATCH] test playbook docker --- roles/docker/tasks/main.yml | 7 +++++-- roles/nxc-traefik/tasks/main.yml | 7 ++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/roles/docker/tasks/main.yml b/roles/docker/tasks/main.yml index 0115fc4..638f6ee 100644 --- a/roles/docker/tasks/main.yml +++ b/roles/docker/tasks/main.yml @@ -5,9 +5,12 @@ dest: /usr/local/bin - name: on verifie si docker est installe - command: which docker + stat: + path: /usr/bin/docker +# command: which docker register: docker_present - name: Execution du script getdocker si docker n'est pas deja installe shell: bash /usr/local/bin/getdocker.sh - when: docker_present.stdout.find('/usr/bin/docker') == -1 + #when: docker_present.stdout.find('/usr/bin/docker') == -1 + when: not docker_present.stat.exists diff --git a/roles/nxc-traefik/tasks/main.yml b/roles/nxc-traefik/tasks/main.yml index c417248..485c4ac 100644 --- a/roles/nxc-traefik/tasks/main.yml +++ b/roles/nxc-traefik/tasks/main.yml @@ -21,11 +21,11 @@ - name: Copie de dynamic.yml copy: - src: dynamic.yml + src: dynamic.yml dest: /root/nxc/config - name: Copie de docker-compose.yml - copy: + copy: src: docker-compose.yml dest: /root/nxc @@ -75,7 +75,8 @@ - name: création du réseau proxy command: docker network create proxy - when: net_proxy.stdout.find('proxy') == -1 +# when: net_proxy.stdout.find('proxy') == -1 + when: "'proxy' not in net_proxy.stdout" #- name: Démarrage du docker-compose... #command: /bin/bash docker-compose up -d