Installs php from externals repos

This commit is contained in:
Tobias Herre 2023-10-24 16:27:32 +02:00
parent 71bef3b692
commit 7c8683ca64
1 changed files with 63 additions and 32 deletions

95
php.cf
View File

@ -4,19 +4,12 @@
bundle agent install_php bundle agent install_php
{ {
classes:
"php_install_repo" expression => not(fileexists("/etc/apt/sources.list.d/php.list"));
vars: vars:
debian::
"version" string => "8.2";
ubuntu_20::
"version" string => "7.4";
ubuntu_22::
"version" string => "8.1";
freebsd::
"version" string => "$(php.version)"; "version" string => "$(php.version)";
"bsdvs" string => "$(php.bsdvs)";
freebsd::
freebsd:: freebsd::
"cli_exe" string => "/usr/local/bin/php"; "cli_exe" string => "/usr/local/bin/php";
@ -39,19 +32,19 @@ vars:
debian:: debian::
"pkgs" slist => { "pkgs" slist => {
"php-cli", "php$(version)-cli",
"php$(version)-common", "php$(version)-common",
"php$(version)-zip", "php$(version)-zip",
"php$(version)-pgsql", "php$(version)-pgsql",
"php$(version)-mysql", "php$(version)-mysql",
"php-json",
"php$(version)-xml", "php$(version)-xml",
"php-gd", "php$(version)-gd",
"php-mbstring", "php$(version)-mbstring",
"php-intl", "php$(version)-intl",
"php-curl", "php$(version)-curl",
"php-imagick", "php$(version)-imagick",
"php-ldap", "php$(version)-ldap",
"php-json"
}; };
ubuntu:: ubuntu::
@ -68,31 +61,55 @@ vars:
}; };
packages: commands:
freebsd:: # (debian|ubuntu)&php_install_repo::
"$(pkgs)" # "/bin/sh"
policy => "present", # args => "$(sys.workdir)/inputs/$(def.wmde_libdir)/scripts/install-php-sury.sh",
package_module => pkg, # handle => "php_repo_ready";
classes => if_repaired(php_changed); # (debian|ubuntu)&(!php_install_repo)::
debian:: # "/usr/bin/true"
"$(pkgs)" # inform => "false",
policy => "present", # handle => "php_repo_ready";
package_module => apt_get,
handle => "php_installed", # !(debian|ubuntu)::
classes => if_repaired(php_changed);
methods:
"any" usebundle => install_apt_repo("php","$(php.apt_repo_url)","$(php.apt_repo_key)","$(php.apt_repo_key_name)"),
handle => "php_repo_ready";
"any" usebundle => wmde_install_packages(@(pkgs),"php"),
depends_on => {"php_repo_ready"};
} }
bundle agent php(settings) bundle agent php(settings)
{ {
vars: vars:
debian:: debian::
"version" string => "8.2";
"ini_files" slist => { "ini_files" slist => {
"/etc/php/$(install_php.version)/apache2/php.ini", "/etc/php/$(php.version)/apache2/php.ini",
"/etc/php/$(install_php.version)/fpm/php.ini" "/etc/php/$(php.version)/fpm/php.ini"
}; };
"cli_exe" string => "/usr/bin/php"; "cli_exe" string => "/usr/bin/php";
"fpm_pkgs" slist => { "php$(version)-fpm" };
"fpm_service_name" string => "php$(version)-fpm";
"apt_repo_url" string => "https://packages.sury.org/php/";
"apt_repo_key" string => "https://packages.sury.org/php/apt.gpg";
"apt_repo_key_name" string=> "deb.sury.org-php.gpg";
ubuntu::
"apt_repo_url" string => "https://ppa.launchpadcontent.net/ondrej/php/ubuntu/";
"apt_repo_key" string => "";
"apt_repo_key_name" string=> "";
ubuntu_22::
"version" string => "8.2";
freebsd:: freebsd::
"ini_files" slist => { "ini_files" slist => {
"/etc/php/$(install_php.version)/apache2/php.ini", "/etc/php/$(install_php.version)/apache2/php.ini",
@ -121,6 +138,20 @@ reports:
} }
bundle agent install_php_fpm
{
methods:
"any" usebundle => install_php;
"any" usebundle => wmde_install_packages(@(php.fpm_pkgs),"php_fpm");
"any" usebundle => wmde_service("$(php.fpm_service_name)","php_kept","php_repaired"),
depends_on =>{
"php_fpm_pkgs_installed",
"php_pkgs_installed"
};
}
bundle agent php_composer(cfg) bundle agent php_composer(cfg)
{ {