Skip to content
This repository was archived by the owner on Mar 28, 2019. It is now read-only.

Commit df39709

Browse files
committed
Merge pull request #128 from danieldreier/switch_to_pl_puppetdb
Add basic puppetlabs-puppetdb module integration, deprecate storeconfigs option
2 parents 583b20a + fca0c2b commit df39709

File tree

4 files changed

+49
-18
lines changed

4 files changed

+49
-18
lines changed

.fixtures.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ fixtures:
1818
apache: "git://github.com/puppetlabs/puppetlabs-apache.git"
1919
portage: "git://github.com/gentoo/puppet-portage.git"
2020
thin: "git://github.com/danieldreier/puppet-thin.git"
21+
puppetdb: "https://github.com/puppetlabs/puppetlabs-puppetdb.git"
2122
symlinks:
2223
puppet: "#{source_dir}"
2324

Modulefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,4 @@ dependency 'puppetlabs/apache', '>= 0.9.0'
1717
dependency 'gentoo/portage', '>= 2.1.0'
1818
dependency 'jfryman/nginx', '<= 0.0.10'
1919
dependency 'danieldreier/thin'
20+
dependency 'puppetlabs/puppetdb', '>= 4.1.0'

manifests/server.pp

Lines changed: 29 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -27,30 +27,31 @@
2727
# }
2828
#
2929
class puppet::server (
30-
$modulepath = ['$confdir/modules/site', '$confdir/env/$environment/dist'],
31-
$manifest = '$confdir/modules/site/site.pp',
32-
$environmentpath = undef,
33-
$config_version_cmd = '/usr/bin/git --git-dir $confdir/environments/$environment/.git rev-parse --short HEAD 2>/dev/null || echo',
34-
$storeconfigs = undef,
35-
$report = true,
36-
$reports = ['store', 'https'],
37-
$reporturl = "http://${::fqdn}/reports",
38-
$reportfrom = undef,
39-
$servertype = 'unicorn',
40-
$serverssl_protos = undef,
41-
$serverssl_ciphers = undef,
42-
$ca = false,
30+
$autosign = undef,
4331
$bindaddress = '0.0.0.0',
32+
$ca = false,
33+
$config_version_cmd = '/usr/bin/git --git-dir $confdir/environments/$environment/.git rev-parse --short HEAD 2>/dev/null || echo',
34+
$dns_alt_names = undef,
4435
$enc = '',
4536
$enc_exec = '',
46-
$servername = undef,
4737
$ensure = 'present',
48-
$parser = undef,
49-
$gentoo_use = $puppet::params::master_use,
38+
$environmentpath = undef,
5039
$gentoo_keywords = $puppet::params::master_keywords,
40+
$gentoo_use = $puppet::params::master_use,
5141
$manage_package = true,
52-
$dns_alt_names = undef,
53-
$autosign = undef,
42+
$manifest = '$confdir/modules/site/site.pp',
43+
$modulepath = ['$confdir/modules/site', '$confdir/env/$environment/dist'],
44+
$parser = undef,
45+
$manage_puppetdb = undef,
46+
$report = true,
47+
$reportfrom = undef,
48+
$reports = ['store', 'https'],
49+
$reporturl = "http://${::fqdn}/reports",
50+
$servername = undef,
51+
$serverssl_ciphers = undef,
52+
$serverssl_protos = undef,
53+
$servertype = 'unicorn',
54+
$storeconfigs = undef,
5455
) inherits puppet::params {
5556

5657
$master = true
@@ -104,9 +105,19 @@
104105
# ---
105106
# Storeconfigs
106107
if $storeconfigs {
108+
notify { 'storeconfigs is deprecated. Use manage_puppetdb setting.': }
107109
class { 'puppet::storeconfig':
108110
backend => $storeconfigs,
109111
}
110112
}
111113

114+
# enable basic puppetdb using the puppetlabs-puppetdb module
115+
# this will also install postgresql
116+
# for more detailed control over puppetdb settings, use the puppetdb
117+
# module directly rather than having puppet-puppet include it.
118+
if $manage_puppetdb == true {
119+
include puppetdb
120+
include puppetdb::master::config
121+
}
122+
112123
}

tests/unicorn_with_puppetdb.pp

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
class { '::puppet::server':
2+
modulepath => [
3+
'$confdir/modules',
4+
'$confdir/environments/$environment/modules/site',
5+
'$confdir/environments/$environment/modules/site/dist',
6+
'$confdir/environments/$environment/modules/site/dist',
7+
],
8+
manage_puppetdb => true,
9+
reporturl => "https://${::fqdn}/reports",
10+
servertype => 'unicorn',
11+
manifest => '$confdir/environments/$environment/site.pp',
12+
ca => true,
13+
reports => [
14+
'https',
15+
'store',
16+
'puppetdb',
17+
],
18+
}

0 commit comments

Comments
 (0)