From 47ab1cae85519b47fd6bf98e796add62e87dcec8 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Sat, 13 Apr 2013 15:51:35 -0300 Subject: Make nodo class include the role class --- manifests/host.pp | 2 +- manifests/nodo.pp | 10 +++++++++- manifests/plug.pp | 2 +- manifests/role/dns.pp | 4 ++++ manifests/vserver.pp | 2 +- 5 files changed, 16 insertions(+), 4 deletions(-) (limited to 'manifests') diff --git a/manifests/host.pp b/manifests/host.pp index eb907bb..ee87e2f 100644 --- a/manifests/host.pp +++ b/manifests/host.pp @@ -1,5 +1,5 @@ # Fully capable node able to host other nodes -class nodo::host inherits nodo { +class nodo::host { include nodo::subsystem::initramfs include nodo::subsystem::modprobe include nodo::subsystem::firewire diff --git a/manifests/nodo.pp b/manifests/nodo.pp index 27d97fa..b70bc65 100644 --- a/manifests/nodo.pp +++ b/manifests/nodo.pp @@ -1,4 +1,7 @@ -class nodo { +class nodo( + $role, + $location = 'default' +) { include lsb include nodo::subsystem::sudo include nodo::subsystem::motd @@ -149,4 +152,9 @@ class nodo { mode => 0755, ensure => present, } + + # Include role class + if defined("nodo::role::$role") { + class { "nodo::role::$role": } + } } diff --git a/manifests/plug.pp b/manifests/plug.pp index f9e787b..858ba0a 100644 --- a/manifests/plug.pp +++ b/manifests/plug.pp @@ -1,4 +1,4 @@ -class nodo::plug inherits nodo { +class nodo::plug { include syslog-ng include nodo::utils::plug include nodo::utils::physical diff --git a/manifests/role/dns.pp b/manifests/role/dns.pp index 2faa69b..a439092 100644 --- a/manifests/role/dns.pp +++ b/manifests/role/dns.pp @@ -1,3 +1,7 @@ class nodo::role::dns inherits nodo::vserver { include bind + + if defined('dns') { + class { 'dns': } + } } diff --git a/manifests/vserver.pp b/manifests/vserver.pp index fa08147..030803f 100644 --- a/manifests/vserver.pp +++ b/manifests/vserver.pp @@ -1,4 +1,4 @@ -class nodo::vserver inherits nodo { +class nodo::vserver { class { 'timezone': } class { 'syslog-ng::vserver': } -- cgit v1.2.3