roles: Add php (for debian)
This commit is contained in:
parent
1bcada7ffe
commit
fcf03aaea7
3 changed files with 49 additions and 0 deletions
4
roles/php/defaults/main.yml
Normal file
4
roles/php/defaults/main.yml
Normal file
|
@ -0,0 +1,4 @@
|
|||
---
|
||||
php_version: "7.3"
|
||||
php_config: []
|
||||
php_fpm_env: []
|
5
roles/php/handlers/main.yml
Normal file
5
roles/php/handlers/main.yml
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
- name: restart php-fpm
|
||||
systemd:
|
||||
name: "php{{ php_version }}-fpm"
|
||||
state: restarted
|
40
roles/php/tasks/main.yml
Normal file
40
roles/php/tasks/main.yml
Normal file
|
@ -0,0 +1,40 @@
|
|||
---
|
||||
- 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 }}"
|
Loading…
Reference in a new issue