Skip to content
Snippets Groups Projects
Commit fdd852e7 authored by Thomas Schneider's avatar Thomas Schneider
Browse files

php-fpm: Create users and reliably parse systemctl output

parent 857f0b59
No related branches found
No related tags found
No related merge requests found
......@@ -20,6 +20,24 @@
notify:
- restart php-fpm
- name: create groups
group:
name: "{{ item.name }}"
system: true
state: present
with_items: "{{ fpm_pools|default([]) }}"
- name: create groups
user:
name: "{{ item.name }}"
group: "{{ item.name }}"
system: true
home: "/var/www/{{ item.name }}"
shell: /usr/bin/nologin
createhome: false
state: present
with_items: "{{ fpm_pools|default([]) }}"
- name: ensure we have all the pools we want
template:
src: pool.conf.j2
......@@ -57,7 +75,7 @@
# yamllint disable rule:line-length
shell: |
set -o pipefail
systemctl list-units --state=loaded | grep php-fpm@ | grep -v .socket | sed -E 's/.*php-fpm@(.*)\.service.*/\1/'
systemctl show --state=loaded --type=service --property=Id --value php-fpm@\* | cut -d@ -f2 | cut -d. -f1
args:
executable: /bin/bash
# yamllint enable rule:line-length
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment