Compare commits
No commits in common. "2b14b23ff150049bffc9b8f70b38657ada0bb831" and "35711c25943a8ed4c8a05106ada96cb90a32f03c" have entirely different histories.
2b14b23ff1
...
35711c2594
|
@ -256,8 +256,7 @@ vars:
|
||||||
{
|
{
|
||||||
"aliases":[],
|
"aliases":[],
|
||||||
"ssl_cert":"certbot",
|
"ssl_cert":"certbot",
|
||||||
"email":"$(apache.admin_email)",
|
"email":"$(apache.admin_email)"
|
||||||
"doc_root":"$(apache.www_dir)/$(site_param[domain])"
|
|
||||||
}
|
}
|
||||||
';
|
';
|
||||||
|
|
||||||
|
@ -330,7 +329,6 @@ reports:
|
||||||
# "NOT USE_SSL";
|
# "NOT USE_SSL";
|
||||||
|
|
||||||
# "RAW: $(site[raw])";
|
# "RAW: $(site[raw])";
|
||||||
# "APACHE DOCROOT $(site[doc_root])";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
20
git.cf
20
git.cf
|
@ -1,20 +0,0 @@
|
||||||
#
|
|
||||||
#
|
|
||||||
#
|
|
||||||
bundle agent git
|
|
||||||
{
|
|
||||||
vars:
|
|
||||||
freebsd::
|
|
||||||
"pkgs" slist => { "git" };
|
|
||||||
"exe" string => "/usr/local/bin/git";
|
|
||||||
|
|
||||||
debian::
|
|
||||||
"pkgs" slist => { "git" };
|
|
||||||
"exe" string => "/usr/bin/git";
|
|
||||||
}
|
|
||||||
|
|
||||||
bundle agent install_git
|
|
||||||
{
|
|
||||||
methods:
|
|
||||||
"any" usebundle => wmde_install_packages(@(git.pkgs),"git");
|
|
||||||
}
|
|
10
lib.cf
10
lib.cf
|
@ -22,15 +22,14 @@ packages:
|
||||||
"$(pkgs)"
|
"$(pkgs)"
|
||||||
policy => "present",
|
policy => "present",
|
||||||
package_module => pkg,
|
package_module => pkg,
|
||||||
handle => "$(name)_pkgs_installed",
|
classes => if_repaired("$(name)_repaired"),
|
||||||
classes => results("namespace","$(name)");
|
classes => if_ok("$(name)_ok");
|
||||||
debian::
|
debian::
|
||||||
"$(pkgs)"
|
"$(pkgs)"
|
||||||
policy => "present",
|
policy => "present",
|
||||||
package_module => apt_get,
|
package_module => apt_get,
|
||||||
handle => "$(name)_pkgs_installed",
|
classes => if_repaired("$(name)_repaired"),
|
||||||
classes => results("namespace","$(name)");
|
classes => if_ok("$(name)_ok");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
body perms wmde_perms(user,group,mode)
|
body perms wmde_perms(user,group,mode)
|
||||||
|
@ -109,6 +108,7 @@ services:
|
||||||
"$(service_name)"
|
"$(service_name)"
|
||||||
service_policy => "restart";
|
service_policy => "restart";
|
||||||
reports:
|
reports:
|
||||||
|
"SERVICE $(service_name) - Start on: $(start_cond) Restart if: $(restart_cond)";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
69
mysql.cf
69
mysql.cf
|
@ -1,69 +0,0 @@
|
||||||
#
|
|
||||||
#
|
|
||||||
#
|
|
||||||
|
|
||||||
bundle agent mysql
|
|
||||||
{
|
|
||||||
vars:
|
|
||||||
"bind_address" string => "127.0.0.1";
|
|
||||||
"user" string => "mysql";
|
|
||||||
"port" string => "3306";
|
|
||||||
|
|
||||||
freebsd::
|
|
||||||
# "pkg" string => "mariadb106-server";
|
|
||||||
"pkg" string => "mysql80-server";
|
|
||||||
"service_name" string => "mysql-server";
|
|
||||||
"cfg_file" string => "/usr/local/etc/mysql/my.cnf";
|
|
||||||
"mysql_cmd" string => "/usr/local/bin/mysql";
|
|
||||||
debian::
|
|
||||||
"pkg" string => "mariadb-server";
|
|
||||||
"service_name" string => "mysql";
|
|
||||||
"cfg_file" string => "/etc/mysql/my.cnf";
|
|
||||||
"mysql_cmd" string => "/usr/bin/mysql";
|
|
||||||
|
|
||||||
files:
|
|
||||||
"$(cfg_file)"
|
|
||||||
create => "true",
|
|
||||||
perms => m("644"),
|
|
||||||
edit_template => "$(sys.workdir)/inputs/$(def.wmde_libdir)/templates/my.cnf.mustache",
|
|
||||||
template_method => "mustache",
|
|
||||||
handle => "mysql_cfg_created",
|
|
||||||
depends_on => {"mysql_pkgs_installed"},
|
|
||||||
classes => if_repaired("mysql_repaired");
|
|
||||||
|
|
||||||
|
|
||||||
methods:
|
|
||||||
"any" usebundle => wmde_install_packages("$(mysql.pkg)","mysql");
|
|
||||||
|
|
||||||
services:
|
|
||||||
"$(service_name)"
|
|
||||||
depends_on => {"mysql_pkgs_installed"},
|
|
||||||
service_policy => "start",
|
|
||||||
handle => "mysql_running";
|
|
||||||
|
|
||||||
mysql_repaired::
|
|
||||||
"$(service_name)"
|
|
||||||
service_policy => "restart",
|
|
||||||
depends_on => {"mysql_running","mysql_cfg_created"};
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
bundle agent create_mysql_db(cfg)
|
|
||||||
{
|
|
||||||
vars:
|
|
||||||
"db_name" string => "$(cfg[db_name])";
|
|
||||||
"db_user" string => "$(cfg[db_user])";
|
|
||||||
"host" string => "$(cfg[db_user_host])";
|
|
||||||
"db_pass" string => "$(cfg[db_pass])";
|
|
||||||
|
|
||||||
"args" string => "-e \"CREATE DATABASE IF NOT EXISTS $(db_name); GRANT ALL PRIVILEGES ON $(db_name).* TO '$(db_user)'@'$(host)' IDENTIFIED BY '$(db_pass)'; \" ";
|
|
||||||
|
|
||||||
commands:
|
|
||||||
debian::
|
|
||||||
"$(mysql.mysql_cmd)"
|
|
||||||
args => "$(args)",
|
|
||||||
inform => "false";
|
|
||||||
|
|
||||||
reports:
|
|
||||||
}
|
|
|
@ -1,7 +1,7 @@
|
||||||
#
|
#
|
||||||
# Managed by CFEengine
|
# Managed by CFEengine
|
||||||
#
|
#
|
||||||
<Directory {{vars.apache_vhost.site.doc_root}}>
|
<Directory {{vars.apache.www_dir}}/{{vars.apache_vhost.site.domain}}>
|
||||||
AllowOverride all
|
AllowOverride all
|
||||||
Options Indexes FollowSymLinks
|
Options Indexes FollowSymLinks
|
||||||
Require all granted
|
Require all granted
|
||||||
|
@ -17,7 +17,7 @@
|
||||||
RewriteEngine On
|
RewriteEngine On
|
||||||
Alias /.well-known/acme-challenge/ "{{vars.apache.default_html_dir}}/.well-known/acme-challenge/"
|
Alias /.well-known/acme-challenge/ "{{vars.apache.default_html_dir}}/.well-known/acme-challenge/"
|
||||||
RewriteRule "^/.well-known/acme-challenge/" - [L]
|
RewriteRule "^/.well-known/acme-challenge/" - [L]
|
||||||
DocumentRoot "{{vars.apache_vhost.site.doc_root}}"
|
DocumentRoot "{{vars.apache.www_dir}}/{{vars.apache_vhost.site.domain}}"
|
||||||
ServerAlias {{#vars.apache_vhost.site.aliases}}{{.}} {{/vars.apache_vhost.site.aliases}}
|
ServerAlias {{#vars.apache_vhost.site.aliases}}{{.}} {{/vars.apache_vhost.site.aliases}}
|
||||||
ErrorLog "{{vars.apache.log_dir}}/{{vars.apache_vhost.site.domain}}-error.log"
|
ErrorLog "{{vars.apache.log_dir}}/{{vars.apache_vhost.site.domain}}-error.log"
|
||||||
CustomLog "{{vars.apache.log_dir}}/{{vars.apache_vhost.site.domain}}-access.log" combined
|
CustomLog "{{vars.apache.log_dir}}/{{vars.apache_vhost.site.domain}}-access.log" combined
|
||||||
|
@ -32,12 +32,12 @@
|
||||||
RewriteEngine On
|
RewriteEngine On
|
||||||
Alias /.well-known/acme-challenge/ "{{vars.apache.default_html_dir}}/.well-known/acme-challenge/"
|
Alias /.well-known/acme-challenge/ "{{vars.apache.default_html_dir}}/.well-known/acme-challenge/"
|
||||||
RewriteRule "^/.well-known/acme-challenge/" - [L]
|
RewriteRule "^/.well-known/acme-challenge/" - [L]
|
||||||
DocumentRoot "{{vars.apache_vhost.site.doc_root}}"
|
DocumentRoot "{{vars.apache.www_dir}}/{{vars.apache_vhost.site.domain}}"
|
||||||
Redirect permanent / https://{{vars.apache_vhost.site.domain}}/
|
Redirect permanent / https://{{vars.apache_vhost.site.domain}}/
|
||||||
</VirtualHost>
|
</VirtualHost>
|
||||||
<VirtualHost *:443>
|
<VirtualHost *:443>
|
||||||
ServerAdmin {{vars.apache_vhost.site.email}}
|
ServerAdmin {{vars.apache_vhost.site.email}}
|
||||||
DocumentRoot "{{vars.apache_vhost.site.doc_root}}"
|
DocumentRoot "{{vars.apache.www_dir}}/{{vars.apache_vhost.site.domain}}"
|
||||||
ServerName {{vars.apache_vhost.site.domain}}
|
ServerName {{vars.apache_vhost.site.domain}}
|
||||||
ServerAlias {{#vars.apache_vhost.site.aliases}}{{.}} {{/vars.apache_vhost.site.aliases}}
|
ServerAlias {{#vars.apache_vhost.site.aliases}}{{.}} {{/vars.apache_vhost.site.aliases}}
|
||||||
ErrorLog "{{vars.apache.log_dir}}/{{vars.apache_vhost.site.domain}}-error.log"
|
ErrorLog "{{vars.apache.log_dir}}/{{vars.apache_vhost.site.domain}}-error.log"
|
||||||
|
|
Loading…
Reference in New Issue