(1 votes, average: 1.00 out of 5)
Loading...
This is the second post on how to configure the Puppet server/client on Solaris.
The Solaris Puppet configuration is mostly the same as the regular Puppet, but with a few exceptions.
If you like to know how to install puppet (server or client) on Solaris, please read part one.
Puppet Hiera beginners help
First lets add a new facts to facter
cat /usr/puppetlabs/puppet/modules/stdlib/lib/facter/env.rb Facter.add('environment') do setcode do environment = "production" end endNow lets verify the new fact
facter -p environment productionNow lets configure hiera How to use hiera Create a yaml file in /etc/puppetlabs/puppet
cat /etc/puppetlabs/puppet/hiera.yaml --- :backends: - yaml - json :hierarchy: - "%{osfamily}" - common :yaml: :datadir: /etc/puppetlabs/code/environments/%{environment}/hieradata/ :json: :datadir: /etc/puppetlabs/code/environments/%{environment}/hieradata/Next configure/add a fact to hiera
cat /etc/puppetlabs/code/environments/production/hieradata/Solaris.yaml --- sshservicename: ssh cat /etc/puppetlabs/code/environments/production/hieradata/RedHat.yaml --- sshservicename: sshdNow lets verify if it works, the below should return ssh or sshd based on OS.
hiera -d -c hiera.yaml sshservicename environment=production osfamily=Solaris DEBUG: 2017-02-20 14:55:35 -0500: Hiera YAML backend starting DEBUG: 2017-02-20 14:55:35 -0500: Looking up sshservicename in YAML backend DEBUG: 2017-02-20 14:55:35 -0500: Looking for data source Solaris DEBUG: 2017-02-20 14:55:35 -0500: Found sshservicename in Solaris sshAnther way to test hiera lookups.
puppet lookup --environmentpath /etc/puppetlabs/puppet sshservicenameTo update the agent with new data just run
puppet agent --test
If you like to know how to install puppet (server or client) on Solaris, please read part one.
Puppet Hiera beginners help
0
0
votes
Article Rating