php.yml 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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 (native driver)
  27. apt: pkg=php5-mysqlnd state=installed update_cache=yes
  28. when: with_php and not with_php_lt_54
  29. - name: Install MySQL extension for PHP (old driver)
  30. apt: pkg=php5-mysql state=installed update_cache=yes
  31. when: with_php and with_php_lt_54
  32. - name: Install PHPMyAdmin
  33. apt: pkg=phpmyadmin state=installed update_cache=yes
  34. when: with_phpmyadmin
  35. - name: Install php5-fpm package
  36. apt: pkg=php5-fpm state=installed update_cache=yes
  37. when: with_fpm
  38. - name: Install php5-fpm init script config file
  39. template: src=fpm/default.j2 dest=/etc/default/php5-fpm owner=root group=root mode=0644
  40. notify:
  41. - Restart php5-fpm
  42. when: with_fpm
  43. - name: Install php5-fpm configuration file
  44. template: src=fpm/php-fpm-custom.conf.j2 dest=/etc/php5/fpm/php-fpm-custom.conf owner=root group=root mode=0644
  45. notify:
  46. - Restart php5-fpm
  47. when: with_fpm
  48. - name: Install nginx config files for php5-fpm (fpm servers pool)
  49. template: src=fpm/nginx/fpm-pool.conf.j2 dest=/etc/nginx/conf.d/fpm-pool.conf owner=root group=root mode=0644
  50. notify:
  51. - Reload nginx
  52. when: with_fpm and with_nginx
  53. - name: Install nginx config files for php5-fpm (fpm fastcgi config)
  54. template: src=fpm/nginx/fastcgi_pass_fpm.j2 dest=/etc/nginx/fastcgi_pass_fpm owner=root group=root mode=0644
  55. notify:
  56. - Reload nginx
  57. when: with_fpm and with_nginx
  58. - name: Ensure php5-fpm is running
  59. service: name=php5-fpm state=started
  60. when: with_fpm