![1 Star 1 Star](https://i0.wp.com/www.devtech101.com/wp-content/plugins/wp-postratings/images/stars_crystal/rating_on.gif?w=1200&ssl=1)
![2 Stars 2 Stars](https://i0.wp.com/www.devtech101.com/wp-content/plugins/wp-postratings/images/stars_crystal/rating_off.gif?w=1200&ssl=1)
![3 Stars 3 Stars](https://i0.wp.com/www.devtech101.com/wp-content/plugins/wp-postratings/images/stars_crystal/rating_off.gif?w=1200&ssl=1)
![4 Stars 4 Stars](https://i0.wp.com/www.devtech101.com/wp-content/plugins/wp-postratings/images/stars_crystal/rating_off.gif?w=1200&ssl=1)
![5 Stars 5 Stars](https://i0.wp.com/www.devtech101.com/wp-content/plugins/wp-postratings/images/stars_crystal/rating_off.gif?w=1200&ssl=1)
![](https://i0.wp.com/www.devtech101.com/wp-content/plugins/wp-postratings/images/loading.gif?resize=16%2C16&ssl=1)
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