diff options
author | Pedro Alvarez <pedro.alvarez@codethink.co.uk> | 2014-07-14 15:10:09 +0000 |
---|---|---|
committer | Pedro Alvarez <pedro.alvarez@codethink.co.uk> | 2014-07-14 15:10:09 +0000 |
commit | 160fd3f2f1d372751836c0073bdc944df1cfbb91 (patch) | |
tree | d6b46ce1ec600400883e53b82e12b390fa73f262 /ansible/roles/trove-setup/tasks/lighttpd.yml | |
parent | eafba37e2bfc3897e3e7f65f2ce087fbee358f43 (diff) | |
parent | d349c9a35d3d53ebfc9f26df373e84fa5986a1b6 (diff) | |
download | trove-setup-160fd3f2f1d372751836c0073bdc944df1cfbb91.tar.gz |
Merge branch 'baserock/pedroalvarez/trove-ansible3'
Reviewed-by: Richard Maw
Reviewed-by: Lars Wirzenius
Diffstat (limited to 'ansible/roles/trove-setup/tasks/lighttpd.yml')
-rw-r--r-- | ansible/roles/trove-setup/tasks/lighttpd.yml | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/ansible/roles/trove-setup/tasks/lighttpd.yml b/ansible/roles/trove-setup/tasks/lighttpd.yml new file mode 100644 index 0000000..7a530e7 --- /dev/null +++ b/ansible/roles/trove-setup/tasks/lighttpd.yml @@ -0,0 +1,42 @@ +--- +- name: Create /etc/lighttpd/certs directory + file: path=/etc/lighttpd/certs state=directory +- name: Create certificates for lighttpd in /etc/lighttpd/certs/lighttpd.pem + shell: | + yes '' | openssl req -new -x509 \ + -keyout /etc/lighttpd/certs/lighttpd.pem \ + -out /etc/lighttpd/certs/lighttpd.pem -days 36525 -nodes + creates=/etc/lighttpd/certs/lighttpd.pem + register: lighttpd_certs +- name: Create /var/run/lighttpd for cache user + file: path=/var/run/lighttpd state=directory owner=cache group=cache + register: lighttpd_folder + +# Now that the lighttpd certificates and the /var/run/lighttpd exist, we can +# enable the lighttpd-git service +- name: Enable lighttpd-git service + service: name=lighttpd-git.service enabled=yes + register: 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 + +- name: Enable the lighttpd-lorry-controller-webapp service + service: name=lighttpd-lorry-controller-webapp.service enabled=yes + register: lighttpd_lorry_controller_webapp_service +- name: Restart the lighttpd-lorry-controller-webapp service + service: name=lighttpd-lorry-controller-webapp state=restarted + when: lighttpd_lorry_controller_webapp_service|changed |