11bundle agent cfe_internal_enterprise_mission_portal
22{
33 meta:
4-
54 "description" string => "Manage mission portal configuration";
65
6+ classes:
7+ "mission_portal_http2_enabled"
8+ expression => and(
9+ fileexists("$(sys.workdir)/httpd/php/sbin/php-fpm"),
10+ fileexists("$(sys.workdir)/httpd/modules/mod_http2.so")
11+ ),
12+ scope => "namespace", # so it is visible in datastate() used in httpd.conf template rendering in bundle cfe_internal_enterprise_mission_portal_apache
13+ comment => "If php-fpm and mod_http2.so are present then http2 is enabled
14+ and we use this class in httpd.conf to configure accordingly.";
15+ vars:
16+ policy_server.enterprise_edition.mission_portal_http2_enabled::
17+ "php_fpm_pid_file" string => "$(sys.workdir)/httpd/php-fpm.pid";
18+ "php_fpm_www_pool_max_children" string => ifelse(
19+ isvariable("default:def.php_fpm_www_pool_max_children"),
20+ "$(default:def.php_fpm_www_pool_max_children)",
21+ "60");
22+ "php_fpm_www_pool_start_servers" string => ifelse(
23+ isvariable("default:def.php_fpm_www_pool_start_servers"),
24+ "$(default:def.php_fpm_www_pool_start_servers)",
25+ "50");
26+ "php_fpm_www_pool_min_spare_servers" string => ifelse(
27+ isvariable("default:def.php_fpm_www_pool_min_spare_servers"),
28+ "$(default:def.php_fpm_www_pool_min_spare_servers)",
29+ "40");
30+ "php_fpm_www_pool_max_spare_servers" string => ifelse(
31+ isvariable("default:def.php_fpm_www_pool_max_spare_servers"),
32+ "$(default:def.php_fpm_www_pool_max_spare_servers)",
33+ "50");
34+ "php_fpm_state" data => mergedata(
35+ '{"vars": { "sys": { "workdir": "${default:sys.workdir}" } } }',
36+ '{
37+ "max_children":"${php_fpm_www_pool_max_children}",
38+ "start_servers":"${php_fpm_www_pool_start_servers}",
39+ "min_spare_servers":"${php_fpm_www_pool_min_spare_servers}",
40+ "max_spare_servers":"${php_fpm_www_pool_max_spare_servers}"
41+ }');
42+
43+ reports:
44+ DEBUG::
45+ "Using variable default:def.php_fpm_www_pool_max_children: ${default:def.php_fpm_www_pool_max_children} instead of built-in default"
46+ if => isvariable("default:def.php_fpm_www_pool_max_children");
47+ "Using variable default:def.php_fpm_www_pool_start_servers: ${default:def.php_fpm_www_pool_start_servers} instead of built-in default"
48+ if => isvariable("default:def.php_fpm_www_pool_start_servers");
49+ "Using variable default:def.php_fpm_www_pool_min_spare_servers: ${default:def.php_fpm_www_pool_min_spare_servers} instead of built-in default"
50+ if => isvariable("default:def.php_fpm_www_pool_min_spare_servers");
51+ "Using variable default:def.php_fpm_www_pool_max_spare_servers: ${default:def.php_fpm_www_pool_max_spare_servers} instead of built-in default"
52+ if => isvariable("default:def.php_fpm_www_pool_max_spare_servers");
53+
754 methods:
855
956 policy_server::
@@ -20,7 +67,23 @@ bundle agent cfe_internal_enterprise_mission_portal
2067 handle => "cfe_internal_management_update_cli_rest_server_url_config",
2168 comment => "Update the REST server URL port in the Mission Portal when cfe_internal_hub_vars.https_port is changed";
2269
70+ policy_server.mission_portal_http2_enabled::
71+ "PHP FastCGI process manager"
72+ usebundle => service_config(
73+ "cf-php-fpm",
74+ "$(this.promise_dirname)/templates/php-fpm.conf.mustache",
75+ "$(sys.workdir)/httpd/php/etc/php-fpm.conf",
76+ "$(sys.workdir)/httpd/php/sbin/php-fpm -t --fpm-config ",
77+ @(php_fpm_state),
78+ "$(php_fpm_pid_file)"
79+ );
80+
81+ services:
82+ policy_server.mission_portal_http2_enabled::
83+ "cf-php-fpm"
84+ service_policy => "start";
2385}
86+
2487bundle agent apachectl_patched_for_upgrade
2588# @brief Ensure that apacehctl is patched so that it is able to re-start services
2689#
0 commit comments