Stes most settings in config.ini.php

This commit is contained in:
7u83 2020-10-16 10:48:29 +02:00
parent 2270694130
commit cccdfde5b7
1 changed files with 68 additions and 2 deletions

View File

@ -48,11 +48,18 @@ class wmdeit_piwik(
$localnginx = true,
$localsql = true,
$piwikdbuser = "piwik",
$piwikdbname = "piwikdb",
$piwikdbpassword = "piwik",
$piwikdbhost = "localhost",
$ssl = false,
$piwiksalt = undef,
) inherits wmdeit_piwik::params
{
$piwikini = "$wwwdir/piwik/config/config.ini.php"
if $localnginx {
$fpm_listen = "/tmp/fpm"
$fpm_type ="unix:"
@ -93,9 +100,68 @@ class wmdeit_piwik(
File[$wwwdir],
],
creates => "$wwwdir/piwik",
} ->
file{"$piwikini":
ensure => file,
owner => $wwwuser
} ->
ini_setting {"$piwikini proxy":
ensure => present,
section => "General",
path => "$piwikini",
setting => "browser_archiving_disabled_enforce",
value => "1",
}
if $piwiksalt {
ini_setting {"$piwikini salt":
ensure => present,
section => "General",
path => "$piwikini",
setting => "salt",
value => "\"$piwiksalt\"",
require => File["$piwikini"],
}
}
ini_setting {"$piwikini dbhost":
ensure => present,
section => "database",
path => "$piwikini",
setting => "host",
value => "\"$piwikdbhost\"",
require => File["$piwikini"],
}
ini_setting {"$piwikini dbname":
ensure => present,
section => "database",
path => "$piwikini",
setting => "dbname",
value => "\"$piwikdbname\"",
require => File["$piwikini"],
}
ini_setting {"$piwikini dbuser":
ensure => present,
section => "database",
path => "$piwikini",
setting => "username",
value => "\"$piwikdbuser\"",
require => File["$piwikini"],
}
ini_setting {"$piwikini dbpass":
ensure => present,
section => "database",
path => "$piwikini",
setting => "password",
value => "\"$piwikdbpassword\"",
require => File["$piwikini"],
}
if $ssl {
$ssl_redirect = true
$ssl_port = 443
@ -210,10 +276,10 @@ class wmdeit_piwik(
}
}
mysql::db { 'piwikdb':
mysql::db { "$piwikdbname":
user => "$piwikdbuser",
password => "$piwikdbpassword",
host => 'localhost',
host => "$piwikdbhost",
grant => ['ALL'],
}
}