Nerdier

Adjective: Comparative form of nerdy: more nerdy.

Installing the puppet agent from rubygems.

The method I used to install the puppet agent on a server via ruby gems, as the client server requires a newer version of ruby than what puppet uses with packages.

Your mileage might vary if followed as puppetlabs documentation says “not recommended”!

Find the ruby version.

 which ruby
 /usr/local/rvm/rubies/ruby-2.1.0/bin/ruby

Install puppet from gem.

 gem install puppet
 Fetching: facter-2.2.0.gem (100%)
 Successfully installed facter-2.2.0
 Fetching: json_pure-1.8.1.gem (100%)
 Successfully installed json_pure-1.8.1
 Fetching: hiera-1.3.4.gem (100%)
 Successfully installed hiera-1.3.4
 Fetching: puppet-3.7.1.gem (100%)
 Successfully installed puppet-3.7.1
 Parsing documentation for facter-2.2.0
 Installing ri documentation for facter-2.2.0
 Parsing documentation for hiera-1.3.4
 Installing ri documentation for hiera-1.3.4
 Parsing documentation for json_pure-1.8.1
 Installing ri documentation for json_pure-1.8.1
 Parsing documentation for puppet-3.7.1
 Installing ri documentation for puppet-3.7.1
 Done installing documentation for facter, hiera, json_pure, puppet after 88 seconds
 4 gems installed

Find the puppet bin path.

 which puppet
 /usr/local/rvm/gems/ruby-2.1.0/bin/puppet

Add the default config.

 wget -O /etc/sysconfig/puppet https://raw.githubusercontent.com/puppetlabs/puppet/master/ext/redhat/client.sysconfig

Edit /etc/sysconfig/puppet to specify the puppetmaster.

PUPPET_SERVER=puppetmaster.domain.tld

Create the puppet etc directory.

 mkdir -p /etc/puppet

Add the default puppet.conf

 wget -O /etc/puppet/puppet.conf https://raw.githubusercontent.com/puppetlabs/puppet/master/ext/redhat/puppet.conf

Add the init file.

 wget -O /etc/init.d/puppet https://raw.githubusercontent.com/puppetlabs/puppet/master/ext/redhat/client.init

Edit the init file.

Add the ruby bin path to the PATH

PATH=/usr/bin:/sbin:/bin:/usr/sbin:/usr/local/rvm/gems/ruby-2.1.0/bin/

Change “puppetd=${PUPPETD-/usr/bin/puppet}” to the path specifed earlier.

 puppetd=${PUPPETD-/usr/local/rvm/gems/ruby-2.1.0/bin/puppet}

Make the init file executable.

 chmod +x /etc/init.d/puppet

Edit the puppet bin file

 nano /usr/local/rvm/gems/ruby-2.1.0/bin/puppet

and change the top lineĀ  (using the ruby path you got earlier) to:

 #!/usr/bin/env /usr/local/rvm/rubies/ruby-2.1.0/bin/ruby

Then restart puppet

 /etc/init.d/puppet

and do the cert signing etc as normal.

Leave a Reply

Your email address will not be published. Required fields are marked *