Below you will find how to install & configure Puppet server on Solaris.
Part of my DevOps effort I am testing Puppet and Chef server, especially how they work with a Solaris environment.
Note: Part of the documentation below is Solaris specific This guide is using puppet version 4.7
How to install puppet (server and or client)
1 |
pkg install puppet |
Note:The below install is needed for hiera
1 |
gem install json_pure |
To configure the server
1 2 |
svccfg -s puppet:master setprop config/server=devtech101.com svccfg -s puppet:master refresh |
Now enable the server
1 2 3 |
svcadm enable svc:/application/puppet:master svcadm enable svc:/application/puppet:user svcadm enable svc:/application/puppet:main |
To configure the client run on the client
1 2 |
svccfg -s puppet:agent setprop config/server=devtech101.com svccfg -s puppet:agent refresh |
To use the agent you need to check in, and then sign the cert.
1 2 3 4 5 |
# Check an initial agent check in. puppet agent --test # On the server sign the cert puppet cert sign client1.devtech101.com |
Now enable the agent on the client
1 |
svcadm enable svc:/application/puppet:agent |
Now lets configure the manifest and client structure
1 2 3 4 |
# Create directory structure mkdir -p /etc/puppetlabs/code/environments/production/manifests/classes mkdir -p /etc/puppetlabs/code/environments/production/modules mkdir -p /etc/puppetlabs/code/environments/production/hieradata/nodes |
Create global site.pp main manifest file
Note: The modules directory name has to be all lowercase
The example below uses default (empty), and two nodes defined, more below.
1 2 3 4 5 6 7 8 9 10 |
cat /etc/puppetlabs/code/environments/production/manifests/site.pp node default { } node 'client1.devtech101.com', 'client2.devtech101.com' { # classes example include create_zfs include create_file # module example include extrafiles } |
The below example will create the zfs file system (using the build in zfs module), and will create the file “example-ip-file” in /tmp
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
cat /etc/puppetlabs/code/environments/production/manifests/classes/create_zfs.pp class create_zfs { zfs { 'rpool/test': ensure => 'present', readonly => 'on', } } class create_file { file {'/tmp/example-ip-file': ensure => present, mode => '0644', content => "Here is my Public IP Address: 10.10.10.10.\n" } } |
Modules are very similar, create a file under modules > [module_name] > manifests > init.pp
1 2 3 4 5 6 7 8 |
cat /etc/puppetlabs/code/environments/production/modules/extrafiles/manifests/init.pp class extrafiles { file {'/var/tmp/file1': ensure => present, mode => '0644', content => "Elis file\n", } } |
Leave a Reply