Modernize

* Fix lint errors due to ansible-lint latest version
* Drop debian stretch support
This commit is contained in:
Emilien M
2022-10-06 14:47:06 +02:00
committed by GitHub
parent 4aef107c1a
commit e9e74e2db6
12 changed files with 62 additions and 58 deletions

View File

@@ -22,7 +22,7 @@
group: root
mode: 0644
loop: "{{ php_ini | combine(php_ini_fpm) | dict2items }}"
notify: restart php-fpm
notify: Restart php-fpm
- name: TEMPLATE | Deploy pool configuration
ansible.builtin.template:
@@ -32,11 +32,11 @@
group: root
mode: 0644
loop: "{{ ansible_local.hanxhx_php.fpm_pool }}"
notify: restart php-fpm
notify: Restart php-fpm
- name: FILE | Delete default pool if necessary
ansible.builtin.file:
path: "{{ php_fpm_pool_dir }}/www.conf"
state: absent
when: '"www" not in (ansible_local.hanxhx_php.fpm_pool | map(attribute="name") | list) and php_autoremove_default_pool'
notify: restart php-fpm
notify: Restart php-fpm

View File

@@ -60,6 +60,8 @@
group: root
mode: 0644
register: f
tags:
- skip_ansible_lint
- name: SETUP | Gathers new facts
ansible.builtin.setup:
@@ -76,13 +78,13 @@
install_recommends: false
vars:
pkgs: "{{ php_packages + php_extra_packages | flatten }}"
notify: restart php-fpm
notify: Restart php-fpm
when: ansible_os_family == 'Debian'
- name: PKGNG | Install PHP packages
community.general.pkgng:
name: "{{ php_packages + php_extra_packages | flatten | join(',') }}"
notify: restart php-fpm
notify: Restart php-fpm
when: ansible_os_family == 'FreeBSD'
- name: IMPORT_TASKS | PHP-FPM
@@ -107,7 +109,9 @@
state: started
when: php_install_fpm and ansible_virtualization_type != 'docker'
- block:
- name: BLOCK | Ensure PHP-FPM is started if running on Docker
when: php_install_fpm and ansible_virtualization_type == 'docker'
block:
- name: COMMAND | Check if PHP-FPM is started (Docker)
ansible.builtin.command: 'service {{ php_fpm_service }} status'
@@ -122,5 +126,3 @@
args:
warn: false
when: dps.stdout.find('is not running') != -1
when: php_install_fpm and ansible_virtualization_type == 'docker'

View File

@@ -1,6 +1,8 @@
---
- block:
- name: Install opcache/apcu on Debian
when: ansible_os_family == 'Debian'
block:
- name: APT | Install APCu
ansible.builtin.apt:
@@ -12,9 +14,10 @@
pkg: "{{ php_package_prefix }}opcache"
install_recommends: false
when: ansible_os_family == 'Debian'
- block:
- name: Install opcache/apcu on FreeBSD
when: ansible_os_family == 'FreeBSD'
block:
- name: PKGNG | Install APCu
community.general.pkgng:
@@ -24,8 +27,6 @@
community.general.pkgng:
name: "{{ php_package_prefix }}opcache"
when: ansible_os_family == 'FreeBSD'
- name: TEMPLATE | Configure Opcache
ansible.builtin.template:
src: "etc/__php__/mods-available/opcache.ini.j2"
@@ -33,7 +34,7 @@
owner: root
group: root
mode: 0644
notify: restart php-fpm
notify: Restart php-fpm
- name: TEMPLATE | Configure APCu
ansible.builtin.template:
@@ -42,4 +43,4 @@
owner: root
group: root
mode: 0644
notify: restart php-fpm
notify: Restart php-fpm

View File

@@ -1,6 +1,8 @@
---
- block:
- name: BLOCK | Uninstall xdebug
when: php_install_xdebug
block:
- name: APT | Install xdebug
ansible.builtin.apt:
@@ -22,11 +24,12 @@
dest: "{{ php_mods_dir }}/xdebug.ini"
owner: root
mode: 0644
notify: restart php-fpm
notify: Restart php-fpm
when: php_install_xdebug
- block:
- name: BLOCK | Uninstall xdebug
when: not php_install_xdebug
block:
- name: APT | Uninstall xdebug
ansible.builtin.apt:
@@ -39,5 +42,3 @@
name: "{{ php_xdebug_package }}"
state: absent
when: ansible_os_family == 'FreeBSD'
when: not php_install_xdebug