From 93b54f44913675a4b41604ff2fab04437c4be180 Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Sat, 4 Aug 2018 22:58:11 +0200 Subject: [PATCH] fix service handling --- handlers/main.yml | 8 ++++++++ tasks/tls.yml | 2 ++ 2 files changed, 10 insertions(+) create mode 100644 handlers/main.yml diff --git a/handlers/main.yml b/handlers/main.yml new file mode 100644 index 0000000..cd32b49 --- /dev/null +++ b/handlers/main.yml @@ -0,0 +1,8 @@ +--- +- name: Restart apache service + service: + name: apache2 + state: restarted + enabled: yes + listen: __ucs_apache_restart + become: True diff --git a/tasks/tls.yml b/tasks/tls.yml index ef6b7d4..61c19bf 100644 --- a/tasks/tls.yml +++ b/tasks/tls.yml @@ -19,6 +19,7 @@ - { src: "{{ ucs_tls_cert_path }}", dest: "{{ ucs_tls_key_dir }}/ucs.pem", mode: '0750' } loop_control: label: "{{ item.dest }}" + notify: __ucr_apache_restart - name: Set necessary ucr vars ucr: @@ -27,5 +28,6 @@ with_items: - { path: apache2/ssl/certificate, value: "{{ ucs_tls_certs_dir }}/ucs.pem" } - { path: apache2/ssl/key, value: "{{ ucs_tls_key_dir }}/ucs.pem" } + notify: __ucr_apache_restart become: True become_user: root