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:21:46 +0000 |
commit | 55a302943d22551f98dd1f058b587484a0e3a84a (patch) | |
tree | 4db3bf595f5c8e2227e588b8aa6bde9227e57354 /ansible/roles | |
parent | 0b13592d46ef20e8e5a1b2cf956fd2ae8ae07541 (diff) | |
download | trove-setup-55a302943d22551f98dd1f058b587484a0e3a84a.tar.gz |
lighttpd: Create handler for restarting servicesbaserock/pedroalvarez/trove-ssl3
Change-Id: I193216280797e5453ab1606d6a8f83e27bd0a28e
Diffstat (limited to 'ansible/roles')
-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 |