From 25262fa0e193226518db7f67583a1a295dc7f716 Mon Sep 17 00:00:00 2001 From: gusttt Date: Tue, 17 Sep 2019 22:16:31 +0200 Subject: [PATCH] Disable docker network tasks in check mode to allow running the playbook in check mode (--check --diff) --- roles/matrix-base/tasks/setup_matrix_base.yml | 3 ++- roles/matrix-coturn/tasks/setup_coturn.yml | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/roles/matrix-base/tasks/setup_matrix_base.yml b/roles/matrix-base/tasks/setup_matrix_base.yml index 85a05dcf3..b4aa92b9a 100644 --- a/roles/matrix-base/tasks/setup_matrix_base.yml +++ b/roles/matrix-base/tasks/setup_matrix_base.yml @@ -42,11 +42,12 @@ cmd: "docker network ls -q --filter='name=^{{ matrix_docker_network }}$'" register: result_check_docker_network changed_when: false + check_mode: no - name: Create Matrix network in Docker shell: cmd: "docker network create --driver=bridge {{ matrix_docker_network }}" - when: "result_check_docker_network.stdout == ''" + when: "result_check_docker_network.stdout == '' and not ansible_check_mode" - name: Ensure matrix-remove-all script created template: diff --git a/roles/matrix-coturn/tasks/setup_coturn.yml b/roles/matrix-coturn/tasks/setup_coturn.yml index 548d3c7a5..eaa29aa58 100644 --- a/roles/matrix-coturn/tasks/setup_coturn.yml +++ b/roles/matrix-coturn/tasks/setup_coturn.yml @@ -38,11 +38,12 @@ register: matrix_coturn_result_docker_network changed_when: false when: matrix_coturn_enabled|bool + check_mode: no - name: Create Coturn network in Docker shell: cmd: "docker network create --driver=bridge {{ matrix_coturn_docker_network }}" - when: "matrix_coturn_enabled|bool and matrix_coturn_result_docker_network.stdout == ''" + when: "matrix_coturn_enabled|bool and matrix_coturn_result_docker_network.stdout == '' and not ansible_check_mode" - name: Ensure matrix-coturn.service installed template: