public
Last active

Initialization puppet script for puppetmasterless puppet setup.

  • Download Gist
initialize.pp
Puppet
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
user { "git":
home => "/var/git",
ensure => present
}
 
file {
"/var/git":
ensure => directory,
owner => "git",
group => "git",
require => [User["git"]];
"/var/git/puppet":
ensure => directory,
owner => "git",
group => "git",
require => [User["git"], File["/var/git"]],
}
 
ssh_authorized_key { "git":
ensure => present,
user => "git",
key => "[PUBLIC KEY]",
name => "git@hub.unata.com",
target => "/var/git/.ssh/authorized_keys",
type => rsa,
require => [File["/var/git"], User['git']],
}
 
package { "git-core":
ensure => installed,
}
 
file { "/etc/puppet":
ensure => directory,
owner => "git",
group => "git",
require => Package['git-core']
}
 
exec { "Create puppet Git repo":
cwd => "/var/git/puppet",
user => "git",
group => "git",
command => "/usr/bin/git init --bare",
creates => "/var/git/puppet/HEAD",
require => [File["/var/git/puppet"], Package["git-core"], User["git"]],
}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.