Skip to content

Instantly share code, notes, and snippets.

@danieldreier
Created January 6, 2014 07:49
Show Gist options
  • Save danieldreier/8279545 to your computer and use it in GitHub Desktop.
Save danieldreier/8279545 to your computer and use it in GitHub Desktop.
Puppet manifest to install librarian-puppet as part of bootstrapping puppet
node default {
package { 'rubygems': ensure => 'installed' }
package { 'librarian-puppet':
ensure => 'installed',
provider => 'gem',
require => Package['rubygems'],
}
# Run librarian-puppet if Puppetfile changed
file { '/etc/puppet/Puppetfile':
mode => '0644',
owner => root,
group => root,
# /opt/puppet is my puppet git repo
# with vagrant, mount your puppet root here
source => '/opt/puppet/Puppetfile';
}
# Run librarian-puppet only if the Puppetfile changed
# Puppet-librarian is slow, so this helps a lot
exec { 'run librarian-puppet':
environment => ['HOME=/root'],
command => '/usr/bin/librarian-puppet install',
cwd => '/etc/puppet',
refreshonly => true,
subscribe => File['/etc/puppet/Puppetfile'],
path => '/usr/bin:/usr/sbin:/bin',
require => [ File['/etc/puppet/Puppetfile'],
Package['librarian-puppet'], ],
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment