aboutsummaryrefslogtreecommitdiff
path: root/manifests/init.pp
diff options
context:
space:
mode:
Diffstat (limited to 'manifests/init.pp')
-rw-r--r--manifests/init.pp41
1 files changed, 23 insertions, 18 deletions
diff --git a/manifests/init.pp b/manifests/init.pp
index 721ed93..1671940 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -2,27 +2,12 @@
# Nodo module.
#
-# Default execution path
-Exec { path => "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" }
-
-# Fileserver backup
-filebucket { server: server => hiera('puppet::daemon::server', "puppet.${::domain}") }
-File { backup => server }
-
-# Set role and location variables: this is a trick so we can use role and location
-# in Hiera's hierarchical config.
-$role = hiera('nodo::role', 'default')
-$location = hiera('nodo::location', 'default')
-
# Import required modules
-import "common"
+#import "common"
# Modules that still doesn't support autoloading
-import 'dhcp'
-import 'virtual'
-
-# Nodo class
-import "nodo.pp"
+#import 'dhcp'
+#import 'virtual'
# Definitions
import "defines/monkeysphere_host.pp"
@@ -33,3 +18,23 @@ import "defines/ssh_known_hosts.pp"
import "defines/ssh_local_key.pp"
import "defines/ssh_folder.pp"
import "defines/sysctl.pp"
+
+class nodo(
+ $role = hiera('nodo::role', 'default'),
+ $location = hiera('nodo::location', 'default'),
+) {
+ # Default execution path
+ Exec { path => "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" }
+
+ # Fileserver backup
+ filebucket { server: server => hiera('puppet::daemon::server', "puppet.${::domain}") }
+ File { backup => server }
+
+ # Include base class
+ include nodo::base
+
+ # Include role class
+ if defined("nodo::role::${role}") {
+ class { "nodo::role::${role}": }
+ }
+}