summaryrefslogtreecommitdiff
path: root/ansible
diff options
context:
space:
mode:
authorPedro Alvarez <pedro.alvarez@codethink.co.uk>2015-11-09 16:51:51 +0000
committerRichard Ipsum <richard.ipsum@codethink.co.uk>2015-11-19 12:02:34 +0000
commit24ae954cd68026515536a01dad5e92ed7f91565f (patch)
tree4f8670ec93eeb2ad95d5e4d5db6c62964214d402 /ansible
parente2250e8bfe649d3372f7782719f1869b61d2077b (diff)
downloadtrove-setup-24ae954cd68026515536a01dad5e92ed7f91565f.tar.gz
lighttpd: Format Ansible code
Change-Id: I7c5561aeace4dc7ebdf4b86b3def8d8e64b9c217
Diffstat (limited to 'ansible')
-rw-r--r--ansible/roles/trove-setup/tasks/lighttpd.yml37
1 files changed, 28 insertions, 9 deletions
diff --git a/ansible/roles/trove-setup/tasks/lighttpd.yml b/ansible/roles/trove-setup/tasks/lighttpd.yml
index d460c51..710203c 100644
--- a/ansible/roles/trove-setup/tasks/lighttpd.yml
+++ b/ansible/roles/trove-setup/tasks/lighttpd.yml
@@ -1,12 +1,15 @@
---
- name: Create /etc/lighttpd/certs directory
- file: path=/etc/lighttpd/certs state=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
+ args:
+ creates: /etc/lighttpd/certs/lighttpd.pem
when: TROVE_SSL_PEMFILE is not defined
- name: Copy pemfile certificate for lighttpd if provided
@@ -24,7 +27,11 @@
when: TROVE_SSL_CA_FILE is defined
- name: Create /var/run/lighttpd for cache user
- file: path=/var/run/lighttpd state=directory owner=cache group=cache
+ file:
+ path: /var/run/lighttpd
+ state: directory
+ owner: cache
+ group: cache
- name: Create git-httpd.conf from template
template:
@@ -34,12 +41,16 @@
# Now that the lighttpd certificates, configuration files and /var/run/lighttpd
# exist, we can enable the lighttpd-git service
- name: Enable lighttpd-git service
- service: name=lighttpd-git.service enabled=yes
+ 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
+ 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
@@ -47,15 +58,23 @@
# - lighttpd-morph-cache
# - lighttpd-lorry-controller-webapp
- name: Enable lighttpd-morph-cache service
- service: name=lighttpd-morph-cache.service enabled=yes
+ 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
+ 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
+ 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
+ service:
+ name: lighttpd-lorry-controller-webapp
+ state: restarted
when: lighttpd_lorry_controller_webapp_service|changed