Add puppet master role
This commit adds a puppet master role for deploying a fully functional puppet master with puppetdb installed. Adds the role in manifest/site.pp. Add hosts entry to manifests/setup/hosts.pp Add the definition in the vagrant file Add new deps to Puppetfile do not append timestamp to certname. Add puppet master specific config settings to setup/hosts.pp
This commit is contained in:
@@ -28,3 +28,10 @@ mod 'puppetlabs/firewall', :git => 'git://github.com/puppetlabs/puppetlabs-firew
|
|||||||
mod 'ripienaar/concat', :git => 'git://github.com/ripienaar/puppet-concat'
|
mod 'ripienaar/concat', :git => 'git://github.com/ripienaar/puppet-concat'
|
||||||
mod 'duritong/sysctl', :git => 'git://github.com/duritong/puppet-sysctl.git'
|
mod 'duritong/sysctl', :git => 'git://github.com/duritong/puppet-sysctl.git'
|
||||||
mod 'cprice404/inifile', :git => 'git://github.com/cprice-puppet/puppetlabs-inifile'
|
mod 'cprice404/inifile', :git => 'git://github.com/cprice-puppet/puppetlabs-inifile'
|
||||||
|
# puppet related modules
|
||||||
|
mod ripienaar/hiera_puppet :git => https://github.com/ripienaar/hiera-puppet
|
||||||
|
mod 'puppetlabs/ruby'
|
||||||
|
mod 'puppet/puppet', :git => 'git://github.com/stephenrjohnson/puppetlabs-puppet.git'
|
||||||
|
mod 'puppet/puppetdb', :git => 'git://github.com/puppetlabs/puppetlabs-puppetdb.git'
|
||||||
|
mod 'puppetlabs/postgresql', :git => 'git://github.com/puppetlabs/puppet-postgresql.git'
|
||||||
|
mod 'ripienaar/ruby-puppetdb', :git => 'git://github.com/ripienaar/ruby-puppetdb'
|
||||||
|
|||||||
9
Vagrantfile
vendored
9
Vagrantfile
vendored
@@ -89,6 +89,11 @@ Vagrant::Config.run do |config|
|
|||||||
'ip1' => '172.16.0.10'
|
'ip1' => '172.16.0.10'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{ 'puppetmaster' => {
|
||||||
|
'memory' => 512,
|
||||||
|
'ip1' => '172.16.0.31'
|
||||||
|
}
|
||||||
|
},
|
||||||
{ 'openstack_all' => { 'memory' => 2512, 'ip1' => '172.16.0.11'} }
|
{ 'openstack_all' => { 'memory' => 2512, 'ip1' => '172.16.0.11'} }
|
||||||
#{'compute_1' =>
|
#{'compute_1' =>
|
||||||
# {'ip1' => '172.16.0.4'}
|
# {'ip1' => '172.16.0.4'}
|
||||||
@@ -123,7 +128,11 @@ Vagrant::Config.run do |config|
|
|||||||
agent.vm.customize ["modifyvm", :id, "--name", "#{name}.puppetlabs.lan"]
|
agent.vm.customize ["modifyvm", :id, "--name", "#{name}.puppetlabs.lan"]
|
||||||
agent.vm.host_name = "#{name.gsub('_', '-')}.puppetlabs.lan"
|
agent.vm.host_name = "#{name.gsub('_', '-')}.puppetlabs.lan"
|
||||||
|
|
||||||
|
if name == 'puppetmaster' || name =~ /^swift/
|
||||||
|
node_name = "#{name.gsub('_', '-')}.puppetlabs.lan"
|
||||||
|
else
|
||||||
node_name = "#{name.gsub('_', '-')}-#{Time.now.strftime('%Y%m%d%m%s')}"
|
node_name = "#{name.gsub('_', '-')}-#{Time.now.strftime('%Y%m%d%m%s')}"
|
||||||
|
end
|
||||||
|
|
||||||
if os_name =~ /precise/
|
if os_name =~ /precise/
|
||||||
agent.vm.provision :shell, :inline => "apt-get update"
|
agent.vm.provision :shell, :inline => "apt-get update"
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
# specify a connection to the hardcoded puppet master
|
# specify a connection to the hardcoded puppet master
|
||||||
#
|
#
|
||||||
host {
|
host {
|
||||||
'puppet': ip => '172.16.0.2';
|
'puppetmaster': ip => '172.16.0.31', host_aliases => ['puppetmaster.puppetlabs.lan'];
|
||||||
'openstackcontroller': ip => '172.16.0.3';
|
'openstackcontroller': ip => '172.16.0.3';
|
||||||
'compute1': ip => '172.16.0.4';
|
'compute1': ip => '172.16.0.4';
|
||||||
'compute2': ip => '172.16.0.14';
|
'compute2': ip => '172.16.0.14';
|
||||||
@@ -24,3 +24,24 @@ file { '/root/run_puppet.sh':
|
|||||||
"#!/bin/bash
|
"#!/bin/bash
|
||||||
puppet apply --modulepath /tmp/vagrant-puppet/modules-0/ --certname ${clientcert} /tmp/vagrant-puppet/manifests/site.pp"
|
puppet apply --modulepath /tmp/vagrant-puppet/modules-0/ --certname ${clientcert} /tmp/vagrant-puppet/manifests/site.pp"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
node /puppetmaster/ {
|
||||||
|
Ini_setting {
|
||||||
|
path => '/etc/puppet/puppet.conf',
|
||||||
|
section => 'main',
|
||||||
|
ensure => present,
|
||||||
|
}
|
||||||
|
|
||||||
|
ini_setting {'vardir':
|
||||||
|
setting => 'vardir',
|
||||||
|
value => '/var/lib/puppet/',
|
||||||
|
}
|
||||||
|
ini_setting {'ssldir':
|
||||||
|
setting => 'ssldir',
|
||||||
|
value => '/var/lib/puppet/ssl/',
|
||||||
|
}
|
||||||
|
ini_setting {'rundir':
|
||||||
|
setting => 'rundir',
|
||||||
|
value => '/var/run/puppet/',
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -307,3 +307,36 @@ node /devstack/ {
|
|||||||
node default {
|
node default {
|
||||||
notify { $clientcert: }
|
notify { $clientcert: }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
node puppetmaster {
|
||||||
|
|
||||||
|
$hostname = 'puppetmaster'
|
||||||
|
|
||||||
|
### Add the puppetlabs repo
|
||||||
|
apt::source { 'puppetlabs':
|
||||||
|
location => 'http://apt.puppetlabs.com',
|
||||||
|
repos => 'main',
|
||||||
|
key => '4BD6EC30',
|
||||||
|
key_server => 'pgp.mit.edu',
|
||||||
|
tag => ['puppet'],
|
||||||
|
}
|
||||||
|
|
||||||
|
Exec["apt_update"] -> Package <| |>
|
||||||
|
|
||||||
|
class { 'puppet::master':
|
||||||
|
autosign => true,
|
||||||
|
modulepath => '/etc/puppet/modules-0',
|
||||||
|
}
|
||||||
|
|
||||||
|
class { 'puppetdb':
|
||||||
|
require => Class['puppet::master'],
|
||||||
|
}
|
||||||
|
|
||||||
|
# Configure the puppet master to use puppetdb.
|
||||||
|
class { 'puppetdb::master::config':
|
||||||
|
restart_puppet => false,
|
||||||
|
puppetdb_startup_timeout => 240,
|
||||||
|
notify => Class['apache'],
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user