Created
January 6, 2014 07:49
-
-
Save danieldreier/8279545 to your computer and use it in GitHub Desktop.
Puppet manifest to install librarian-puppet as part of bootstrapping puppet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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