Fxied some bugs regarding starting and restarting service

This commit is contained in:
Tobias Herre 2023-10-24 17:12:45 +02:00
parent 34d722c981
commit 2f6eb07cc8
1 changed files with 33 additions and 65 deletions

View File

@ -140,30 +140,13 @@ vars:
freebsd::
"pkgs" slist => {"mod_php$(php.bsdvs)"};
debian::
"pkgs" slist => {"libapache2-mod-php"};
"pkgs" slist => {"libapache2-mod-php$(php.version)"};
centos::
"pkgs" slist => {"libapache2-mod-php"};
packages:
freebsd::
"$(pkgs)"
policy => "present",
package_module => pkg,
handle => "apache_php_installed",
classes => if_repaired(apache_changed);
debian::
"$(pkgs)"
policy => "present",
package_module => apt_get,
handle => "apache_php_installed",
depends_on => { "apache_mpm_event_disabled" },
classes => if_repaired(apache_changed);
fedora|centos::
"$(pkgs)"
policy => "present",
package_module => yum,
handle => "apache_php_installed",
classes => if_repaired(apache_changed);
methods:
"any" usebundle => wmde_install_packages(@(pkgs),"apache_php"),
handle => "apache_php_installed";
commands:
debian|ubuntu::
@ -171,46 +154,27 @@ commands:
args => "-c '/usr/sbin/a2dismod mpm_event > /dev/null'",
inform=>"false",
handle => "apache_mpm_event_disabled";
}
bundle agent install_apache(raw)
{
classes:
packages:
freebsd::
"$(apache.pkgs)"
policy => "present",
handle => "apache_pkgs_installed",
package_module => pkg,
classes => if_repaired(apache_changed);
debian::
"$(apache.pkgs)"
policy => "present",
package_module => apt_get,
handle => "apache_pkgs_installed",
classes => if_repaired(apache_changed);
fedora|centos::
"$(apache.pkgs)"
policy => "present",
package_module => yum,
handle => "apache_pkgs_installed",
classes => if_repaired(apache_changed);
methods:
"any" usebundle => wmde_install_packages(@(apache.pkgs),"apache");
"any" usebundle => install_apache_php,
depends_on => { "apache_pkgs_installed" };
commands:
# freebsd::
# "/usr/sbin/sysrc"
# handle => "apache_editrc",
# args => "apache24_enable=yes",
# inform=>"false";
# debian|centos::
# any::
# "/bin/true" handle => "apache_editrc",
# inform => "false";
#services:
## apache_kept::
# "$(apache.service_name)"
# service_policy => "start";
reports:
files:
"$(apache.log_dir)/."
@ -241,21 +205,25 @@ files:
create => "true",
edit_template => "$(sys.workdir)/inputs/$(def.wmde_libdir)/templates/httpd.conf.mustache",
template_method => "mustache",
handle => "apache_main_cfg_crreated",
handle => "apache_main_cfg_created",
depends_on => { "apache_pkgs_installed","apache_php_installed" },
classes => if_repaired(apache_changed);
classes => if_repaired(apache_repaired);
services:
# apache_editrs depends
"$(apache.service_name)"
depends_on => {"apache_vhost_dir_created","apache_www_dir_created","apache_main_cfg_crreated"},
service_policy => "start",
handle => "apache_running";
methods:
"any" usebundle => wmde_service("$(apache.service_name)","apache_kept","apache_repaired|php_repaired"),
depends_on => {
"apache_pkgs_installed",
"apache_php_pkgs_installed",
"apache_www_dir_created",
"apache_vhost_dir_created",
"apache_main_cfg_created"
};
#depends_on => {
# "apache_php_pkgs_installed"
"php_changed|apache_changed"::
"$(apache.service_name)"
depends_on => {"apache_vhost_dir_created","apache_www_dir_created","apache_main_cfg_crreated"},
service_policy => "restart";
#};
}