fpm.yml 1.2 KB

12345678910111213141516171819202122232425262728293031
  1. - name: Install php5-fpm package
  2. action: ${ansible_pkg_mgr} pkg=php5-fpm state=installed update_cache=yes
  3. when_boolean: ${with_fpm}
  4. - name: Install php5-fpm init script config file
  5. action: template src=fpm/default.j2 dest=/etc/default/php5-fpm owner=root group=root mode=0644
  6. notify:
  7. - Restart php5-fpm
  8. when_boolean: ${with_fpm}
  9. - name: Install php5-fpm configuration file
  10. action: template src=fpm/php-fpm-custom.conf.j2 dest=/etc/php5/fpm/php-fpm-custom.conf owner=root group=root mode=0644
  11. notify:
  12. - Restart php5-fpm
  13. when_boolean: ${with_fpm}
  14. - name: Install nginx config files for php5-fpm (fpm servers pool)
  15. action: template src=fpm/nginx/fpm-pool.conf.j2 dest=/etc/nginx/conf.d/fpm-pool.conf owner=root group=root mode=0644
  16. notify:
  17. - Reload nginx
  18. when_boolean: ${with_fpm} and ${with_nginx}
  19. - name: Install nginx config files for php5-fpm (fpm fastcgi config)
  20. action: template src=fpm/nginx/fastcgi_pass_fpm.j2 dest=/etc/nginx/fastcgi_pass_fpm owner=root group=root mode=0644
  21. notify:
  22. - Reload nginx
  23. when_boolean: ${with_fpm} and ${with_nginx}
  24. - name: Ensure php5-fpm is running
  25. action: service name=php5-fpm state=started
  26. when_boolean: ${with_fpm}