Posts

Showing posts with the label json

Featured Post

Directory environments in Puppet

Environments are individual groups of Puppet agents each environment have there own completely different manifests and module-paths. This basically is useful for testing changes to our Puppet code before implementing them on production machines. There are two types of implementation of environments structure in Puppet one if directory based and another is config file based here we will see bit of an insight about directory based. As usual for more information about this you can visit puppetlabs official website. On the master node: Append following details in puppet.conf which is placed under /etc/puppet or /etc/puppetlabs/puppet:     Under [main] section add a variable called confdir with value as /etc/puppet or /etc/puppetlabs/puppet     confdir=/etc/puppet Then add information regarding environments/manifests and modulepath in it.      #environments     environmentpath = $confdir/environments  ...

Facter???

Facter is a utility which collects and displays facts about the system such as operatingsystem, ip, MAC address, machine's hardware information. Point to note: If no specific facts are specifically asked for, then all facts will be returned. We can add our custom facts too. [root@rhel6 ~]# facter architecture => x86_64 augeasversion => 0.9.0 domain => sunny.com facterversion => 1.6.18 fqdn => rhel6.sunny.com hardwareisa => x86_64 hardwaremodel => x86_64 hostname => rhel6 id => root interfaces => eth1,lo ipaddress => 192.168.122.173 ipaddress_eth1 => 192.168.122.173 ipaddress_lo => 127.0.0.1 ............ ............ [root@rhel6 ~]# Now suppose you just need to see the hostname via facter command. [root@rhel6 ~]# facter hostname rhel6 [root@rhel6 ~]# It works well with grep command too. [root@rhel6 ~]# facter | grep memory memoryfree => 188.36 MB memorysize => 280.95 MB memorytotal => 280.95 MB [root@rhel6 ~]# The ...