Browse Source

Merge php and fpm tasks to avoid broken cycle dependencies

Emmanuel Bouthenot 11 years ago
parent
commit
331c25a95f
3 changed files with 33 additions and 33 deletions
  1. 0 31
      roles/webserver/tasks/fpm.yml
  2. 1 2
      roles/webserver/tasks/main.yml
  3. 32 0
      roles/webserver/tasks/php.yml

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

@@ -1,31 +0,0 @@
-- name: Install php5-fpm package
-  apt: pkg=php5-fpm state=installed update_cache=yes
-  when: with_fpm
-
-- name: Install php5-fpm init script config file
-  template: src=fpm/default.j2 dest=/etc/default/php5-fpm owner=root group=root mode=0644
-  notify:
-      - Restart php5-fpm
-  when: with_fpm
-
-- name: Install php5-fpm configuration file
-  template: src=fpm/php-fpm-custom.conf.j2 dest=/etc/php5/fpm/php-fpm-custom.conf owner=root group=root mode=0644
-  notify:
-      - Restart php5-fpm
-  when: with_fpm
-
-- name: Install nginx config files for php5-fpm (fpm servers pool)
-  template: src=fpm/nginx/fpm-pool.conf.j2 dest=/etc/nginx/conf.d/fpm-pool.conf owner=root group=root mode=0644
-  notify:
-      - Reload nginx
-  when: with_fpm and with_nginx
-
-- name: Install nginx config files for php5-fpm (fpm fastcgi config)
-  template: src=fpm/nginx/fastcgi_pass_fpm.j2 dest=/etc/nginx/fastcgi_pass_fpm owner=root group=root mode=0644
-  notify:
-      - Reload nginx
-  when: with_fpm and with_nginx
-
-- name: Ensure php5-fpm is running
-  service: name=php5-fpm state=started
-  when: with_fpm

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

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

+ 32 - 0
roles/webserver/tasks/php.yml

@@ -36,3 +36,35 @@
 - name: Install PHPMyAdmin
   apt: pkg=phpmyadmin state=installed update_cache=yes
   when: with_phpmyadmin
+
+- name: Install php5-fpm package
+  apt: pkg=php5-fpm state=installed update_cache=yes
+  when: with_fpm
+
+- name: Install php5-fpm init script config file
+  template: src=fpm/default.j2 dest=/etc/default/php5-fpm owner=root group=root mode=0644
+  notify:
+      - Restart php5-fpm
+  when: with_fpm
+
+- name: Install php5-fpm configuration file
+  template: src=fpm/php-fpm-custom.conf.j2 dest=/etc/php5/fpm/php-fpm-custom.conf owner=root group=root mode=0644
+  notify:
+      - Restart php5-fpm
+  when: with_fpm
+
+- name: Install nginx config files for php5-fpm (fpm servers pool)
+  template: src=fpm/nginx/fpm-pool.conf.j2 dest=/etc/nginx/conf.d/fpm-pool.conf owner=root group=root mode=0644
+  notify:
+      - Reload nginx
+  when: with_fpm and with_nginx
+
+- name: Install nginx config files for php5-fpm (fpm fastcgi config)
+  template: src=fpm/nginx/fastcgi_pass_fpm.j2 dest=/etc/nginx/fastcgi_pass_fpm owner=root group=root mode=0644
+  notify:
+      - Reload nginx
+  when: with_fpm and with_nginx
+
+- name: Ensure php5-fpm is running
+  service: name=php5-fpm state=started
+  when: with_fpm