Skip to content

Commit 9726c2a

Browse files
author
Kevin Paulisse
committed
Add notes about puppetdb-termini gem and defaults for example config
1 parent 68b4977 commit 9726c2a

3 files changed

Lines changed: 39 additions & 0 deletions

File tree

doc/configuration-puppet.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Configuring octocatalog-diff to use Puppet
2+
3+
The most common use of `octocatalog-diff` is to use `puppet` locally to compile catalogs.
4+
5+
In order to successfully use Puppet to compile catalogs:
6+
7+
0. Puppet must be installed on the system.
8+
9+
It is the goal of `octocatalog-diff` to support Puppet version 3.8 and higher, installed via any means supported by Puppet. This includes the [All-In-One agent package](https://docs.puppet.com/puppet/4.0/reference/release_notes.html#all-in-one-packaging) or installed as a Ruby gem.
10+
11+
By default, `octocatalog-diff` will look for the Puppet binary in several common system locations.
12+
13+
For maximum reliability, you can specify the full path to the Puppet binary in the configuration file. For example:
14+
15+
```
16+
##############################################################################################
17+
# puppet_binary
18+
# This is the full path to the puppet binary on your system. If you don't specify this,
19+
# the tool will just run 'puppet' and hope to find it in your path.
20+
##############################################################################################
21+
22+
# settings[:puppet_binary] = '/usr/bin/puppet'
23+
settings[:puppet_binary] = '/opt/puppetlabs/puppet/bin/puppet'
24+
```
25+
26+
0. Applies if you are using [exported resources](https://docs.puppet.com/puppet/latest/reference/lang_exported.html) from PuppetDB (i.e., the octocatalog-diff `--storeconfigs` option enabled):
27+
28+
Your Puppet installation must have the `puppetdb-termini` gem available. This gem may not be included by default with the Puppet agent package.
29+
30+
Consult the [Connecting Puppet masters to PuppetDB](https://docs.puppet.com/puppetdb/latest/connect_puppet_master.html#step-1-install-plug-ins) documentation for instructions on installing the `puppetdb-termini` gem.

doc/configuration.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
- [Configuring octocatalog-diff to use Hiera](/doc/configuration-hiera.md)
4040
- [Configuring octocatalog-diff to use ENC](/doc/configuration-enc.md)
4141
- [Configuring octocatalog-diff to use PuppetDB](/doc/configuration-puppetdb.md)
42+
- [Configuring octocatalog-diff to use Puppet](/doc/configuration-puppet.md)
4243
4344
0. Test the configuration, which will indicate the location of the configuration file and validate the contents thereof.
4445

examples/octocatalog-diff.cfg.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,14 @@ def self.config
141141
# the tool will just run 'puppet' and hope to find it in your path.
142142
##############################################################################################
143143

144+
# These are some common defaults. We recommend removing this and setting explicitly below.
145+
puppet_may_be_in = %w(/opt/puppetlabs/puppet/bin/puppet /usr/bin/puppet /usr/local/bin/puppet)
146+
puppet_may_be_in.each do |path|
147+
next unless File.executable?(path)
148+
settings[:puppet_binary] = path
149+
break
150+
end
151+
144152
# settings[:puppet_binary] = '/usr/bin/puppet'
145153
# settings[:puppet_binary] = '/opt/puppetlabs/puppet/bin/puppet'
146154

0 commit comments

Comments
 (0)