From d114736014210f396031ebb532767b470007d73b Mon Sep 17 00:00:00 2001 From: Marcel Partap Date: Tue, 14 May 2019 11:46:07 +0200 Subject: [PATCH] Add a task to stop services (and remove containers) --- roles/matrix-common-after/tasks/main.yml | 6 +++++- roles/matrix-common-after/tasks/stop.yml | 7 +++++++ 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 roles/matrix-common-after/tasks/stop.yml diff --git a/roles/matrix-common-after/tasks/main.yml b/roles/matrix-common-after/tasks/main.yml index 3b5c5428..ea829fee 100644 --- a/roles/matrix-common-after/tasks/main.yml +++ b/roles/matrix-common-after/tasks/main.yml @@ -1,4 +1,8 @@ - import_tasks: "{{ role_path }}/tasks/start.yml" when: run_start tags: - - start \ No newline at end of file + - start + +- import_tasks: "{{ role_path }}/tasks/stop.yml" + tags: + - stop diff --git a/roles/matrix-common-after/tasks/stop.yml b/roles/matrix-common-after/tasks/stop.yml new file mode 100644 index 00000000..5ae0afbb --- /dev/null +++ b/roles/matrix-common-after/tasks/stop.yml @@ -0,0 +1,7 @@ +--- + +- name: Ensure Matrix services stopped + service: + name: "{{ item }}" + state: stopped + with_items: "{{ matrix_systemd_services_list }}"