main.yml 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. - name: Add php repository
  2. become: true
  3. ansible.builtin.apt_repository:
  4. repo: ppa:ondrej/php
  5. - name: Install php packages
  6. become: true
  7. apt:
  8. pkg:
  9. - php{{ app_php_version }}-cli
  10. - php{{ app_php_version }}-fpm
  11. - php{{ app_php_version }}-xml
  12. - php{{ app_php_version }}-imap
  13. - php{{ app_php_version }}-intl
  14. - php{{ app_php_version }}-mbstring
  15. - php{{ app_php_version }}-bz2
  16. - php{{ app_php_version }}-zip
  17. - php{{ app_php_version }}-curl
  18. - php{{ app_php_version }}-gd
  19. - php{{ app_php_version }}-imagick
  20. - php{{ app_php_version }}-mysql
  21. - php{{ app_php_version }}-pgsql
  22. - php{{ app_php_version }}-sqlite3
  23. - php{{ app_php_version }}-redis
  24. - php{{ app_php_version }}-bcmath
  25. - name: Creates composer install directory
  26. file:
  27. path: "{{ ansible_env.HOME }}/.local/bin"
  28. state: directory
  29. # https://getcomposer.org/doc/00-intro.md#installation-linux-unix-macos
  30. - name: Download composer
  31. get_url:
  32. url: https://getcomposer.org/download/latest-stable/composer.phar
  33. dest: "{{ ansible_env.HOME }}/.local/bin/composer"
  34. mode: 0755
  35. - name: Restart php-fpm
  36. become: true
  37. ansible.builtin.systemd:
  38. state: restarted
  39. daemon_reload: yes
  40. name: "php{{ app_php_version }}-fpm"
  41. - name: Restart nginx
  42. become: true
  43. ansible.builtin.systemd:
  44. state: restarted
  45. daemon_reload: yes
  46. name: nginx