Configure a node to connect to a PuppetDB

0 votes
Can somebody help me configure a puppet agent such that it connects to a PuppetDB that I have installed?
Aug 2, 2019 in Puppet by Karan
• 19,610 points
925 views

1 answer to this question.

0 votes

Step 1: Configure SSL:

PuppetDB requires client authentication (CA) for its SSL connections, and the PuppetDB-termini require SSL to talk to PuppetDB. You must configure Puppet and PuppetDB to work around this.

Set up an SSL proxy for PuppetDB

  1. Edit the jetty section of the puppetdb vonfig files to remove all SSL-related settings.

  2. Install a general-purpose web server (like Apache or NGINX) on the PuppetDB server.

  3. Configure the web server to listen on port 8081 with SSL enabled and proxy all traffic to localhost:8080 (or whatever unencrypted hostname and port were set in jetty.ini). The proxy server can use any certificate — as long as Puppet has never downloaded a CA certificate from a Puppet master, it will not verify the proxy server’s certificate. If your nodes have downloaded CA certificates, you must either make sure the proxy server’s certificate was signed by the same CA, or delete the CA certificate.

Step 2: Install terminus plugins on every Puppet node:

Currently, Puppet needs extra Ruby plugins in order to use PuppetDB. Unlike custom facts or functions, these cannot be loaded from a module and must be installed in Puppet’s main source directory.

  • First, ensure that the appropriate Puppet collection repository is enabled. You can use a package resource to do this or the apt::source (from the puppetlabs- module) and yumrepo types.

  • Next, use Puppet to ensure that the puppetdb-termini package is installed:

package {'puppetdb-termini': 
ensure => installed, }

On platforms without packages

  • If your Puppet master isn’t running Puppet from a supported package, you will need to install the plugins using file resources.

  • Download the PuppetDB source code; unzip it, locate the puppet/lib/puppet directory, and put it in the files directory of the Puppet module you are using to enable PuppetDB integration.

  • Identify the install location of Puppet on your nodes.

  • Create a file resource in your manifest(s) for each of the plugin files, to move them into place on each node.

# <modulepath>/puppetdb/manifests/terminus.pp 
class puppetdb::terminus { 
$puppetdir = "$rubysitedir/puppet"
file { $puppetdir: 
ensure => directory, 
recurse => remote, # Copy these files without deleting the existing files 
source => "puppet:///modules/puppetdb/puppet", 
owner => root, 
group => root, 
mode => 0644,
} 
}

Step 3: Manage configuration files on every Puppet node:

All of the config files you need to manage will be in Puppet’s config directory (confdir). When managing these files with puppet apply, you can use the $settings::confdir variable to automatically discover the location of this directory.

Manage puppetdb.conf, puppet.conf, routes.yaml.

On how to manage these files have a look at: https://puppet.com/docs/puppetdb/5.2/connect_puppet_apply.html

answered Aug 2, 2019 by Sirajul
• 59,230 points

Related Questions In Puppet

0 votes
0 answers
0 votes
1 answer

Puppet: How can i connect the puppet server to an external node classifier?

You need to configure two settings to ...READ MORE

answered Aug 2, 2019 in Puppet by Sirajul
• 59,230 points
1,066 views
0 votes
1 answer

Puppetfile to configure/install a module

The Puppetfile is like a Ruby Gemfile, ...READ MORE

answered Aug 6, 2019 in Puppet by Sirajul
• 59,230 points
1,895 views
0 votes
1 answer

How can i know the time as to when exactly did a node join puppet?

Puppet does not itself keep any timestamp ...READ MORE

answered Aug 8, 2019 in Puppet by Sirajul
• 59,230 points
725 views
+15 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 27, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
4,040 views
+2 votes
1 answer
0 votes
1 answer

How to connect my puppet master to PuppetDB?

Working on your Puppet master server(s), follow all ...READ MORE

answered Jul 30, 2019 in Puppet by Sirajul
• 59,230 points
1,855 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP