aboutsummaryrefslogtreecommitdiff
path: root/manifests/role/master.pp
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2013-04-12 17:09:03 -0300
committerSilvio Rhatto <rhatto@riseup.net>2013-04-12 17:09:03 -0300
commitfe1c86b8f938283e9dd8196a8b11a9648f4b49e6 (patch)
treec2d999eca03862a3e4af57e0885397adf6bbc6ec /manifests/role/master.pp
parentec5c750d12bdc7948bb3c04f0c72817718a0bf47 (diff)
downloadpuppet-nodo-fe1c86b8f938283e9dd8196a8b11a9648f4b49e6.tar.gz
puppet-nodo-fe1c86b8f938283e9dd8196a8b11a9648f4b49e6.tar.bz2
Major refactor
Diffstat (limited to 'manifests/role/master.pp')
-rw-r--r--manifests/role/master.pp60
1 files changed, 60 insertions, 0 deletions
diff --git a/manifests/role/master.pp b/manifests/role/master.pp
new file mode 100644
index 0000000..2adb8a5
--- /dev/null
+++ b/manifests/role/master.pp
@@ -0,0 +1,60 @@
+class nodo::role::master {
+ $main = hiera('nodo::role::master::main', false)
+ $db_password = hiera('nodo::role::master::db_password', '')
+
+ case $db_password {
+ '': { fail("Please set nodo::master::db_password in your config") }
+ }
+
+ if $main == true {
+ # Puppetmaster should be included before nodo::vserver
+ class { 'puppet::master':
+ main => true,
+ }
+
+ include munin::host
+ include munin::plugins::muninhost
+
+ # The main master has a host entry pointing to itself, other
+ # masters still retrieve catalogs from the main master.
+ host { "puppet":
+ ensure => present,
+ ip => "127.0.0.1",
+ alias => ["puppet.${::domain}"],
+ }
+ } else {
+ class { 'puppet::master':
+ main => false,
+ }
+
+ host { "puppet":
+ ensure => absent,
+ }
+ }
+
+ # These should be included after puppetmaster
+ include nodo::vserver
+ include database
+ include git::daemon
+ include websites::admin
+ include nagios::headless
+ include nagios::defaults
+
+ # Nagios apache workaround
+ file { "/etc/apache2/conf.d/nagios3.conf":
+ ensure => absent,
+ }
+
+ # Update master's puppet.conf if you change here
+ database::instance { "puppet":
+ password => "${db_password}",
+ }
+
+ # Used for trac dependency graphs
+ package { "graphviz":
+ ensure => present,
+ }
+
+ # Check domain registration
+ domain_check::instance { $::domain: }
+}