make it work on debian - version issue
This commit is contained in:
@@ -13,7 +13,7 @@ None
|
|||||||
|
|
||||||
Role Variables
|
Role Variables
|
||||||
--------------
|
--------------
|
||||||
php_poolname: default www_{{ php_version_nodot }}
|
php_pool_name: default www_{{ php_version_nodot }}
|
||||||
php_version: STRING default "8.2"
|
php_version: STRING default "8.2"
|
||||||
php_fpm_pool_user: default apache
|
php_fpm_pool_user: default apache
|
||||||
php_fpm_pool_group: default apache
|
php_fpm_pool_group: default apache
|
||||||
@@ -44,7 +44,7 @@ Including an example of how to use your role (for instance, with variables passe
|
|||||||
roles:
|
roles:
|
||||||
- role: tconstans.php-fpm
|
- role: tconstans.php-fpm
|
||||||
vars:
|
vars:
|
||||||
php_poolname: pool1
|
php_pool_name: pool1
|
||||||
php_fpm_listen_url: "/srv/pool1/php-fpm.sock"
|
php_fpm_listen_url: "/srv/pool1/php-fpm.sock"
|
||||||
php_version_nodot: 74
|
php_version_nodot: 74
|
||||||
php_packages:
|
php_packages:
|
||||||
@@ -63,7 +63,7 @@ Including an example of how to use your role (for instance, with variables passe
|
|||||||
- php{{ php_version_nodot }}-php-ctype
|
- php{{ php_version_nodot }}-php-ctype
|
||||||
- role: tconstans.php-fpm
|
- role: tconstans.php-fpm
|
||||||
vars:
|
vars:
|
||||||
php_poolname: pool2
|
php_pool_name: pool2
|
||||||
php_fpm_listen_url: "/srv/pool2/php-fpm.sock"
|
php_fpm_listen_url: "/srv/pool2/php-fpm.sock"
|
||||||
php_version_nodot: 80
|
php_version_nodot: 80
|
||||||
php_packages:
|
php_packages:
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
---
|
---
|
||||||
# defaults file for php-fpm
|
# defaults file for php-fpm
|
||||||
php_version: "8.2"
|
php_version: "8.2"
|
||||||
php_version_nodot: "{{php_version[0]}}{{php_version[2]}}"
|
php_version_string: "{{ php_version | string }}"
|
||||||
php_poolname: "www_{{ php_version_nodot }}"
|
php_version_nodot: "{{php_version_string[0]}}{{php_version_string[2]}}"
|
||||||
|
php_pool_name: "www_{{ php_version_nodot }}"
|
||||||
php_fpm_pool_user: "{{ apache_user }}"
|
php_fpm_pool_user: "{{ apache_user }}"
|
||||||
php_fpm_pool_group: "{{ apache_group }}"
|
php_fpm_pool_group: "{{ apache_group }}"
|
||||||
php_fpm_listen_url: 127.0.0.1:90{{ php_version_nodot }}
|
php_fpm_listen_url: 127.0.0.1:90{{ php_version_nodot }}
|
||||||
|
|||||||
@@ -16,6 +16,25 @@
|
|||||||
state: present
|
state: present
|
||||||
when: ansible_os_family=='RedHat'
|
when: ansible_os_family=='RedHat'
|
||||||
|
|
||||||
|
- name: "setup repository - debian"
|
||||||
|
block:
|
||||||
|
- name: setup repo key
|
||||||
|
ansible.builtin.get_url:
|
||||||
|
url: https://packages.sury.org/php/apt.gpg
|
||||||
|
dest: /etc/apt/keyrings/sury_php.gpg
|
||||||
|
|
||||||
|
- name: setup source list
|
||||||
|
ansible.builtin.template:
|
||||||
|
src: php_sury_sources.list
|
||||||
|
dest: /etc/apt/sources.list.d/php_sury.sources.list
|
||||||
|
register: repo_setup
|
||||||
|
|
||||||
|
- name: update cache
|
||||||
|
ansible.builtin.apt:
|
||||||
|
update_cache: true
|
||||||
|
when: repo_setup.changed
|
||||||
|
when: ansible_os_family | lower == 'debian'
|
||||||
|
|
||||||
- name: create socket directory if needed
|
- name: create socket directory if needed
|
||||||
file:
|
file:
|
||||||
path: "{{ php_fpm_listen_url|dirname }}"
|
path: "{{ php_fpm_listen_url|dirname }}"
|
||||||
@@ -37,7 +56,7 @@
|
|||||||
- name: configure php-fpm pool 2
|
- name: configure php-fpm pool 2
|
||||||
template:
|
template:
|
||||||
src: www.conf
|
src: www.conf
|
||||||
dest: "{{ php_fpm_pool_dir }}/{{ php_poolname }}.conf"
|
dest: "{{ php_fpm_pool_dir }}/{{ php_pool_name }}.conf"
|
||||||
notify: restart php-fpm
|
notify: restart php-fpm
|
||||||
|
|
||||||
- name: start and enable service
|
- name: start and enable service
|
||||||
@@ -49,4 +68,4 @@
|
|||||||
- name: configure logrotate
|
- name: configure logrotate
|
||||||
template:
|
template:
|
||||||
src: logrotate.conf.jj
|
src: logrotate.conf.jj
|
||||||
dest: /etc/logrotate.d/php-fpm.conf
|
dest: "/etc/logrotate.d/php-fpm_{{ php_pool_name }}_{{ php_fpm_pool_user }}.conf"
|
||||||
|
|||||||
1
templates/php_sury_sources.list
Normal file
1
templates/php_sury_sources.list
Normal file
@@ -0,0 +1 @@
|
|||||||
|
deb [signed-by=/etc/apt/keyrings/sury_php.gpg] https://packages.sury.org/php/ {{ ansible_distribution_release }} main
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
[{{ php_poolname }}]
|
[{{ php_pool_name }}]
|
||||||
user = {{ php_fpm_pool_user }}
|
user = {{ php_fpm_pool_user }}
|
||||||
group = {{ php_fpm_pool_group }}
|
group = {{ php_fpm_pool_group }}
|
||||||
listen = {{ php_fpm_listen_url }}
|
listen = {{ php_fpm_listen_url }}
|
||||||
|
|||||||
Reference in New Issue
Block a user