Compare commits
7 Commits
7966a02530
...
dcf16d21b4
Author | SHA1 | Date |
---|---|---|
Tobias Herre | dcf16d21b4 | |
Tobias Herre | c72f985f64 | |
Tobias Herre | 058a5a9ebb | |
Tobias Herre | 2af67ae49c | |
Tobias Herre | 26a000a947 | |
Tobias Herre | b5d641aceb | |
Tobias Herre | 546e73da13 |
|
@ -63,6 +63,7 @@ bundle agent certbot_cert(site,webroot)
|
||||||
vars:
|
vars:
|
||||||
|
|
||||||
"domain" string => "$(site[domain])";
|
"domain" string => "$(site[domain])";
|
||||||
|
"keytype" string => "rsa";
|
||||||
|
|
||||||
"ds" slist => {"$(site[domain])"};
|
"ds" slist => {"$(site[domain])"};
|
||||||
|
|
||||||
|
@ -70,7 +71,7 @@ vars:
|
||||||
|
|
||||||
"site_json" string => storejson(@(site));
|
"site_json" string => storejson(@(site));
|
||||||
"args" string => string_mustache(
|
"args" string => string_mustache(
|
||||||
"--cert-name {{domain}} -d {{domain}} {{#aliases}} -d {{.}} {{/aliases}}",
|
"--key-type $(keytype) --cert-name {{domain}} -d {{domain}} {{#aliases}} -d {{.}} {{/aliases}}",
|
||||||
@(site)
|
@(site)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -120,7 +120,7 @@ reports:
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
bundle agent dovecot_vimbadmin_sql(cfg)
|
bundle agent dovecot_vimbadmin_sql(cfg,dovecot_cfg)
|
||||||
{
|
{
|
||||||
vars:
|
vars:
|
||||||
"cfg_file" string => "$(sys.workdir)/data/agent/dovecot/vimbadmin-sql.comf";
|
"cfg_file" string => "$(sys.workdir)/data/agent/dovecot/vimbadmin-sql.comf";
|
||||||
|
|
35
lib.cf
35
lib.cf
|
@ -215,12 +215,17 @@ vars:
|
||||||
|
|
||||||
methods:
|
methods:
|
||||||
do_install::
|
do_install::
|
||||||
|
"any" usebundle => install_wget;
|
||||||
"any" usebundle => wmde_install_packages(@(pkgs),"apt_repo");
|
"any" usebundle => wmde_install_packages(@(pkgs),"apt_repo");
|
||||||
|
|
||||||
commands:
|
commands:
|
||||||
do_install::
|
do_install::
|
||||||
"/bin/sh"
|
"/bin/sh"
|
||||||
args => "$(sys.workdir)/inputs/$(def.wmde_libdir)/scripts/install-php-repo.sh $(name) $(repo_src) $(key_src) $(key_name)";
|
args => "$(sys.workdir)/inputs/$(def.wmde_libdir)/scripts/install-php-repo.sh $(name) $(repo_src) $(key_src) $(key_name)",
|
||||||
|
depends_on => {
|
||||||
|
"wget_pkgs_installed",
|
||||||
|
"apt_repo_pkgs_installed"
|
||||||
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -248,19 +253,33 @@ bundle agent install_system_repos
|
||||||
classes:
|
classes:
|
||||||
centos::
|
centos::
|
||||||
"centos_9_and_later" expression => isgreaterthan("$(sys.os_version_major)", "8") ;
|
"centos_9_and_later" expression => isgreaterthan("$(sys.os_version_major)", "8") ;
|
||||||
vars:
|
|
||||||
"pkgs" slist => {};
|
|
||||||
centos::
|
|
||||||
"pkgs" slist => {
|
|
||||||
"epel-release"
|
|
||||||
};
|
|
||||||
commands:
|
commands:
|
||||||
|
|
||||||
|
vars:
|
||||||
|
# centos::
|
||||||
|
# "pkgs" slist => {
|
||||||
|
# "epel-release"
|
||||||
|
# };
|
||||||
|
# !centos::
|
||||||
|
# "pkgs" slist => {},
|
||||||
|
# handle => "system_repos_pkgs_installed";
|
||||||
|
|
||||||
|
commands:
|
||||||
|
centos::
|
||||||
|
"/usr/bin/yum"
|
||||||
|
args => "install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-$(sys.os_version_major).noarch.rpm",
|
||||||
|
if => not(returnszero("rpm -q epel-release > /dev/null","useshell")),
|
||||||
|
handle=>"system_repos_pkgs_installed";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
centos_9_and_later::
|
centos_9_and_later::
|
||||||
"/usr/bin/dnf"
|
"/usr/bin/dnf"
|
||||||
inform => "false",
|
inform => "false",
|
||||||
args => "config-manager --set-enabled crb";
|
args => "config-manager --set-enabled crb";
|
||||||
methods:
|
methods:
|
||||||
"any" usebundle => wmde_install_packages(@(pkgs),"system_repos");
|
# "any" usebundle => wmde_install_packages(@(pkgs),"system_repos");
|
||||||
|
|
||||||
reports:
|
reports:
|
||||||
}
|
}
|
||||||
|
|
95
php.cf
95
php.cf
|
@ -5,7 +5,8 @@
|
||||||
bundle agent install_php
|
bundle agent install_php
|
||||||
{
|
{
|
||||||
classes:
|
classes:
|
||||||
"php_install_repo" expression => not(fileexists("/etc/apt/sources.list.d/php.list"));
|
"use_ext_repos";
|
||||||
|
|
||||||
vars:
|
vars:
|
||||||
"version" string => "$(php.version)";
|
"version" string => "$(php.version)";
|
||||||
centos::
|
centos::
|
||||||
|
@ -63,22 +64,23 @@ vars:
|
||||||
};
|
};
|
||||||
|
|
||||||
centos::
|
centos::
|
||||||
|
"xversion" string => "";
|
||||||
"pkgs" slist => {
|
"pkgs" slist => {
|
||||||
"php$(version)-cli",
|
"php$(xversion)-cli",
|
||||||
"php$(version)-common",
|
"php$(xversion)-common",
|
||||||
"php$(version)-pecl-zip",
|
"php$(xversion)-pecl-zip",
|
||||||
"php$(version)-pgsql",
|
"php$(xversion)-pgsql",
|
||||||
"php$(version)-mysqlnd",
|
"php$(xversion)-mysqlnd",
|
||||||
"php$(version)-xml",
|
"php$(xversion)-xml",
|
||||||
"php$(version)-gd",
|
"php$(xversion)-gd",
|
||||||
"php$(version)-mbstring",
|
"php$(xversion)-mbstring",
|
||||||
"php$(version)-intl",
|
"php$(xversion)-intl",
|
||||||
"php$(version)-pecl-imagick",
|
"php$(xversion)-pecl-imagick-im6",
|
||||||
"php$(version)-ldap",
|
"php$(xversion)-ldap",
|
||||||
"php-pecl-json-post"
|
"php-pecl-json-post"
|
||||||
|
|
||||||
};
|
};
|
||||||
# "php$(version)-curl",
|
|
||||||
|
|
||||||
commands:
|
commands:
|
||||||
# (debian|ubuntu)&php_install_repo::
|
# (debian|ubuntu)&php_install_repo::
|
||||||
|
@ -94,11 +96,62 @@ commands:
|
||||||
|
|
||||||
|
|
||||||
methods:
|
methods:
|
||||||
"any" usebundle => install_apt_repo("php","$(php.apt_repo_url)","$(php.apt_repo_key)","$(php.apt_repo_key_name)"),
|
debian&use_ext_repos::
|
||||||
handle => "php_repo_ready";
|
"any" usebundle => install_apt_repo("php","$(php.apt_repo_url)","$(php.apt_repo_key)","$(php.apt_repo_key_name)"),
|
||||||
|
handle => "php_repo_ready";
|
||||||
|
|
||||||
|
centos::
|
||||||
|
"any" usebundle => php_install_centos_repos,
|
||||||
|
handle => "php_repo_ready";
|
||||||
|
|
||||||
|
|
||||||
|
any::
|
||||||
"any" usebundle => wmde_install_packages(@(pkgs),"php"),
|
"any" usebundle => wmde_install_packages(@(pkgs),"php"),
|
||||||
depends_on => {"php_repo_ready"};
|
depends_on => {"php_repo_ready"};
|
||||||
|
|
||||||
|
commands:
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bundle agent php_install_centos_repos
|
||||||
|
{
|
||||||
|
classes:
|
||||||
|
centos::
|
||||||
|
"switch_repo" expression => not(returnszero("cat /etc/dnf/modules.d/php.module | grep -q '^stream.*=.*remi-$(php.version)'","useshell"));
|
||||||
|
"install_remi" expression => not(returnszero("rpm -q remi-release > /dev/null","useshell"));
|
||||||
|
"install_epel" expression => not(returnszero("rpm -q epel-release > /dev/null","useshell"));
|
||||||
|
|
||||||
|
commands:
|
||||||
|
centos&install_epel::
|
||||||
|
"/usr/bin/yum"
|
||||||
|
args => "install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm",
|
||||||
|
handle => "php_epel_repo_installed";
|
||||||
|
|
||||||
|
centos&(!install_epel)::
|
||||||
|
"/usr/bin/true"
|
||||||
|
inform => "false",
|
||||||
|
handle => "php_epel_repo_installed";
|
||||||
|
|
||||||
|
centos&install_remi::
|
||||||
|
"/usr/bin/yum"
|
||||||
|
args => "install -y https://rpms.remirepo.net/enterprise/remi-release-$(sys.os_version_major).rpm",
|
||||||
|
depends_on => {"php_epel_repo_installed"},
|
||||||
|
handle => "php_remi_repo_installed";
|
||||||
|
|
||||||
|
centos&(!install_remi)::
|
||||||
|
"/usr/bin/true"
|
||||||
|
inform => "false",
|
||||||
|
handle => "php_remi_repo_installed";
|
||||||
|
|
||||||
|
|
||||||
|
centos&switch_repo::
|
||||||
|
"dnf" args => "module switch-to php:remi-$(php.version) -y",
|
||||||
|
contain => wmde_cmd_useshell,
|
||||||
|
depends_on => {"php_remi_repo_installed"};
|
||||||
|
|
||||||
|
|
||||||
|
methods:
|
||||||
}
|
}
|
||||||
|
|
||||||
bundle agent php(settings)
|
bundle agent php(settings)
|
||||||
|
@ -109,8 +162,8 @@ vars:
|
||||||
debian::
|
debian::
|
||||||
"version" string => "8.0";
|
"version" string => "8.0";
|
||||||
"ini_files" slist => {
|
"ini_files" slist => {
|
||||||
"/etc/php/$(php.version)/apache2/php.ini",
|
# "/etc/php/$(php.version)/apache2/php.ini",
|
||||||
"/etc/php/$(php.version)/fpm/php.ini"
|
# "/etc/php/$(php.version)/fpm/php.ini"
|
||||||
};
|
};
|
||||||
|
|
||||||
"cli_exe" string => "/usr/bin/php";
|
"cli_exe" string => "/usr/bin/php";
|
||||||
|
@ -148,8 +201,8 @@ vars:
|
||||||
|
|
||||||
centos::
|
centos::
|
||||||
"cli_exe" string => "/usr/bin/php";
|
"cli_exe" string => "/usr/bin/php";
|
||||||
"version" string => "";
|
"version" string => "8.2";
|
||||||
"fpm_pkgs" slist => { "php$(version)-fpm" };
|
"fpm_pkgs" slist => { "php-fpm" };
|
||||||
"fpm_service_name" string => "php$(version)-fpm";
|
"fpm_service_name" string => "php$(version)-fpm";
|
||||||
"fpm_socket" string => "/run/php-fpm/www.sock";
|
"fpm_socket" string => "/run/php-fpm/www.sock";
|
||||||
|
|
||||||
|
@ -163,8 +216,8 @@ files:
|
||||||
classes => if_repaired(php_repaired);
|
classes => if_repaired(php_repaired);
|
||||||
|
|
||||||
|
|
||||||
methods:
|
#methods:
|
||||||
"any" usebundle => install_php;
|
# "any" usebundle => install_php;
|
||||||
reports:
|
reports:
|
||||||
"PHP VERSION: $(ini_files) V:$(install_php.version)";
|
"PHP VERSION: $(ini_files) V:$(install_php.version)";
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
!/bin/sh
|
#!/bin/sh
|
||||||
# To add this repository please do:
|
# To add this repository please do:
|
||||||
|
|
||||||
|
set -x
|
||||||
|
|
||||||
echo $1 $2 $3
|
echo $1 $2 $3
|
||||||
|
|
||||||
|
@ -9,8 +9,10 @@ echo "PARAMS $1 $2 $3"
|
||||||
|
|
||||||
if [ -n "$3" ]; then
|
if [ -n "$3" ]; then
|
||||||
echo "it dollaar 3"
|
echo "it dollaar 3"
|
||||||
curl -sSLo /usr/share/keyrings/$4 $3
|
wget -O /etc/apt/trusted.gpg.d/$1.gpg $3
|
||||||
echo "deb [signed-by=/usr/share/keyrings/$4] $2 $(lsb_release -sc) main" > /etc/apt/sources.list.d/$1.list
|
echo "deb $2 $(lsb_release -sc) main" > /etc/apt/sources.list.d/$1.list
|
||||||
|
chmod 644 /etc/apt/sources.list.d/$1.list
|
||||||
|
chmod 644 /etc/apt/trusted.gpg.d/$1.gpg
|
||||||
|
|
||||||
else
|
else
|
||||||
echo "its not $3"
|
echo "its not $3"
|
||||||
|
@ -19,5 +21,5 @@ else
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
apt-get update
|
apt-get update -y
|
||||||
|
|
||||||
|
|
|
@ -6,3 +6,10 @@ password_query = \
|
||||||
homedir AS userdb_home, uid AS userdb_uid, gid AS userdb_gid \
|
homedir AS userdb_home, uid AS userdb_uid, gid AS userdb_gid \
|
||||||
FROM mailbox WHERE username = '%u'
|
FROM mailbox WHERE username = '%u'
|
||||||
iterate_query = SELECT username AS user FROM mailbox
|
iterate_query = SELECT username AS user FROM mailbox
|
||||||
|
|
||||||
|
user_query = \
|
||||||
|
SELECT 'maildir:~/Maildir' as mail, '{{vars.dovecot_vimbadmin_sql.dovecot_cfg.vmail_dir}}/%d/%n' as home, 1003 as gid, 1003 as uid FROM mailbox WHERE username = '%u'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
11
vimbadmin.cf
11
vimbadmin.cf
|
@ -11,6 +11,11 @@ classes:
|
||||||
"vimbadmin_restore_db" expression => fileexists("$(cfg[restore_db_file])");
|
"vimbadmin_restore_db" expression => fileexists("$(cfg[restore_db_file])");
|
||||||
|
|
||||||
vars:
|
vars:
|
||||||
|
"pkgs" slist => {
|
||||||
|
"git"
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
"vsettings[resources.doctrine2.connection.options.driver]" string => "'$(cfg[db_driver])'";
|
"vsettings[resources.doctrine2.connection.options.driver]" string => "'$(cfg[db_driver])'";
|
||||||
"vsettings[resources.doctrine2.connection.options.dbname]" string => "'$(cfg[db_name])'";
|
"vsettings[resources.doctrine2.connection.options.dbname]" string => "'$(cfg[db_name])'";
|
||||||
"vsettings[resources.doctrine2.connection.options.user]" string => "'$(cfg[db_user])'";
|
"vsettings[resources.doctrine2.connection.options.user]" string => "'$(cfg[db_user])'";
|
||||||
|
@ -112,8 +117,11 @@ commands:
|
||||||
|
|
||||||
"/bin/sh"
|
"/bin/sh"
|
||||||
# args => "-c 'cd $(cfg[install_dir]) && $(php_composer.exe) -q -n create-project --prefer-dist --no-dev opensolutions/vimbadmin'",
|
# args => "-c 'cd $(cfg[install_dir]) && $(php_composer.exe) -q -n create-project --prefer-dist --no-dev opensolutions/vimbadmin'",
|
||||||
args => "-c 'cd $(cfg[install_dir]) && $(php_composer.exe) install -q --prefer-dist --no-dev",
|
args => "-c 'cd $(cfg[install_dir]) && $(php_composer.exe) update -q --no-cache && $(php_composer.exe) install --no-cache -q --prefer-dist --no-dev",
|
||||||
handle => "vimbadmin_composed",
|
handle => "vimbadmin_composed",
|
||||||
|
depends_on => {
|
||||||
|
"vimbadmin_pkgs_installed"
|
||||||
|
},
|
||||||
contain => vimbadmin_cmd;
|
contain => vimbadmin_cmd;
|
||||||
|
|
||||||
#"/bin/sh"
|
#"/bin/sh"
|
||||||
|
@ -127,6 +135,7 @@ commands:
|
||||||
|
|
||||||
|
|
||||||
methods:
|
methods:
|
||||||
|
"any" usebundle => wmde_install_packages(@(pkgs),"vimbadmin");
|
||||||
"any" usebundle => php_composer;
|
"any" usebundle => php_composer;
|
||||||
"any" usebundle => mysql_table_exists(@(cfg),"admin");
|
"any" usebundle => mysql_table_exists(@(cfg),"admin");
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue