Browse Source

Add basic support for php5-fpm

Emmanuel Bouthenot 11 years ago
parent
commit
16490198b6

+ 1 - 0
group_vars/webserver

@@ -5,5 +5,6 @@
 with_apache2: False
 with_apache2_modphp5: False
 with_nginx: False
+with_fpm: False
 
 # vim: ft=yaml

+ 5 - 0
roles/webserver/handlers/fpm.yml

@@ -0,0 +1,5 @@
+- name: Reload php5-fpm
+  action: service name=php5-fpm state=reloaded
+
+- name: Restart php5-fpm
+  action: service name=php5-fpm state=restarted

+ 1 - 0
roles/webserver/handlers/main.yml

@@ -1,2 +1,3 @@
 - include: apache2.yml
 - include: nginx.yml
+- include: fpm.yml

+ 7 - 0
roles/webserver/tasks/fpm.yml

@@ -0,0 +1,7 @@
+- name: Install php5-fpm package
+  action: ${ansible_pkg_mgr} pkg=php5-fpm state=installed update_cache=yes
+  when_boolean: ${with_fpm}
+
+- name: Ensure php5-fpm is running
+  action: service name=php5-fpm state=started
+  when_boolean: ${with_fpm}

+ 1 - 0
roles/webserver/tasks/main.yml

@@ -1,2 +1,3 @@
 - include: apache2.yml
 - include: nginx.yml
+- include: fpm.yml