Skip to content
Snippets Groups Projects
Commit fcdb171d authored by Lars Beckers's avatar Lars Beckers
Browse files

php-fpm: fix syntax errors

parent 43477406
Branches
No related tags found
No related merge requests found
......@@ -8,22 +8,16 @@
state: present
notify:
- restart php-fpm
tags:
- php-fpm
- webservices
- name: ensure php-fpm is configured
template:
src: php-fpm.conf.j2
dest: "/etc/php/{{ php_version }}/fpm/"
dest: "/etc/php/{{ php_version }}/fpm/php-fpm.conf"
owner: root
group: root
mode: '0644'
notify:
- restart php-fpm
tags:
- php-fpm
- webservices
- name: ensure we have all the pools we want
template:
......@@ -36,9 +30,6 @@
with_items: "{{ fpm_pools|default([]) }}"
notify:
- restart php-fpm
tags:
- php-fpm
- webservices
- name: ensure systemd can start php instances
template:
......@@ -53,17 +44,11 @@
notify:
- reload systemd service files
- restart php-fpm
tags:
- php-fpm
- webservices
- name: get remote active php pools
shell: "systemctl list-units --state=loaded | grep uwsgi@ | sed -E 's/.*uwsgi@(.*)\.service.*/\1/'"
shell: "systemctl list-units --state=loaded | grep uwsgi@ | sed -E 's/.*uwsgi@(.*)\\.service.*/\\1/'"
changed_when: false
register: running_pools
tags:
- php-fpm
- webservices
- name: deactivate inactive pools via systemd
systemd:
......@@ -71,9 +56,8 @@
enabled: false
state: stopped
with_items: "{{ running_pools.stdout_lines|difference(fpm_pools|map(attribute=name))|list }}"
tags:
- php-fpm
- webservices
- meta: flush_handlers
- name: ensure active pools are enabled in systemd
systemd:
......@@ -81,6 +65,3 @@
enabled: true
state: started
with_items: "{{ fpm_pools|default([]) }}"
tags:
- php-fpm
- webservices
......@@ -14,7 +14,7 @@
; Pid file
; Note: the default prefix is /var
; Default Value: none
pid = /run/php/php{{ php_version }}-fpm.pid
;pid = /run/php/php{{ php_version }}-fpm.pid
; Error log file
; If it's set to "syslog", log is sent to syslogd instead of being written
......
......@@ -23,7 +23,7 @@ IOAccounting=yes
User=%i
Group=%i
Environment="FPM_SOCKETS=/run/php/%i-fpm.sock=3"
ExecStart=/usr/bin/php-fpm --nodaemonize --fpm-config /etc/php/{{ php_version }}/fpm/pool.d/%i.conf
ExecStart=/usr/sbin/php-fpm{{ php_version }} --nodaemonize --fpm-config /etc/php/{{ php_version }}/fpm/pool.d/%i.conf
ExecReload=/bin/kill -USR2 $MAINPID
[Install]
......
......@@ -4,8 +4,8 @@ include=/etc/php/{{ php_version }}/fpm/php-fpm.conf
{% set item = {"name": fpm_pool, "params": fpm_params|default({})} %}
{% endif %}
[{{item.name}}]
user = {{item.name}}
group = {{item.name}}
;user = {{item.name}}
;group = {{item.name}}
listen = /run/php/{{item.name}}-fpm.sock
......@@ -27,10 +27,10 @@ pm.process_idle_timeout = {{ item.pm_process_idle_timeout|default(15) }}s
{% endif %}
pm.max_requests = {{ item.pm_max_requests|default(500) }}
{% for key, value in fpm_default_params|combine(item.params|default({})).items() %}
{% for key, value in (fpm_default_params|combine(item.params|default({}))).items() %}
php_admin_value[{{key}}] = {{value}}
{% endfor %}
{% for key, value in fpm_default_flags|combine(item.flags|default({})).items() %}
{% for key, value in (fpm_default_flags|combine(item.flags|default({}))).items() %}
php_admin_flag[{{key}}] = {{'on' if value else 'off'}}
{% endfor %}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment