From 6539f2a1561634feb431da172423c9cce434b366 Mon Sep 17 00:00:00 2001 From: Benjamin Fichtner Date: Wed, 29 Jul 2020 12:37:05 +0200 Subject: [PATCH] Make ansible check mode runs silent, for all tasks which can't be idempotent --- roles/matrix-common-after/tasks/start.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/roles/matrix-common-after/tasks/start.yml b/roles/matrix-common-after/tasks/start.yml index 069fb346..4bb59bfe 100644 --- a/roles/matrix-common-after/tasks/start.yml +++ b/roles/matrix-common-after/tasks/start.yml @@ -1,21 +1,23 @@ --- -- name: Ensure systemd reloaded +- name: Ensure systemd is reloaded service: daemon_reload: yes -- name: Ensure Matrix services stopped +- name: Ensure Matrix services are stopped service: name: "{{ item }}" state: stopped with_items: "{{ matrix_systemd_services_list }}" + when: not ansible_check_mode -- name: Ensure Matrix services started +- name: Ensure Matrix services are started service: name: "{{ item }}" enabled: yes state: started with_items: "{{ matrix_systemd_services_list }}" + when: not ansible_check_mode # If we check service state immediately, we may succeed, # because it takes some time for the service to attempt to start and actually fail.