Skip to content

Refactor to eliminate php instalation twice #286

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions group_vars/all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1292,6 +1292,9 @@ php_fpm_service: php-fpm
# Enable the separate PHP-FPM pool with xdebug support (among others)
php_fpm_debug_pool_enable: yes

# It's required to use the same value
php_debug_ini_enable: "{{ php_fpm_debug_pool_enable }}"

# Special XDebug directive overrides for debugging PHP-FPM pool
php_fpm_debug_pool_xdebug_remote_host: "{{ mageops_xdebug_proxy_remote_connection_to_loadbalancer | ternary(mageops_varnish_host, 'localhost') }}"
php_fpm_debug_pool_xdebug_remote_port: "{{ php_xdebug_remote_port }}"
Expand Down
4 changes: 3 additions & 1 deletion roles/cs.php-fpm/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# --- Base configuration ---


php_fpm_package: 'php-fpm'

php_fpm_daemon_conf_file_path: "/etc/php-fpm.conf"
php_fpm_pid_file_path: "{{ php_fpm_run_dir_path }}/php-fpm.pid"
php_fpm_pool_conf_dir_path: "/etc/php-fpm.d"
Expand Down
2 changes: 0 additions & 2 deletions roles/cs.php-fpm/meta/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
dependencies:
- role: cs.php
php_install_fpm_package: yes
php_debug_ini_enable: "{{ php_fpm_debug_pool_enable }}"
4 changes: 4 additions & 0 deletions roles/cs.php-fpm/tasks/000-install.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- name: Install PHP and dependency packages
yum:
name: "{{ php_fpm_package }}"
state: present
3 changes: 3 additions & 0 deletions roles/cs.php-fpm/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
- debug:
msg: "Will use {{ php_fpm_pm_max_children }} workers, autodetected default: {{ php_fpm_pm_max_children_default }}"

- name: Install packages
include_tasks: 000-install.yml

- name: Configure daemons
include_tasks: 001-daemon.yml

Expand Down
3 changes: 0 additions & 3 deletions roles/cs.php/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ php_packages:
- php-intl
- php-opcache

php_install_fpm_package: no
php_fpm_package: 'php-fpm'

# --- Basic default PHP INI configuration ---

php_date_timezone: "Europe/Berlin"
Expand Down
4 changes: 1 addition & 3 deletions roles/cs.php/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
{{
(
php_packages + php_extra_packages | default([])
+ php_install_fpm_package | ternary([php_fpm_package], [])
+ php_debug_ini_enable | ternary([php_xdebug_package], [])
) | unique
}}
Expand Down Expand Up @@ -124,10 +123,9 @@
enabled: no
daemon_reload: yes
when: php_tmpfiles_service_config is changed

- name: Ensure tmpfiles maintenance service is enabled
systemd:
name: php-tmpfiles
state: started
enabled: yes