Skip to content

Commit be5143f

Browse files
authored
README.md: Add more PuppetDB examples & simplify puppet apply example (#882)
1 parent c947152 commit be5143f

File tree

1 file changed

+46
-3
lines changed

1 file changed

+46
-3
lines changed

README.md

Lines changed: 46 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,50 @@ class { 'puppet::server::puppetdb':
7171
}
7272
```
7373

74+
Above example manages Puppetserver + PuppetDB integration. It won't install the
75+
PuppetDB. To do so, you also need the `puppetdb` class
76+
77+
```puppet
78+
class { 'puppet':
79+
server => true,
80+
server_reports => 'puppetdb,foreman',
81+
server_storeconfigs => true,
82+
}
83+
include puppetdb
84+
class { 'puppet::server::puppetdb':
85+
server => 'mypuppetdb.example.com',
86+
}
87+
```
88+
89+
Then the PuppetDB module will also configure postgresql and setup the database.
90+
If you want to manage postgresql installation on your own:
91+
92+
```puppet
93+
class { 'postgresql::globals':
94+
encoding => 'UTF-8',
95+
locale => 'en_US.UTF-8',
96+
version => '15',
97+
manage_package_repo => true,
98+
}
99+
class { 'postgresql::server':
100+
listen_addresses => '127.0.0.1',
101+
}
102+
postgresql::server::extension { 'pg_trgm':
103+
database => 'puppetdb',
104+
require => Postgresql::Server::Db['puppetdb'],
105+
before => Service['puppetdb'],
106+
}
107+
class { 'puppetdb':
108+
manage_dbserver => false,
109+
}
110+
class { 'puppet::server::puppetdb':
111+
server => 'mypuppetdb.example.com',
112+
}
113+
```
114+
115+
Above code will install Puppetserver/PuppetDB/PostgreSQL on a single server. It
116+
will use the upstream postgresql repositories. It was tested on Ubuntu.
117+
74118
Please also make sure your puppetdb ciphers are compatible with your puppet server ciphers, ie that the two following parameters match:
75119
```
76120
puppet::server::cipher_suites
@@ -136,10 +180,9 @@ To use this in standalone mode, edit a file (e.g. install.pp), put in a class re
136180
as per the examples above, and the execute _puppet apply_ e.g:
137181

138182
```sh
139-
cat > install.pp <<EOF
140-
class { '::puppet': server => true }
183+
puppet apply --modulepath /path_to/extracted_tarball <<EOF
184+
class { 'puppet': server => true }
141185
EOF
142-
puppet apply install.pp --modulepath /path_to/extracted_tarball
143186
```
144187

145188
# Advanced scenarios

0 commit comments

Comments
 (0)