Role php-fpm: fix linting errors

parent 5cb84cbe
......@@ -37,7 +37,7 @@ php_opcache_enable_cli: 0
php_opcache_memory_consumption: 128
php_opcache_interned_strings_buffer: 8
php_opcache_max_accelerated_files: 4000
php_opcache_revalidate_freq: 2 # 30 en prod
php_opcache_revalidate_freq: 2 # 30 en prod
php_date_timezone: "America/Toronto"
php_error_reporting: "E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT"
......
---
- name: Remove pool configuration file
file:
name: "/etc/php/7.0/fpm/pool.d/{{pool}}.conf"
name: "/etc/php/7.0/fpm/pool.d/{{ pool }}.conf"
state: absent
notify: Reload php-fpm
tags: php-fpm
- name: Remove pool from munin
file:
name: "/etc/munin/plugins/php_fpm_process_{{pool}}"
name: "/etc/munin/plugins/php_fpm_process_{{ pool }}"
state: absent
notify: Restart munin-node
tags: php-fpm
......@@ -16,32 +16,32 @@
- name: Remove user from mail aliases
lineinfile:
name: /etc/aliases
line: "{{item}}: root"
line: "{{ item }}: root"
state: absent
with_items:
- "{{options.user |default(pool)}}"
- "{{options.www_user |default('www-' ~ pool)}}"
- "{{ options.user |default(pool) }}"
- "{{ options.www_user |default('www-' ~ pool) }}"
notify: Renew aliases
when: options.remove_user
tags: php-fpm
- name: Remove www Unix account
user:
name: "{{options.www_user |default('www-' ~ pool)}}"
name: "{{ options.www_user |default('www-' ~ pool) }}"
state: absent
when: options.remove_user
tags: php-fpm
- name: Remove Unix account
user:
name: "{{options.user |default(pool)}}"
name: "{{ options.user |default(pool) }}"
state: absent
when: options.remove_user
tags: php-fpm
- name: Remove home directory
file:
name: "{{options.wwwdir |default('/var/www/' ~ pool)}}"
name: "{{ options.wwwdir |default('/var/www/' ~ pool) }}"
state: absent
when: options.remove_user
tags: php-fpm
---
- name: Create Unix account
user:
name: "{{options.user |default(pool)}}"
comment: "User for {{domains |first}}"
home: "{{options.wwwdir |default('/var/www/' ~ pool)}}"
name: "{{ options.user |default(pool) }}"
comment: "User for {{ domains |first }}"
home: "{{ options.wwwdir |default('/var/www/' ~ pool) }}"
shell: /bin/bash
when: options.create_user
tags: php-fpm
......@@ -13,50 +13,50 @@
name: "~/.profile"
regexp: "^#?umask .*$"
line: "umask 027"
become: yes
become_user: "{{options.user |default(pool)}}"
become: true
become_user: "{{ options.user |default(pool) }}"
when: options.create_user
tags: php-fpm
- name: Create www Unix account
user:
name: "{{options.www_user |default('www-' ~ pool)}}"
comment: "www user for {{domains |first}}"
home: "{{options.wwwdir |default('/var/www/' ~ pool ~ '/www/')}}"
name: "{{ options.www_user |default('www-' ~ pool) }}"
comment: "www user for {{ domains |first }}"
home: "{{ options.wwwdir |default('/var/www/' ~ pool ~ '/www/') }}"
shell: /bin/false
group: "{{pool}}"
createhome: no
group: "{{ pool }}"
createhome: false
when: options.create_user
tags: php-fpm
- name: Create www directory with group access
file:
name: "{{item}}"
name: "{{ item }}"
state: directory
owner: "{{options.user |default(pool)}}"
group: "{{options.user |default(pool)}}"
owner: "{{ options.user |default(pool) }}"
group: "{{ options.user |default(pool) }}"
mode: "0750"
with_items:
- "{{options.wwwdir |default('/var/www/' ~ pool)}}"
- "{{options.wwwdir |default('/var/www/' ~ pool ~ '/www/')}}"
- "{{ options.wwwdir |default('/var/www/' ~ pool) }}"
- "{{ options.wwwdir |default('/var/www/' ~ pool ~ '/www/') }}"
when: options.create_user
tags: php-fpm
- name: Add www-data to {{options.user |default(pool)}} group
- name: Add www-data to {{ options.user |default(pool) }} group
user:
name: www-data
groups: "{{options.user |default(pool)}}"
append: yes
groups: "{{ options.user |default(pool) }}"
append: true
when: options.create_user
tags: php-fpm
- name: Append created users to mail aliases
lineinfile:
name: /etc/aliases
line: "{{item}}: root"
line: "{{ item }}: root"
with_items:
- "{{options.user |default(pool)}}"
- "{{options.www_user |default('www-' ~ pool)}}"
- "{{ options.user |default(pool) }}"
- "{{ options.www_user |default('www-' ~ pool) }}"
notify: Renew aliases
when: options.create_user
tags: php-fpm
......@@ -64,14 +64,14 @@
- name: Template the FPM pool
template:
src: pool.j2
dest: "/etc/php/7.0/fpm/pool.d/{{pool}}.conf"
dest: "/etc/php/7.0/fpm/pool.d/{{ pool }}.conf"
mode: "0600"
notify: Reload php-fpm
tags: php-fpm
- name: Add munin plugin for FPM pool
file:
name: "/etc/munin/plugins/php_fpm_process_{{pool}}"
name: "/etc/munin/plugins/php_fpm_process_{{ pool }}"
src: /usr/local/share/munin/plugins/php_fpm_process
state: link
notify: Restart munin-node
......
---
- name: Add munin plugins for PHP
copy:
src: "munin/{{item}}"
src: "munin/{{ item }}"
dest: /usr/local/share/munin/plugins/
mode: "0755"
with_items:
......
......@@ -2,13 +2,13 @@
- name: Install base PHP packages
apt:
name:
- php
- php7.0
- php7.0-fpm
- php7.0-cli
- php
- php7.0
- php7.0-fpm
- php7.0-cli
tags: php-fpm
- name: Install additional PHP packages
apt:
name: "{{php_additional_packages}}"
name: "{{ php_additional_packages }}"
tags: php-fpm
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment