public
Last active

Puppet Module : No Code In Data ~ using PuppetDB in masterless puppet

  • Download Gist
$conf_dir puppet.conf
1 2 3 4 5
[main]
storeconfigs = true
storeconfigs_backend = puppetdb
reports = store,puppetdb
pluginsync = true
$conf_dir puppetdb.conf
1 2 3
[main]
server = $FQDN
port = 8081
$conf_dir routes.yaml
YAML
1 2 3 4
apply:
facts:
terminus: facter
cache: facter
prepare_puppetdb.sh
Shell
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
# to download puppetdb and dependent puppet modules
puppet module install puppetlabs/puppetdb
 
# to install puppetdb and default postgresql
puppet apply -e "class { 'puppetdb': }"
puppet apply -e "package{ 'puppetdb-terminus': }"
 
# backing up ssl dirs if they exist
if [ -d /etc/puppet/ssl ]; then
mv /etc/puppet/ssl /etc/puppet/ssl.bak
fi
if [ -d /etc/puppetdb/ssl ]; then
mv /etc/puppetdb/ssl /etc/puppetdb/ssl.bak
fi
 
# Fixing CA usage as masterless
FQDN=`facter fqdn`
puppet cert generate $FQDN
puppetdb-ssl-setup -f
 
# adding FQDN to IP host mapping at PuppetDB and all nodes used
IPADDRESS=`facter ipaddress`
echo "$IPADDRESS $FQDN" >> /etc/hosts
 
# /sbin/service or whatever service command you use
/sbin/service puppetdb restart

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.