Permalink
Browse files

fixing errors with puppetdb installation

  • Loading branch information...
1 parent 4c0ba02 commit 8c9f83cfaf054918eb772083e09325bfa532d8ec @jfryman committed Dec 4, 2012
@@ -40,7 +40,7 @@
# Install PuppetMaster
class { 'puppet::server':
- master_certname => 'puppetmaster',
+ master_certname => $::fqdn,
dns_alt_names => [
'192.168.150.2',
'puppetmaster',
@@ -4,7 +4,7 @@
vardir => '/var/lib/puppet',
logdir => '/var/lib/puppet/log',
rundir => '/var/lib/puppet/run',
- ssldir => '/etc/puppet/ssl',
+ ssldir => '/var/lib/puppet/ssl',
user => 'puppet',
group => 'puppet',
}
@@ -9,15 +9,32 @@
) {
include puppet
- Class['puppet::repository']
- -> anchor{ 'puppet::server::begin': }
- -> class { 'puppet::server::package': }
- -> class { 'puppet::server::config':
+ anchor { ['puppet::server::begin', 'puppet::server::end']: }
+
+ class { 'puppet::server::package': }
+ class { 'puppet::server::config':
agent_certname => $agent_certname,
master_certname => $master_certname,
dns_alt_names => $dns_alt_names,
puppetmaster => $puppetmaster,
}
- ~> class { 'puppet::server::service': }
- -> anchor{ 'puppet::server::end': }
+ class { 'puppet::server::service': }
+
+ # We do some weird ordering here for several reasons
+ # 1) Puppet packages like to start services after they're installed,
+ # which has a tendency to break some things here. So, get the config
+ # onto the system prior to packages.
+ # 2) Any changes to the Puppet::Server::Class should refresh the Puppet Master
+ # 3) Anchoring makes everything fun!
+ Class['puppet::repository']
+ -> Anchor['puppet::server::begin']
+ -> Class['puppet::server::config']
+ -> Class['puppet::server::package']
+
+ Class['puppet::server::config']
+ ~> Class['puppet::server::service']
+
+ Class['puppet::server::package']
+ -> Class['puppet::server::service']
+ -> Anchor['puppet::server::end']
}
@@ -34,7 +34,11 @@
'puppet/master.conf.erb'
),
}
-
+ file { '/etc/init.d/puppetmaster':
+ ensure => present,
+ mode => '0755',
+ content => template('puppet/puppetmaster.init.erb'),
+ }
file { '/etc/default/puppetmaster':
ensure => present,
mode => '0644',
@@ -1,6 +1,9 @@
class puppet::server::package(
$puppet_version = $puppet::params::puppet['version']
) inherits puppet::params {
+ Exec {
+ path => '/bin:/sbin:/usr/bin:/usr/sbin',
+ }
package { $puppet::params::puppet['packages']:
ensure => $puppet_version,
@@ -2,6 +2,7 @@
vardir = <%= puppet['vardir'] %>
logdir = <%= puppet['logdir'] %>
rundir = <%= puppet['rundir'] %>
+ ssldir = <%= puppet['ssldir'] %>
modulepath = /etc/puppet/modules
user = <%= puppet['user'] %>
group = <%= puppet['group'] %>
@@ -3,4 +3,4 @@ gem install puppet -v 2.7.18 --no-ri --no-rdoc
/usr/bin/puppet master --mkusers --debug --verbose
# Clear out any crusty SSL directories
-rm -rf /etc/puppet/ssl
+rm -rf `puppet --configprint ssldir`
@@ -4,3 +4,6 @@ gem install puppet -v 2.7.18 --no-ri --no-rdoc
# Install Dependencies for Puppet
apt-get -y install 'libaugeas-ruby1.8'
+
+# Cleanup Any generated SSL Certificates
+rm -rf `puppet --configprint ssldir`
View
@@ -63,7 +63,7 @@
desc "Delete all certificates with [<host>]"
task :delete, :name do |t, args|
name = args[:name]
- vagrant.vms[:puppetmaster].channel.sudo("find /etc/puppet/ssl -type f | grep #{name} | xargs rm -rf")
+ vagrant.vms[:puppetmaster].channel.sudo("find `puppet --configprint ssldir`/ssl -type f | grep #{name} | xargs rm -rf")
end
end
end

0 comments on commit 8c9f83c

Please sign in to comment.