Skip to content

Instantly share code, notes, and snippets.

@kjoconnor
Created April 24, 2012 22:50
Show Gist options
  • Save kjoconnor/2484425 to your computer and use it in GitHub Desktop.
Save kjoconnor/2484425 to your computer and use it in GitHub Desktop.
Install puppet-server on Amazon Linux
1. Paste into /etc/yum.repos.d/puppetlabs.repo
[puppetlabs]
name=Puppet Labs - $basearch
baseurl=http://yum.puppetlabs.com/el/6Server/products/$basearch
failovermethod=priority
priority=0
enabled=0
2. rpm --import http://yum.puppetlabs.com/RPM-GPG-KEY-puppetlabs
3. rpm -Uhv http://pkgs.repoforge.org/ruby-shadow/ruby-shadow-1.4.1-2.el6.rf.x86_64.rpm
4. yum --enablerepo=puppetlabs install puppet-server
@robbyt
Copy link

robbyt commented Apr 30, 2012

This code looks good- but you don't actually have to change the priority on all of the other repos to be >1, you can just set the priority of the puppetlabs repo to =0.

@kjoconnor
Copy link
Author

Thanks I've updated it!

@leddy-c3
Copy link

Any idea how to force puppet client > 3.0 install?

@leddy-c3
Copy link

Nevermind, got it.

@dawngerpony
Copy link

There's an RPM package for the puppet yum repositories, from puppetlabs:

rpm -ivh http://yum.puppetlabs.com/el/6/products/i386/puppetlabs-release-6-10.noarch.rpm

NB. You will still have to edit /etc/yum.repos.d/puppetlabs.repo to insert the following two lines under [puppetlabs-products] before the new repo will take priority over the existing Amazon Linux repos:

failovermethod=priority
priority=0

And if you are having trouble starting puppet/puppetmaster after that, try installing ruby 1.8:

yum install ruby18 ; alternatives --config ruby

NB. Solution to the above was gleaned from [Puppet Users] Puppet fails to run if ruby1.8 is not installed..

@gibas
Copy link

gibas commented Jun 5, 2014

after all above steps, you need to install also ruby-json package from puppetlabs-deps repository:

yum install ruby-json

otherwise you will see errors like:

/usr/lib/ruby/site_ruby/1.8/puppet/module.rb:3:in `require': no such file to load -- json (LoadError)
    from /usr/lib/ruby/site_ruby/1.8/puppet/module.rb:3
    from /usr/lib/ruby/site_ruby/1.8/puppet/parser/files.rb:1:in `require'
    from /usr/lib/ruby/site_ruby/1.8/puppet/parser/files.rb:1
    from /usr/lib/ruby/site_ruby/1.8/puppet/parser/templatewrapper.rb:1:in `require'
    from /usr/lib/ruby/site_ruby/1.8/puppet/parser/templatewrapper.rb:1
    from /usr/lib/ruby/site_ruby/1.8/puppet/parser/scope.rb:6:in `require'
    from /usr/lib/ruby/site_ruby/1.8/puppet/parser/scope.rb:6
    from /usr/lib/ruby/site_ruby/1.8/puppet/parser/methods.rb:2:in `require'
    from /usr/lib/ruby/site_ruby/1.8/puppet/parser/methods.rb:2
    from /usr/lib/ruby/site_ruby/1.8/puppet/parser/ast/method_call.rb:2:in `require'
    from /usr/lib/ruby/site_ruby/1.8/puppet/parser/ast/method_call.rb:2
    from /usr/lib/ruby/site_ruby/1.8/puppet/parser/ast.rb:115:in `require'
    from /usr/lib/ruby/site_ruby/1.8/puppet/parser/ast.rb:115
    from /usr/lib/ruby/site_ruby/1.8/puppet/parser/parser.rb:11:in `require'
    from /usr/lib/ruby/site_ruby/1.8/puppet/parser/parser.rb:11
    from /usr/lib/ruby/site_ruby/1.8/puppet/parser.rb:4:in `require'
    from /usr/lib/ruby/site_ruby/1.8/puppet/parser.rb:4
    from /usr/lib/ruby/site_ruby/1.8/puppet.rb:260:in `require'
    from /usr/lib/ruby/site_ruby/1.8/puppet.rb:260
    from /usr/lib/ruby/site_ruby/1.8/puppet/util/command_line.rb:12:in `require'
    from /usr/lib/ruby/site_ruby/1.8/puppet/util/command_line.rb:12
    from /usr/bin/puppet:3:in `require'
    from /usr/bin/puppet:3

@myshkin5
Copy link

It looks like ruby shadow dependency is handled automatically.

@pmoranga
Copy link

So, all steps together:

rpm -ivh http://yum.puppetlabs.com/el/6/products/i386/puppetlabs-release-6-10.noarch.rpm

yum-config-manager --enable epel
yum-config-manager --setopt="puppetlabs-products.priority=1" --save

yum -y install ruby18 rubygem18-json ruby-augeas
alternatives --set ruby /usr/bin/ruby1.8
yum -y install puppet

@pscadiz
Copy link

pscadiz commented Jul 26, 2017

Just to add, you can also install puppet-4.10 through the same method.
Only change the repo rpm to https://yum.puppetlabs.com/puppetlabs-release-pc1-el-6.noarch.rpm
and repo name would be puppetlabs-pc1 instead of puppetlabs-products

rpm -ivh https://yum.puppetlabs.com/puppetlabs-release-pc1-el-6.noarch.rpm
[...]
yum-config-manager --setopt="puppetlabs-pc1.priority=1" --save
[...]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment