]> gitweb.fluxo.info Git - puppet-nodo.git/commitdiff
Autoload definitions
authorSilvio Rhatto <rhatto@riseup.net>
Sat, 12 Sep 2015 00:16:42 +0000 (21:16 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Sat, 12 Sep 2015 00:16:42 +0000 (21:16 -0300)
14 files changed:
manifests/base/host.pp
manifests/base/plug.pp
manifests/base/vserver.pp
manifests/init.pp
manifests/role/nas.pp
manifests/subsystem/monitor/munin.pp [moved from manifests/defines/munin_node.pp with 94% similarity]
manifests/subsystem/monkeysphere.pp [moved from manifests/defines/monkeysphere_host.pp with 94% similarity]
manifests/subsystem/ssh/config.pp [moved from manifests/defines/ssh_config.pp with 90% similarity]
manifests/subsystem/ssh/create_key.pp [moved from manifests/defines/ssh_create_key.pp with 78% similarity]
manifests/subsystem/ssh/folder.pp [moved from manifests/defines/ssh_folder.pp with 87% similarity]
manifests/subsystem/ssh/known_hosts.pp [moved from manifests/defines/ssh_known_hosts.pp with 93% similarity]
manifests/subsystem/ssh/local_key.pp [moved from manifests/defines/ssh_local_key.pp with 89% similarity]
manifests/subsystem/sysctl/entry.pp [moved from manifests/defines/sysctl.pp with 90% similarity]
manifests/vserver/instance.pp

index 799fe201241d1b2cdb00366a474d47001b591431..433364bd9af5b191616510470c377e7dd1d372e5 100644 (file)
@@ -49,7 +49,7 @@ class nodo::base::host {
   # Munin configuration
   $munin = hiera('nodo::host::use_munin', True)
   if $munin == true {
-    munin_node { "$hostname":
+    nodo::subsystem::monitor::munin { "$hostname":
       port => '4900',
     }
   }
index eedd9febc955fdfdc156eed3e00687b3752f9f91..b71b6482c4a727b7d43dff44223c4fa5b6719e26 100644 (file)
@@ -20,7 +20,7 @@ class nodo::base::plug {
   }
 
   # Munin configuration
-  munin_node { "${::hostname}":
+  nodo::subsystem::monitor::munin { "${::hostname}":
     port => '4900',
   }
 }
index 0a8b58974a90386eaa158276af70b1827255400e..f904f3238bea437584c5cb19629c53b90a1ba716 100644 (file)
@@ -16,13 +16,13 @@ class nodo::base::vserver {
     "direct": {
       # Apply munin and monkeysphere configuration for
       # for directly hosted nodes.
-      Munin_node        <<| title == $::hostname |>>
-      Monkeysphere_host <<| title == $::hostname |>>
+      Nodo::Subsystem::Monitor::Munin <<| title == $::hostname |>>
+      Nodo::Subsystem::Monkeysphere   <<| title == $::hostname |>>
     }
     "third-party": {
       # Apply munin and monkeysphere configuration for
       # nodes hosted by third-parties.
-      munin_node { "${::hostname}": }
+      nodo::subsystem::monitor::munin { "${::hostname}": }
       monkeysphere_host { "${::hostname}":
         port => hiera('nodo::vserver::ssh_port', '22'),
       }
index d97d3f3bb0c90b86f72e51be934b22172915d801..1751d9ce2fc4a84a92ee4ecc70a1169e2a28f410 100644 (file)
@@ -6,18 +6,8 @@
 import "common"
 
 # Modules that still doesn't support autoloading
-#import 'dhcp'
-#import 'virtual'
-
-# Definitions
-import "defines/monkeysphere_host.pp"
-import "defines/munin_node.pp"
-import "defines/ssh_config.pp"
-import "defines/ssh_create_key.pp"
-import "defines/ssh_known_hosts.pp"
-import "defines/ssh_local_key.pp"
-import "defines/ssh_folder.pp"
-import "defines/sysctl.pp"
+import 'dhcp'
+import 'virtual'
 
 class nodo(
   $role     = hiera('nodo::role',     'default'),
index 6b80e5f42a1842c804056dcdd544ccd7005fed71..536f9ca2ea7268e1e929dc5d733967739b8752d2 100644 (file)
@@ -45,7 +45,7 @@ class nodo::role::nas(
 
   if $dlna == true {
     # See https://wiki.archlinux.org/index.php/MiniDLNA#Automatic_Media_DB_Update
-    sysctl { 'fs.inotify.max_user_watches':
+    nodo::subsystem::sysctl::entry { 'fs.inotify.max_user_watches':
       value => 100000,
     }
 
similarity index 94%
rename from manifests/defines/munin_node.pp
rename to manifests/subsystem/monitor/munin.pp
index f867fd3d37ad1949abac910168246428c453fa8e..aa70c2fd865dd9e65ea930955d3909829bd0acfd 100644 (file)
@@ -1,5 +1,5 @@
 # Define a munin node
-define munin_node(
+define nodo::sybsystem::monitor::munin(
   $port          = hiera('nodo::munin_node::port',   '4949'),
   $allow         = hiera('nodo::munin_node::allow',  ''),
   $host          = hiera('nodo::munin_node::host',    $::fqdn),
similarity index 94%
rename from manifests/defines/monkeysphere_host.pp
rename to manifests/subsystem/monkeysphere.pp
index b4b21e006dbeb06a66b360f70d4fb52955098848..c09effe328bc6df0a89e2dec425cb848d8d87678 100644 (file)
@@ -1,4 +1,4 @@
-define monkeysphere_host(
+define nodo::subsystem::monkeysphere(
   $port           = hiera('nodo::monkeysphere_host::ssh_port', ''),
   $mail_recipient = hiera('mail::root_mail_recipient', 'nobody')
 ) {
similarity index 90%
rename from manifests/defines/ssh_config.pp
rename to manifests/subsystem/ssh/config.pp
index 55855208b94b41b199987c39c2631926fe8b4406..6c9fbc31bbd0cef12a5162e495891353dda384fc 100644 (file)
@@ -1,11 +1,11 @@
 # Manage ssh config for a particular user
-define ssh_config(
+define nodo::subsystem::ssh::config(
   $owner,
   $group,
   $home               = '/home/$owner',
   $ssh_localhost_auth = false
 ) {
-  ssh_folder { "ssh-config-${name}":
+  nodo::subsystem::ssh::folder { "ssh-config-${name}":
     home  => $home,
     owner => $owner,
     group => $group,
similarity index 78%
rename from manifests/defines/ssh_create_key.pp
rename to manifests/subsystem/ssh/create_key.pp
index 77d1f006ef3967c86df07f4f51f25a9555e1e412..881dddab5656ef71e5125f9d9415c4e4d6999a72 100644 (file)
@@ -1,10 +1,10 @@
-define ssh_create_key(
+define nodo::subsystem::ssh::create_key(
   $owner,
   $group,
   $keyfile = 'id_rsa',
   $home    = '/home/$owner'
 ) {
-  ssh_folder { "ssh_create_key-${name}":
+  nodo::subsystem::ssh::folder { "ssh_create_key-${name}":
     home  => $home,
     owner => $owner,
     group => $group,
similarity index 87%
rename from manifests/defines/ssh_folder.pp
rename to manifests/subsystem/ssh/folder.pp
index 41b688ab959ae453e742ca97a1b57863fe5f4c02..462f8fbd40d8f34499d8eb979adfbf6b6573061a 100644 (file)
@@ -1,5 +1,5 @@
 # Manage a ssh folder
-define ssh_folder(
+define nodo:subsystem::ssh::folder(
   $home,
   $owner,
   $group,
similarity index 93%
rename from manifests/defines/ssh_known_hosts.pp
rename to manifests/subsystem/ssh/known_hosts.pp
index c0d7157e6f7247b48389049d6e41d75bd4f6a938..c20b9730b38897b1a943793b65b584aebeb65b42 100644 (file)
@@ -1,10 +1,10 @@
 # Manage known_hosts for a particular user
-define ssh_known_host(
+define nodo::subsystem::ssh::known_host(
   $owner,
   $home               = '/home/$owner',
   $ssh_localhost_auth = false
 ) {
-  ssh_folder { "ssh_known_host-${name}":
+  nodo::subsystem::ssh::folder { "ssh_known_host-${name}":
     home  => $home,
     owner => $owner,
     group => $group,
similarity index 89%
rename from manifests/defines/ssh_local_key.pp
rename to manifests/subsystem/ssh/local_key.pp
index 57bb25109e3d9ab369eb52ae0594ae8ba89af8e8..f311ea3367696df8c4f4c170f602ffa383386434 100644 (file)
@@ -1,5 +1,5 @@
 # Manage local ssh keys
-define ssh_local_key(
+define nodo::subsystem::ssh::local_key(
   $owner  = $name,
   $group  = $name,
   $home   = "/home/${owner}",
@@ -7,7 +7,7 @@ define ssh_local_key(
   $dest   = 'id_rsa',
   $ensure = 'present',
 ) {
-  ssh_folder { "ssh_local_key-${name}":
+  nodo::subsystem::ssh::folder { "ssh_local_key-${name}":
     home   => $home,
     owner  => $owner,
     group  => $group,
similarity index 90%
rename from manifests/defines/sysctl.pp
rename to manifests/subsystem/sysctl/entry.pp
index 06f6a1452390accb71cfa0825c56dbf85086d1e6..ddd602034687e1691b3a11767f278797b635a17f 100644 (file)
@@ -1,5 +1,5 @@
 # Simple sysctl definition
-define sysctl(
+define nodo::subsystem::sysctl::entry(
   $ensure = present,
   $value
 ) {
index 200386149f7ffe5ee6867838680b03b9c2fdda5a..23cebb17cc5a86719a1eb4ea87bee21b51f717dc 100644 (file)
@@ -71,7 +71,7 @@ define nodo::vserver::instance(
   }
 
   # Create a munin virtual resource to be realized in the node
-  @@munin_node { "${name}":
+  @@nodo::subsystem::monitor::munin { "${name}":
     port => $munin_port ? {
       false   => "49$id",
       default => $munin_port,
@@ -79,7 +79,7 @@ define nodo::vserver::instance(
   }
 
   # Create a monkeysphere virtual resource to be realized in the node
-  @@monkeysphere_host { "$name":
+  @@nodo::subsystem::monkeysphere { "$name":
     port => $monkeysphere_ssh_port ? {
       false   => "22$id",
       default => $monkeysphere_ssh_port,