/[adm]/puppet/modules/youri-check/manifests/init.pp
ViewVC logotype

Annotation of /puppet/modules/youri-check/manifests/init.pp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3307 - (hide annotations) (download)
Thu Jul 25 22:09:21 2013 UTC (10 years, 10 months ago) by boklm
File size: 2562 byte(s)
youri-check: add ssl vhost
1 pterjan 1364 class youri-check {
2 pterjan 1447 class base {
3 misc 1371 $vhost = "check.$domain"
4 pterjan 1447 $user = 'youri'
5 boklm 2027 $home = '/var/lib/youri'
6 pterjan 1364
7 pterjan 1447 user { $user:
8     comment => 'Youri Check',
9     home => $home,
10     }
11 pterjan 1364
12 boklm 2027 file { $home:
13     ensure => directory,
14     owner => $user,
15     group => $user,
16     }
17    
18 pterjan 2418 $pgsql_server = "$vhost"
19    
20     package { ['youri-check', 'perl-DBD-Pg', 'perl-Youri-Media']: }
21    
22 pterjan 1447 }
23    
24 pterjan 2418 define config($version) {
25 pterjan 2421 include youri-check::base
26    
27 pterjan 2418 $config = "/etc/youri/$version.conf"
28     $outdir = "/var/www/youri-check/$version"
29     $pgsql_db = "youri_check_$version"
30     $pgsql_server = $base::pgsql_server
31     $pgsql_user = "youri$version"
32     $pgsql_password = extlookup('youri_pgsql','x')
33 pterjan 1364
34 pterjan 2418 file { "$config":
35     ensure => present,
36     owner => $base::user,
37     mode => 640,
38     content => template("youri-check/$version.conf"),
39 boklm 2858 require => User[$base::user],
40 pterjan 2418 }
41 pterjan 1364 }
42    
43 pterjan 2418 define check($version, $hour = "*", $minute = 0) {
44     include youri-check::base
45     $config = "/etc/youri/$version.conf"
46     $pgsql_server = $base::pgsql_server
47     $pgsql_db = "youri_check_$version"
48     $pgsql_user = "youri$version"
49     $pgsql_password = extlookup('youri_pgsql','x')
50 pterjan 1368
51 misc 1767 postgresql::remote_user { $pgsql_user:
52 pterjan 2418 password => $base::pgsql_password,
53 misc 1767 }
54    
55     postgresql::remote_database { $pgsql_db:
56     description => "Youri Check results",
57     user => $pgsql_user,
58     }
59 pterjan 2418 cron { "check_$version":
60     command => "youri-check -c $config test",
61     hour => $hour,
62     minute => $minute,
63     user => $base::user,
64     environment => "MAILTO=root",
65 boklm 2858 require => User[$base::user],
66 pterjan 2418 }
67     }
68 misc 1767
69 pterjan 2418 define report_www {
70     include youri-check::base
71     $outdir = "/var/www/youri-check/"
72 boklm 3307 apache::vhost::base { $base::vhost:
73 pterjan 2418 location => $outdir,
74     }
75 boklm 3307 apache::vhost::base { "ssl_${base::vhost}":
76     vhost => $base::vhost,
77     use_ssl => true,
78     location => $outdir,
79     }
80 pterjan 2418 }
81 pterjan 1447
82 pterjan 2418 define report($version, $hour = "*", $minute = 20) {
83     include youri-check::base
84    
85     $config = "/etc/youri/$version.conf"
86    
87     $outdir = "/var/www/youri-check/$version"
88     file { "$outdir":
89     ensure => directory,
90     owner => $base::user,
91 pterjan 2420 mode => 755,
92 pterjan 1447 }
93    
94 pterjan 2418 cron { "check_$version":
95     command => "youri-check -c $config report",
96     hour => $hour,
97     minute => $minute,
98     user => $base::user,
99 boklm 2858 require => User[$base::user],
100 pterjan 1368 }
101 pterjan 1364 }
102     }

  ViewVC Help
Powered by ViewVC 1.1.30