1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
# File 'manifests/viewer.pp', line 1
class catalog_diff::viewer (
String $remote = 'https://github.com/camptocamp/puppet-catalog-diff-viewer.git',
String $password = 'puppet',
String $revision = 'master',
Integer $port = 1495,
String $listen_ip = $facts['networking']['ip'],
) {
require git
class { 'apache':
default_vhost => false,
default_ssl_vhost => false,
}
apache::vhost { "${listen_ip}:${port}":
servername => $facts['networking']['fqdn'],
ip => $listen_ip,
docroot => '/var/www/diff',
ip_based => true,
directories => [
{ path => '/var/www/diff',
auth_type => 'Basic',
auth_name => 'Catalog Diff',
auth_user_file => '/var/www/.htpasswd',
auth_group_file => '/dev/null',
auth_require => 'valid-user',
allow_override => 'AuthConfig',
},
],
priority => '15',
require => Htpasswd['puppet'],
port => $port,
add_listen => true,
}
htpasswd { 'puppet':
username => 'puppet',
cryptpasswd => ht_crypt($password, $facts['dmi']['product']['uuid']),
target => '/var/www/.htpasswd',
}
include apache::params
file { '/var/www/.htpasswd':
ensure => 'file',
owner => $apache::params::user,
group => $apache::params::group,
mode => '0700',
before => Htpasswd['puppet'],
}
vcsrepo { '/var/www/diff':
ensure => latest,
provider => 'git',
source => $remote,
revision => $revision,
}
}
|