diff options
| author | Dan Fandrich <danf@mageia.org> | 2026-02-21 18:52:35 -0800 |
|---|---|---|
| committer | Dan Fandrich <danf@mageia.org> | 2026-02-21 19:05:59 -0800 |
| commit | 12299baacbdd26b32de99370508b1ae79974240d (patch) | |
| tree | 8819ecaa6f0ebc1d91323922a1898c0057fea27d /modules/youri_check/manifests/init.pp | |
| parent | dff3eec23a755ceb24e758d959f89047263c1039 (diff) | |
| download | puppet-12299baa.tar puppet-12299baa.tar.gz puppet-12299baa.tar.bz2 puppet-12299baa.tar.xz puppet-12299baa.zip | |
Rename module paths to match classes
The refactor in commit e39155d4d changed class names but Puppet 3 seems
to require the module path name to match.
Diffstat (limited to 'modules/youri_check/manifests/init.pp')
| -rw-r--r-- | modules/youri_check/manifests/init.pp | 133 |
1 files changed, 133 insertions, 0 deletions
diff --git a/modules/youri_check/manifests/init.pp b/modules/youri_check/manifests/init.pp new file mode 100644 index 00000000..98a0c95e --- /dev/null +++ b/modules/youri_check/manifests/init.pp @@ -0,0 +1,133 @@ +class youri_check { + class base { + $vhost = "check.${::domain}" + $user = 'youri' + $home = '/var/lib/youri' + $home_check = '/var/www/youri-check' + $pgsql_password = extlookup('youri_pgsql','x') + + user { $user: + comment => 'Youri Check', + home => $home, + } + + file { $home: + ensure => directory, + owner => $user, + group => $user, + } + + file { $home_check: + ensure => directory, + owner => $user, + group => $user, + } + + $pgsql_server = "${vhost}" + + package { ['youri-check', 'perl-DBD-Pg', 'perl-Youri-Media']: } + + } + + + define config($version) { + include stdlib + include youri_check::base + + $config = "/etc/youri/${version}.conf" + $outdir = "/var/www/youri-check/${version}" + $pgsql_db = "youri_check_${version}" + $pgsql_server = $base::pgsql_server + $pgsql_user = "youri${version}" + $pgsql_password = extlookup('youri_pgsql','x') + # We want to alert for packages older than the cut-off for latest mass rebuild + # 1745539200 is 2025-04-25 + $max_days = (time() - 1745539200)/(24*3600) + + file { "${config}": + ensure => present, + owner => $base::user, + mode => '0640', + content => template("youri_check/${version}.conf"), + require => User[$base::user], + } + } + + + define createdb_user($version) { + $pgsql_db = "youri_check_${version}" + $pgsql_user = "youri${version}" + $pgsql_password = extlookup('youri_pgsql','x') + + postgresql::remote_user { $pgsql_user: + password => $base::pgsql_password, + } + + postgresql::remote_database { $pgsql_db: + description => "Youri Check results", + user => $pgsql_user, + } + } + + define check($version, $hour = "*", $minute = 0) { + include youri_check::base + $config = "/etc/youri/${version}.conf" + $pgsql_server = $base::pgsql_server + $pgsql_db = "youri_check_${version}" + $pgsql_user = "youri${version}" + $pgsql_password = extlookup('youri_pgsql','x') + + postgresql::remote_user { $pgsql_user: + password => $base::pgsql_password, + } + + postgresql::remote_database { $pgsql_db: + description => "Youri Check results", + user => $pgsql_user, + } + cron { "check_${version}": + command => "youri-check -c ${config} --parallel test", + hour => $hour, + minute => $minute, + user => $base::user, + environment => "MAILTO=root", + require => User[$base::user], + } + } + + define report_www { + include youri_check::base + $outdir = "/var/www/youri-check/" + apache::vhost::base { $base::vhost: + location => $outdir, + content => template('youri_check/vhost_check.conf'), + } + apache::vhost::base { "ssl_${base::vhost}": + vhost => $base::vhost, + use_ssl => true, + location => $outdir, + content => template('youri_check/vhost_check.conf'), + } + } + + define report($version, $hour = "*", $minute = 20) { + include youri_check::base + + $config = "/etc/youri/${version}.conf" + + $outdir = "/var/www/youri-check/${version}" + file { "${outdir}": + ensure => directory, + owner => $base::user, + mode => '0755', + } + + cron { "check_${version}": + command => "youri-check -c ${config} report", + hour => $hour, + minute => $minute, + user => $base::user, + require => User[$base::user], + } + } +} |
