Merge pull request #17 from rgsystemes/fix-handlers-name-2

Fix handlers name 2/2 + cleanup Redhat
This commit is contained in:
Frank Fidanza 2022-10-05 15:47:00 +02:00 committed by GitHub
commit 631309fca4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 20 additions and 55 deletions

View File

@ -2,7 +2,7 @@
[![CI](https://github.com/geerlingguy/ansible-role-php/workflows/CI/badge.svg?event=push)](https://github.com/geerlingguy/ansible-role-php/actions?query=workflow%3ACI)
Installs PHP on RedHat/CentOS and Debian/Ubuntu servers.
Installs PHP on Debian/Ubuntu servers.
## Requirements

View File

@ -3,7 +3,7 @@
service:
name: "{{ php_webserver_daemon }}"
state: restarted
notify: restart php-fpm
notify: Restart php-fpm
when: php_enable_webserver
- name: Restart php-fpm

View File

@ -24,7 +24,7 @@
apt_repository:
repo: ppa:ondrej/php
state: present
notify: update apt cache
notify: Update apt cache
when: ansible_distribution == 'Ubuntu'
# Debian-specific tasks.

View File

@ -14,7 +14,7 @@
with_subelements:
- "{{ php_installed_apc_confs.results }}"
- files
notify: restart webserver
notify: Restart webserver
- name: Ensure APCu config file is present.
template:
@ -26,7 +26,7 @@
mode: 0644
with_items: "{{ php_extension_conf_paths }}"
when: php_enable_apc
notify: restart webserver
notify: Restart webserver
- name: Remove APCu config file if APC is disabled.
file:
@ -34,4 +34,4 @@
state: absent
with_items: "{{ php_extension_conf_paths }}"
when: not php_enable_apc
notify: restart webserver
notify: Restart webserver

View File

@ -43,7 +43,7 @@
force: true
loop: "{{ php_fpm_pools | default([], true) }}"
when: php_enable_php_fpm
notify: restart php-fpm
notify: Restart php-fpm
- name: Ensure php-fpm is started and enabled at boot (if configured).
service:

View File

@ -14,7 +14,7 @@
with_subelements:
- "{{ php_installed_opcache_confs.results }}"
- files
notify: restart webserver
notify: Restart webserver
- name: Ensure OpCache config file is present.
template:
@ -26,7 +26,7 @@
mode: 0644
with_items: "{{ php_extension_conf_paths }}"
when: php_opcache_enable | bool
notify: restart webserver
notify: Restart webserver
- name: Remove OpCache config file if OpCache is disabled.
file:
@ -34,4 +34,4 @@
state: absent
with_items: "{{ php_extension_conf_paths }}"
when: not php_opcache_enable | bool
notify: restart webserver
notify: Restart webserver

View File

@ -17,5 +17,5 @@
group: root
mode: 0644
with_items: "{{ php_conf_paths }}"
notify: restart webserver
notify: Restart webserver
when: php_use_managed_ini

View File

@ -1,37 +1,8 @@
---
- name: Ensure dependencies for building from source are installed (RedHat).
package:
name:
- autoconf
- automake
- libtool
- bison
- make
- re2c
- sqlite-devel
- oniguruma-devel
- curl-devel
- recode-devel
- aspell-devel
- libxml2-devel
- pkgconfig
- libmcrypt-devel
- t1lib-devel
- libXpm-devel
- libpng-devel
- libjpeg-turbo-devel
- bzip2-devel
- openssl-devel
- freetype-devel
- libicu-devel
- mariadb-devel
- gmp-devel
state: present
when: ansible_os_family == 'RedHat'
- name: Update apt cache (Debian).
apt: update_cache=yes cache_valid_time=86400
when: ansible_os_family == 'Debian'
apt:
update_cache: yes
cache_valid_time: 86400
- name: Ensure dependencies for building from source are installed (Debian).
apt:
@ -59,7 +30,6 @@
- librecode-dev
- libssl-dev
state: present
when: ansible_os_family == 'Debian'
- name: Define php_fpm_daemon (if not defined already).
set_fact:
@ -140,7 +110,7 @@
dest: "/etc/init.d/{{ php_fpm_daemon }}"
mode: 0755
when: "'--enable-fpm' in php_source_configure_command"
notify: restart php-fpm
notify: Restart php-fpm
- name: Ensure php-fpm config directory exists.
file:
@ -155,4 +125,4 @@
dest: "{{ php_fpm_conf_path }}/php-fpm.conf"
mode: 0644
when: "'--enable-fpm' in php_source_configure_command"
notify: restart php-fpm
notify: Restart php-fpm

View File

@ -58,11 +58,6 @@
when: php_fpm_conf_path is not defined
# Setup/install tasks.
- include_tasks: setup-RedHat.yml
when:
- not php_install_from_source
- ansible_os_family == 'RedHat'
- include_tasks: setup-Debian.yml
when:
- not php_install_from_source

View File

@ -8,7 +8,7 @@
state: "{{ php_packages_state }}"
install_recommends: "{{ php_install_recommends }}"
register: php_package_install
notify: restart webserver
notify: Restart webserver
- name: Delete APCu configuration file if this role will provide one.
file:
@ -16,7 +16,7 @@
state: absent
with_items: "{{ php_extension_conf_paths }}"
when: php_enable_apc and php_package_install.changed
notify: restart webserver
notify: Restart webserver
- name: Delete OpCache configuration file if this role will provide one.
file:
@ -24,4 +24,4 @@
state: absent
with_items: "{{ php_extension_conf_paths }}"
when: php_opcache_enable | bool and php_package_install.changed
notify: restart webserver
notify: Restart webserver

View File

@ -4,4 +4,4 @@
name: "{{ php_packages + php_packages_extra }}"
state: "{{ php_packages_state }}"
enablerepo: "{{ php_enablerepo | default(omit, true) }}"
notify: restart webserver
notify: Restart webserver