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

php-fpm: Create users and reliably parse systemctl output

parent dd877dd5
No related branches found
No related tags found
No related merge requests found
Pipeline #1576 passed
...@@ -20,6 +20,24 @@ ...@@ -20,6 +20,24 @@
notify: notify:
- restart php-fpm - 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 - name: ensure we have all the pools we want
template: template:
src: pool.conf.j2 src: pool.conf.j2
...@@ -57,7 +75,7 @@ ...@@ -57,7 +75,7 @@
# yamllint disable rule:line-length # yamllint disable rule:line-length
shell: | shell: |
set -o pipefail 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: args:
executable: /bin/bash executable: /bin/bash
# yamllint enable rule:line-length # 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