php.yml 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. - name: Install common PHP dependencies
  2. apt: pkg={{ item }} state=installed update_cache=yes
  3. with_items:
  4. - php5-cli
  5. - php5-curl
  6. - php5-gd
  7. - php5-intl
  8. - php5-mcrypt
  9. - php-mime-type
  10. when: with_php
  11. - name: Install local PHP configuration
  12. template: src=php/php-config.ini.j2 dest=/etc/php5/conf.d/99-local-config.ini owner=root group=root mode=0644
  13. when: with_php
  14. - name: Create system checks directory /etc/php5/syscheck.d
  15. file: path=/etc/php5/syscheck.d owner=root group=root mode=0755 state=directory
  16. when: with_php
  17. - name: Install phpinfo system check
  18. template: src=php/phpinfo.php dest=/etc/php5/syscheck.d/index.php owner=root group=root mode=0644
  19. when: with_php
  20. - name: Install PHP APC extension
  21. apt: pkg=php-apc state=installed update_cache=yes
  22. when: with_php_apc
  23. - name: Install php-apc system check
  24. template: src=php/apc.php dest=/etc/php5/syscheck.d/apc.php owner=root group=root mode=0644
  25. when: with_php_apc
  26. - name: Install MySQL extension for PHP
  27. apt: pkg=php5-mysqlnd state=installed update_cache=yes
  28. when: with_php and with_mysql is defined and with_mysql
  29. - name: Install PHPMyAdmin
  30. apt: pkg=phpmyadmin state=installed update_cache=yes
  31. when: with_phpmyadmin
  32. - name: Install php5-fpm package
  33. apt: pkg=php5-fpm state=installed update_cache=yes
  34. when: with_fpm
  35. - name: Install php5-fpm init script config file
  36. template: src=fpm/default.j2 dest=/etc/default/php5-fpm owner=root group=root mode=0644
  37. notify:
  38. - Restart php5-fpm
  39. when: with_fpm
  40. - name: Install php5-fpm configuration file
  41. template: src=fpm/php-fpm-custom.conf.j2 dest=/etc/php5/fpm/php-fpm-custom.conf owner=root group=root mode=0644
  42. notify:
  43. - Restart php5-fpm
  44. when: with_fpm
  45. - name: Install nginx config files for php5-fpm (fpm servers pool)
  46. template: src=fpm/nginx/fpm-pool.conf.j2 dest=/etc/nginx/conf.d/fpm-pool.conf owner=root group=root mode=0644
  47. notify:
  48. - Reload nginx
  49. when: with_fpm and with_nginx
  50. - name: Install nginx config files for php5-fpm (fpm fastcgi config)
  51. template: src=fpm/nginx/fastcgi_pass_fpm.j2 dest=/etc/nginx/fastcgi_pass_fpm owner=root group=root mode=0644
  52. notify:
  53. - Reload nginx
  54. when: with_fpm and with_nginx
  55. - name: Ensure php5-fpm is running
  56. service: name=php5-fpm state=started
  57. when: with_fpm