Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- First install Puppet Platform:
- *** Debian 9
- wget https://apt.puppetlabs.com/puppet6-release-stretch.deb
- dpkg -i puppet6-release-stretch.deb
- apt-get update
- ***
- For other linux distros, look at
- https://puppet.com/docs/puppet/6.0/puppet_platform.html
- Install Puppet Agent:
- *** Apt-based systems
- apt-get install puppet-agent
- ***
- For other systems, look at
- https://puppet.com/docs/puppet/6.0/install_linux.html
- Start puppet and ensure running:
- ***
- /opt/puppetlabs/bin/puppet resource service puppet ensure=running enable=true
- ***
- Install PuppetDB:
- ***
- /opt/puppetlabs/bin/puppet resource package puppetdb ensure=latest
- ***
- Install Postgresql
- ***
- apt install postgresql postgresql-contrib
- ***
- To check version of postgresql
- ***
- sudo -u postgres psql -c "SELECT version();"
- ***
- This also means you've got a new user called "postgres".
- You now have log in to "postgres". From root, it's just
- ***
- su - postgres
- ***
- Install pg_trgm
- ***
- psql
- CREATE EXTENSION pg_trgm;
- \q
- ***
- "psql" puts you in the postgresql console.
- "\q" quits the console,
- Thereafter, you need to create a user and database for puppetDB, and set it to use UTF8
- ***
- createuser -DRSP puppetdb
- createdb -O puppetdb puppetdb
- /usr/lib/postgresql/9.6/bin/initdb -E UTF8 -D puppetdb
- ***
- Edit /etc/postgresql/9.6/main/pg_hba.conf
- We need to allow md5 authentication. Edit line 90 from
- local all all peer
- to
- local all all md5
- Restart PostgreSQL and ensure you can log in by running
- ***
- service postgresql restart
- psql -h localhost puppetdb puppetdb
- ***
- Now quit the console ("\q").
- Configure puppetDB to use the postgresql database.
- This is to be done in /etc/puppetlabs/puppetdb/conf.d/databse.ini
- Add the following lines:
- ***
- subname = //lcoalhost:5432/puppetdb
- username = puppetdb
- password = Pupp37
- ***
- Make sure the host, port, and database are the correct ones.
- To figure out the port:
- ***
- netstat -plunt |grep postgres
- ***
- This should be it for puppetdb. If you wish to configure [many] more settings, look at https://puppet.com/docs/puppetdb/6.0/configure.html
- Now to configure the puppet master to use puppetdb.
- Install the puppetdb-termini package:
- ***
- /opt/puppetlabs/bin/puppet resource package puppetdb-termini ensure=latest
- ***
- Go into /etc/puppetlabs/puppet. We need to edit/create three files in here.
- Check whether "puppetdb.conf" exists; if not, do
- ***
- touch puppetdb.conf
- ***
- This creates a file.
- In here, we need to add the URL of puppetDB's URL (remember to have it in a DNS either now or later).
- Add the following lines:
- ***
- [main]
- server_urls = https://intern:8081
- *** (This is the server name for the puppet master where everything is installed.)
- HTTPS is *required*.
- Remember to change accordingly.
- If you want to check on more settings, look at: https://puppet.com/docs/puppetdb/6.0/puppetdb_connection.html
- Edit puppet.conf.
- To enable saving facts and catalogs in PuppetDB, edit the [master] block of puppet.conf to reflect the following settings:
- ***
- [master]
- storeconfigs = true
- storeconfigs_backend = puppetdb
- ***
- Note: The thin_storeconfigs and async_storeconfigs settings should be absent or set to false. If you previously used the Puppet queue daemon (puppetqd), you should now disable it.
- Check wheter "routes.yaml" exists; if not, do
- ***
- touch routes.yaml
- ***
- In that file, add the following lines:
- ***
- ---
- master:
- facts:
- terminus: puppetdb
- cache: yaml
- ***
- The files created above need to be owned by the puppet user. Ensure that this ownership is applied by running the following command:
- ***
- chown -R puppet:puppet `sudo /opt/puppetlabs/puppet/bin/puppet config print confdir`
- ***
- Now install and re/start puppet and puppetserver:
- ***
- apt install puppetserver
- systemctl restart puppet puppetserver
- ***
- And turn on puppetdb and ensure running:
- ***
- /opt/puppetlabs/puppet/bin/puppet resource service puppetdb ensure=running enable=true
- ***
- This might take a while, so consider using "screen", to avoid "ssh broken pipes".
- That's it! Puppet, puppetserver and puppetdb are now running!
Advertisement
Add Comment
Please, Sign In to add comment