Skip to content
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

Refactor to eliminate php instalation twice #286

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Changes from 1 commit
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
Next Next commit
Refactor to eliminate php instalation twice
Szpadel committed May 25, 2022
commit 0c86313e1586087f9bff9a3ec595b93ee12469d3
3 changes: 3 additions & 0 deletions group_vars/all.yml
Original file line number Diff line number Diff line change
@@ -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 }}"
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
@@ -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

1 change: 0 additions & 1 deletion roles/cs.php/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -9,7 +9,6 @@ php_packages:
- php-intl
- php-opcache

php_install_fpm_package: no
php_fpm_package: 'php-fpm'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move this var to php_fpm role


# --- Basic default PHP INI configuration ---
4 changes: 1 addition & 3 deletions roles/cs.php/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -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
}}
@@ -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