diff options
author | Pedro Alvarez <pedro.alvarez@codethink.co.uk> | 2015-11-10 12:40:28 +0000 |
---|---|---|
committer | Pedro Alvarez <pedro.alvarez@codethink.co.uk> | 2015-11-10 15:06:05 +0000 |
commit | 2704f6ae61931a47405e4aeee7a29c9b731d273d (patch) | |
tree | 4db3bf595f5c8e2227e588b8aa6bde9227e57354 /ansible/roles/trove-setup | |
parent | 62f71cec85da1f18c9a2fc3927277c6093bcedd3 (diff) | |
download | trove-setup-baserock/pedroalvarez/trove-ssl.tar.gz |
lighttpd: Create handler for restarting servicesbaserock/pedroalvarez/trove-ssl
Change-Id: I300f9f30e296ff4b70e17e1d040372deee0fd691
Diffstat (limited to 'ansible/roles/trove-setup')
-rw-r--r-- | ansible/roles/trove-setup/handlers/main.yml | 9 | ||||
-rw-r--r-- | ansible/roles/trove-setup/tasks/lighttpd.yml | 29 |
2 files changed, 19 insertions, 19 deletions
diff --git a/ansible/roles/trove-setup/handlers/main.yml b/ansible/roles/trove-setup/handlers/main.yml new file mode 100644 index 0000000..758efcc --- /dev/null +++ b/ansible/roles/trove-setup/handlers/main.yml @@ -0,0 +1,9 @@ +- name: Restart lighttpd-git service + service: + name: lighttpd-git + state: restarted + +- name: Restart lighttpd-morph-cache service + service: + name: lighttpd-morph-cache + state: restarted diff --git a/ansible/roles/trove-setup/tasks/lighttpd.yml b/ansible/roles/trove-setup/tasks/lighttpd.yml index 48b5773..091ed11 100644 --- a/ansible/roles/trove-setup/tasks/lighttpd.yml +++ b/ansible/roles/trove-setup/tasks/lighttpd.yml @@ -11,6 +11,7 @@ args: creates: /etc/lighttpd/certs/lighttpd.pem when: TROVE_SSL_PEMFILE is not defined + notify: Restart lighttpd-git service - name: Copy certifiacte for lighttpd if provided copy: @@ -18,6 +19,7 @@ dest: /etc/lighttpd/certs/lighttpd.pem mode: 0400 when: TROVE_SSL_PEMFILE is defined + notify: Restart lighttpd-git service - name: Copy certifiacte for lighttpd if provided copy: @@ -25,6 +27,7 @@ dest: /etc/lighttpd/certs/ca-certs.pem mode: 0400 when: TROVE_SSL_CA_FILE is defined + notify: Restart lighttpd-git service - name: Create /var/run/lighttpd for cache user file: @@ -37,37 +40,25 @@ template: src: lighttpd/git-httpd.conf dest: /etc/lighttpd/git-httpd.conf + notify: Restart lighttpd-git service # Now that the lighttpd certificates, configuration files and /var/run/lighttpd -# exist, we can enable the lighttpd-git service +# exist, we can enable and start lighttpd services - name: Enable lighttpd-git service service: name: lighttpd-git.service enabled: yes - register: lighttpd_git_service + notify: Restart lighttpd-git service -# Now we can start the service without rebooting the system -- name: Restart the lighttpd-git service - service: - name: lighttpd-git - state: restarted - when: lighttpd_git_service|changed - -# Once the service lighttpd-git is running it's possible to do the same -# with the following services: -# - lighttpd-morph-cache -# - lighttpd-lorry-controller-webapp - name: Enable lighttpd-morph-cache service service: name: lighttpd-morph-cache.service enabled: yes - register: lighttpd_morph_cache_service -- name: Restart the lighttpd-morph-cache service - service: - name: lighttpd-morph-cache - state: restarted - when: lighttpd_morph_cache_service|changed + notify: Restart lighttpd-morph-cache service +# The service lighttpd-lorry-controller-webapp has to start here and +# can't be done in a handler, given that the lorry-controller-minion +# service will fail to start if this one is not running. - name: Enable the lighttpd-lorry-controller-webapp service service: name: lighttpd-lorry-controller-webapp.service |