ansible/roles/php/tasks/main.yml
2020-09-17 00:16:36 +00:00

40 lines
849 B
YAML

---
- name: Install php
notify: restart php-fpm
package:
name:
- php-apcu
- php-bcmath
- php-cgi
- php-cli
- php-curl
- php-dev
- php-fpm
- php-gd
- php-gmp
- php-mbstring
- php-mysql
- php-imagick
- php-intl
- php-redis
- php-pspell
- php-xmlrpc
- php-zip
state: latest
- name: set php config
notify: restart php-fpm
lineinfile:
path: "/etc/php/{{ php_version }}/fpm/php.ini"
regex: "^{{item.key}}\\s+=.*"
line: "{{ item.key }} = {{ item.value }}"
with_items: "{{ php_config }}"
- name: set php-fpm config
notify: restart php-fpm
lineinfile:
path: "/etc/php/{{ php_version }}/fpm/pool.d/www.conf"
regex: '^env\[{{item.key}}\]\s+=.*'
line: "env[{{ item.key }}] = {{ item.value }}"
create: yes
with_items: "{{ php_fpm_env }}"