Posts

Showing posts from March, 2016

Creating/Managing Unix user accounts using Puppet user resource

Puppet comes with a builtin user resource which installs and manages unix user accounts. More of this resource is available at
https://docs.puppetlabs.com/puppet/latest/reference/types/user.html

A user resource with some of its attributes are

user { 'resource title': name => # (namevar) The user name. While naming limitations vary by...ensure => # The basic state that the object should be in....comment => # A description of the user. Generally the user's expiry => # The expiry date for this user. Must be provided...gid => # The user's primary group. Can be specified...groups => # The groups to which the user belongs. The...home => # The home directory of the user. The directory...managehome => # Whether to manage the home directory when...password => # The user's password, in whatever encrypted...password_max_ag…

Installing/Updating Cron entries using Puppet Cron Resource

Puppet comes with a builtin cron resource which installs and manages cron entries. More of this resource is available at
https://docs.puppetlabs.com/puppet/latest/reference/types/cron.html

A cron resource with some of its attributes are

cron { 'resource title': name => # The symbolic name of the cron job. ensure => # The basic property that the resource should be...command => # The command to execute in the cron job. environment => # Any environment settings associated with this...hour => # The hour at which to run the cron job. Optional; minute => # The minute at which to run the cron job...month => # The month of the year. Optional; if specified...monthday => # The day of the month on which to run the...provider => # The specific backend to use for this `cron...special => # A special value such as 'reboot' or 'annually'...target => # The name of the crontab file in which the c…

Installing/Updating /etc/hosts file using hosts Puppet Resource

Puppet comes with a builtin hosts resource which installs and manages host entries. More of this resource is available at
https://docs.puppetlabs.com/puppet/latest/reference/types/host.html

A host resource will look like this

host { 'resource title':
 name      => # (namevar) The host...
 ensure    => # The basic property that the resource should be..
 comment   => # A comment that will be attached to the line with
 host_aliases => # Any aliases the host might have.  Multiple...
 ip          => # The host's IP address, IPv4 or...
 provider    => # The specific backend to use for this `host...
 target      => #The file in which to store service information. 
  # ...plus any applicable metaparameters.
}


An example of hosts resource is as shown below


node 'node2.example.com','node3.example.com'{
host {
        'localhost.localdomain':
        ip => '127.0.0.1',
        host_aliases => 'localhost',
        ensure => 'pre…

Installing and Configuring Puppet from Source

               Installing and Configuring Puppet from SourceDependencies:
Puppet has the following dependencies:
1. Ruby  2. Facter 3. Hiera 4. JSON library

Installing Ruby

Ruby comes bundled with RedHat systems , so we can install it using YUM.We will see how to install rest of the dependencies from Source Code. To install rest of the dependencies , we will need ruby first. Assuming we successfully installed ruby related packages using YUM.

$yum install ruby

Installing JSON libabry

1.   Download JSON from the following location
http://www.ping.de/~flori

2.   Installing JSON

tar xvf  json-1.5.3.tgz
                 cd json-1.5.3
                 ruby install.rb


Installing Hiera

1.   Download Hiera from the following location              
https://downloads.puppetlabs.com/

2.   Installing Hiera

tar zxvf hiera-3.0.6.tar.gz
                cd hiera-3.0.6
                ruby install.rb

Installing facter

1. Download facter from the following location   
https://downloads.puppetlabs.com/

2. Install facter

tar zxv…