]> gitweb.fluxo.info Git - puppet-nodo.git/commitdiff
Hiera 5 migration
authorSilvio Rhatto <rhatto@riseup.net>
Thu, 7 May 2020 23:58:21 +0000 (20:58 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Thu, 7 May 2020 23:58:21 +0000 (20:58 -0300)
29 files changed:
manifests/base/host.pp
manifests/base/physical.pp
manifests/base/virtual.pp
manifests/init.pp
manifests/resources.pp
manifests/role/mumble.pp
manifests/role/nas.pp
manifests/role/web.pp
manifests/role/yacy.pp
manifests/subsystem/backup.pp
manifests/subsystem/dhclient.pp
manifests/subsystem/hosts.pp
manifests/subsystem/mail.pp
manifests/subsystem/media.pp
manifests/subsystem/media/folders.pp
manifests/subsystem/monkeysphere.pp
manifests/subsystem/motd.pp
manifests/subsystem/nas/share.pp
manifests/subsystem/resolver.pp
manifests/subsystem/scanner.pp
manifests/subsystem/scanner/client.pp
manifests/subsystem/screen/startup.pp
manifests/subsystem/sshd.pp
manifests/subsystem/sysctl/appliance.pp
manifests/subsystem/sysctl/disable_ipv6.pp
manifests/subsystem/sysctl/tcp_challenge_ack_limit.pp
manifests/subsystem/udev/network.pp
manifests/utils/java.pp
manifests/utils/multimedia.pp

index 96c2e63f4bb5ecec289a810d36e663c22f43c7ac..6e71f9862219237400dca586611f4f23063f0c14 100644 (file)
@@ -14,7 +14,7 @@ class nodo::base::host {
   class { 'firewall': }
 
   # Time
-  $ntpdate = hiera('nodo::host::ntpdate', true)
+  $ntpdate = lookup('nodo::host::ntpdate', undef, undef, true)
   case $ntpdate {
     false:   { class { 'ntp::timezone': } }
     default: { class { 'ntp::ntpdate':  } }
index 8c3b1c4ae6e1e65c53abe4679ea528b2c419ef2f..936a21fa3c8d616acc590f13eca094ad3ef5f72d 100644 (file)
@@ -1,5 +1,5 @@
 class nodo::base::physical inherits nodo::base::host {
-  $smartmontools = hiera('nodo::smartmontools', true)
+  $smartmontools = lookup('nodo::smartmontools', undef, undef, true)
 
   if $smartmontools == true {
     class { 'smartmontools': }
index c532620f6901dd1e1273f6760f49fa52d40533f2..0e107c0fb5a2d2c7274f4548df31b8cfc8ad6c71 100644 (file)
@@ -10,6 +10,6 @@ class nodo::base::virtual {
   }
 
   nodo::subsystem::monkeysphere { "${::hostname}":
-    port => hiera('nodo::virtual::ssh_port', '22'),
+    port => lookup('nodo::virtual::ssh_port', undef, undef, '22'),
   }
 }
index adbaebc78f3a2440a7ec2db6dc9c3abbb563e0d4..5baee4d8b13ea0e625cf797f7df323f0ba44bee9 100644 (file)
@@ -3,29 +3,34 @@
 #
 
 class nodo(
-  $role     = 'default',
-  $location = 'default',
+  $role = $::role,
 ) {
   # 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}") }
+  filebucket { server: server => lookup('puppet::daemon::server', undef, undef, "puppet.${::domain}") }
   File { backup => server }
 
   # Include base class
   include nodo::base
 
+  $nodo_role = $role ? {
+    ''      => 'default',
+    default => $role,
+  }
+
   # Include role class
-  if defined("nodo::role::${role}") {
-    class { "nodo::role::${role}": }
+  if defined("nodo::role::${nodo_role}") {
+    class { "nodo::role::${nodo_role}": }
   }
 
   # Include additional classes
-  $classes = hiera('classes', false)
-  if $classes != false {
-    hiera_include('classes')
-  }
+  #$classes = lookup('classes', undef, undef, false)
+  #if $classes != false {
+  #  hiera_include('classes')
+  #}
+  lookup('classes', { merge => unique }).include
 
   # Declare resources
   class { "nodo::resources": }
index 5c014fb56442a3c8fdcc850e5e9051c88e534a1c..8fe188fef6816097de3d62cb7219e2125d44a238 100644 (file)
@@ -5,58 +5,58 @@ class nodo::resources {
   }
 
   # Packages
-  $packages = hiera('packages', {})
+  $packages = lookup('packages', undef, undef, {})
   create_resources('package', $packages)
 
   # Files
-  $files = hiera('files', {})
+  $files = lookup('files', undef, undef, {})
   create_resources('file', $files)
 
   # File lines
-  $file_lines = hiera('file_lines', {})
+  $file_lines = lookup('file_lines', undef, undef, {})
   create_resources('file_line', $file_lines)
 
   # Virtual machines
-  $vms = hiera('virtual::machines', {})
+  $vms = lookup('virtual::machines', undef, undef, {})
   create_resources('nodo::subsystem::virtual::instance', $vms)
 
   # Users
-  $users = hiera('users', {})
+  $users = lookup('users', undef, undef, {})
   create_resources('user::manage', $users)
 
   # Backup users
-  $backup_users = hiera('backup::users', {})
+  $backup_users = lookup('backup::users', undef, undef, {})
   create_resources('backup::user', $backup_users)
 
   # Cron entries
-  $cron = hiera('cron::jobs', {})
+  $cron = lookup('cron::jobs', undef, undef, {})
   create_resources('cron', $cron)
 
   # Hosts
-  $hosts = hiera('hosts', {})
+  $hosts = lookup('hosts', undef, undef, {})
   create_resources('host', $hosts)
 
   # Nginx entries
-  $nginx = hiera('nginx::sites', {})
+  $nginx = lookup('nginx::sites', undef, undef, {})
   create_resources('nginx::site', $nginx)
 
   # SSH keys
-  $sshkeys = hiera('sshkeys', {})
+  $sshkeys = lookup('sshkeys', undef, undef, {})
   create_resources('sshkey', $sshkeys)
 
   # SSH Authorized keys
-  $ssh_authorized_keys = hiera('ssh_authorized_keys', {})
+  $ssh_authorized_keys = lookup('ssh_authorized_keys', undef, undef, {})
   create_resources('ssh_authorized_key', $ssh_authorized_keys)
 
   # PaX flags
-  $pax = hiera('nodo::subsystem::grsec::paxctl', {})
+  $pax = lookup('nodo::subsystem::grsec::paxctl', undef, undef, {})
   create_resources('nodo::subsystem::grsec::paxctl', $pax)
 
   # Exec
-  $execs = hiera('execs', {})
+  $execs = lookup('execs', undef, undef, {})
   create_resources('exec', $execs)
 
   # Repositories
-  $vcsrepos = hiera('vcsrepos', {})
+  $vcsrepos = lookup('vcsrepos', undef, undef, {})
   create_resources('vcsrepo', $vcsrepos)
 }
index c9b26f2380ca752f2021209c0d3c4ae3eb9bd99b..3765dabf9734e61a4316410c79f6de6955269479 100644 (file)
@@ -1,9 +1,9 @@
 class nodo::role::mumble inherits nodo::base::virtual {
   class { 'mumble::ssl':
-    config_content => hiera('mumble::config_content'),
+    config_content => lookup('mumble::config_content'),
   }
 
-  $ecdhforce = hiera('nodo::role::mumble::ecdhforce', false)
+  $ecdhforce = lookup('nodo::role::mumble::ecdhforce', undef, undef, false)
 
   if $ecdhforce == true {
     include mumble::ecdhforce
index 7eecbe36649b6007511f898b6e04841c047f63f9..a24ef77ceb5d86cfac6d1272cbf75fc2f0487a54 100644 (file)
@@ -31,14 +31,14 @@ class nodo::role::nas(
   # http://lists.freedesktop.org/archives/avahi/2006-July/000824.html
   # http://cups.org/documentation.php/doc-1.6/ref-cupsd-conf.html#BrowseLocalProtocols
   # http://www.dns-sd.org/ServiceTypes.html
-  $avahi = hiera('nodo::role::nas::avahi', false)
+  $avahi = lookup('nodo::role::nas::avahi', undef, undef, false)
 
   if $avahi == true {
     include avahi
   }
 
   # DLNA
-  $dlna = hiera('nodo::role::nas::dlna', false)
+  $dlna = lookup('nodo::role::nas::dlna', undef, undef, false)
 
   if $dlna == true {
     # See https://wiki.archlinux.org/index.php/MiniDLNA#Automatic_Media_DB_Update
@@ -71,7 +71,7 @@ class nodo::role::nas(
   # http://git.puppet.immerda.ch/?p=module-nfsd.git;a=summary
   # http://wiki.debian.org/NFSServerSetup
   # http://www.tldp.org/HOWTO/NFS-HOWTO/
-  $nfs = hiera('nodo::role::nas::nfs', false)
+  $nfs = lookup('nodo::role::nas::nfs', undef, undef, false)
 
   if $nfs == true {
     # Main class
@@ -88,7 +88,7 @@ class nodo::role::nas(
   # https://forum.openwrt.org/viewtopic.php?id=12976
   # http://download.pureftpd.org/pub/pure-ftpd/doc/FAQ
   # http://www.massimilianomarini.com/04/02/2012/how-follow-symbolic-links-pure-ftpd
-  $ftp = hiera('nodo::role::nas::ftp', false)
+  $ftp = lookup('nodo::role::nas::ftp', undef, undef, false)
 
   if $ftp == true {
     # Main class
@@ -132,15 +132,15 @@ class nodo::role::nas(
   # http://www.linuxplanet.com/linuxplanet/tutorials/6600/2
   # http://forums.fedoraforum.org/showthread.php?t=260519
   # http://randombio.com/linuxsetup38.html
-  $samba = hiera('nodo::role::nas::samba', false)
+  $samba = lookup('nodo::role::nas::samba', undef, undef, false)
 
   if $samba == true {
     # Main class
     class { 'samba::server':
-      workgroup        => hiera('nodo::samba::workgroup',     'WORKGROUP'),
-      server_string    => hiera('nodo::samba::server_string', 'Samba Server'),
-      interfaces       => hiera('nodo::samba::interfaces',    'lo eth0'),
-      security         => hiera('nodo::samba::security',      'user'),
+      workgroup        => lookup('nodo::samba::workgroup', undef, undef,     'WORKGROUP'),
+      server_string    => lookup('nodo::samba::server_string', undef, undef, 'Samba Server'),
+      interfaces       => lookup('nodo::samba::interfaces', undef, undef,    'lo eth0'),
+      security         => lookup('nodo::samba::security', undef, undef,      'user'),
       preferred_master => 'yes',
       printing         => 'cups',
       printcap_name    => 'cups',
@@ -153,7 +153,7 @@ class nodo::role::nas(
     # http://linux-igd.sourceforge.net/documentation.php
     samba::server::option {
      # Remote announce won't work since routers don't forward broadcast traffic
-     #'remote announce': value => hiera('nodo::samba::remote_announce', '');
+     #'remote announce': value => lookup('nodo::samba::remote_announce', undef, undef, '');
      'wins support':     value => 'yes';
      'domain master':    value => 'yes';
     }
@@ -191,7 +191,7 @@ class nodo::role::nas(
   # https://github.com/camptocamp/puppet-lighttpd
   # https://github.com/example42/puppet-lighttpd
   # http://git.puppet.immerda.ch/?p=module-lighttpd.git;a=summary
-  $http = hiera('nodo::role::nas::http', false)
+  $http = lookup('nodo::role::nas::http', undef, undef, false)
 
   if $http == true {
     # Main class
@@ -224,7 +224,7 @@ class nodo::role::nas(
   #
   # TFTP
   #
-  $tftp = hiera('nodo::role::nas::tftp', false)
+  $tftp = lookup('nodo::role::nas::tftp', undef, undef, false)
 
   if $tftp == true {
     # Main class
@@ -239,7 +239,7 @@ class nodo::role::nas(
   #
   # Rsync
   #
-  $rsync = hiera('nodo::role::nas::rsync', false)
+  $rsync = lookup('nodo::role::nas::rsync', undef, undef, false)
 
   if $rsync == true {
     include rsync::server
@@ -263,7 +263,7 @@ class nodo::role::nas(
   #
   # MPD
   #
-  $mpd = hiera('nodo::role::nas::mpd', false)
+  $mpd = lookup('nodo::role::nas::mpd', undef, undef, false)
 
   if $mpd == true {
     include mpd
@@ -274,7 +274,7 @@ class nodo::role::nas(
   #
   # CherryMusic
   #
-  $cherrymusic = hiera('nodo::role::nas::cherrymusic', false)
+  $cherrymusic = lookup('nodo::role::nas::cherrymusic', undef, undef, false)
 
   if $cherrymusic == true {
     include cherrymusic
@@ -283,7 +283,7 @@ class nodo::role::nas(
   #
   # Airsonic
   #
-  $airsonic = hiera('nodo::role::nas::airsonic', false)
+  $airsonic = lookup('nodo::role::nas::airsonic', undef, undef, false)
 
   if $airsonic == true {
     include airsonic
@@ -295,7 +295,7 @@ class nodo::role::nas(
   # References
   # https://github.com/mosen/puppet-cups
   # https://github.com/camptocamp/puppet-cups
-  $cups = hiera('nodo::role::nas::cups', false)
+  $cups = lookup('nodo::role::nas::cups', undef, undef, false)
 
   if $cups == true {
     include firewall::printer
@@ -305,7 +305,7 @@ class nodo::role::nas(
   #
   # Torrent
   #
-  $torrent = hiera('nodo::role::nas::torrent', false)
+  $torrent = lookup('nodo::role::nas::torrent', undef, undef, false)
 
   if $torrent == true {
     include pyroscope
@@ -318,7 +318,7 @@ class nodo::role::nas(
   # http://packages.debian.org/stable/forked-daapd
   # http://packages.debian.org/squeeze/mt-daapd
   # https://github.com/stahnma/puppet-module-daap_server
-  #$daap = hiera('nodo::role::nas::daap', false)
+  #$daap = lookup('nodo::role::nas::daap', undef, undef, false)
 
   #if $daap == true {
   #  # Main class, but package not available on wheezy
index f315418e561f3e9a720ed26d095e036e28538f51..7b2c0329de5de7fdb72cf7fd0de1130bee681c19 100644 (file)
@@ -1,6 +1,6 @@
 class nodo::role::web inherits nodo::base::virtual {
   # Hidden services
-  $hidden = hiera('apache::site::hidden', false)
+  $hidden = lookup('apache::site::hidden', undef, undef, false)
   if $hidden == true {
     include onion
   }
@@ -11,14 +11,14 @@ class nodo::role::web inherits nodo::base::virtual {
   include domain_check
 
   ## Reprepro configuration
-  #$reprepro         = hiera('nodo::web::reprepro', false)
+  #$reprepro         = lookup('nodo::web::reprepro', undef, undef, false)
   #$reprepro_basedir = '/var/reprepro'
   #
   #case $reprepro {
   #  true,'enabled': {
   #    class { 'reprepro':
   #      basedir   => '/var/reprepro',
-  #      uploaders => hiera('nodo::web::reprepro_uploaders', [ ]),
+  #      uploaders => lookup('nodo::web::reprepro_uploaders', undef, undef, [ ]),
   #    }
   #
   #    include reprepro::cron
index d047c83b54e8f873659510d319a35bec0860416d..9cb419950da6b6ab204a3b2fae3cf07d1e366bd6 100644 (file)
@@ -5,7 +5,7 @@ class nodo::role::yacy inherits nodo::base::virtual {
     ensure => installed,
   }
 
-  $yacy_status = hiera('nodo::role::yacy::status', 'running')
+  $yacy_status = lookup('nodo::role::yacy::status', undef, undef, 'running')
 
   service { 'yacy':
     ensure  => $yacy_status,
index 8126249388d009935897f1335deea0b128737327..bfdffaabb5ef55a6d01901d3fe13f086c0e3b443 100644 (file)
@@ -4,20 +4,20 @@ class nodo::subsystem::backup {
   #
   class { '::backup': }
 
-  $local_backup = hiera('nodo::subsystem::backup::localhost', false)
+  $local_backup = lookup('nodo::subsystem::backup::localhost', undef, undef, false)
 
   # Local encrypted backup
   case $local_backup {
     true,enabled,present: {
       backup::duplicity { "localhost":
-        encryptkey => hiera('nodo::subsystem::backup::encryptkey', false),
-        password   => hiera('nodo::subsystem::backup::password'),
+        encryptkey => lookup('nodo::subsystem::backup::encryptkey', undef, undef, false),
+        password   => lookup('nodo::subsystem::backup::password'),
       }
     }
     false,absent: {
       backup::duplicity { "localhost":
-        encryptkey => hiera('nodo::subsystem::backup::encryptkey', false),
-        password   => hiera('nodo::subsystem::backup::password',   false),
+        encryptkey => lookup('nodo::subsystem::backup::encryptkey', undef, undef, false),
+        password   => lookup('nodo::subsystem::backup::password', undef, undef,   false),
         ensure     => absent,
       }
     }
@@ -25,10 +25,10 @@ class nodo::subsystem::backup {
   }
 
   # Setup rsync instances
-  $rsync = hiera('backup::rsync', {})
+  $rsync = lookup('backup::rsync', undef, undef, {})
   create_resources('backup::rsync', $rsync)
 
   # Setup borg instances
-  $borg = hiera('backup::borg', {})
+  $borg = lookup('backup::borg', undef, undef, {})
   create_resources('backup::borg', $borg)
 }
index e67a6e84ceccac921c349e656065840d8e45a213..e809f1addf16ac94910253d0e148f8dca307b9df 100644 (file)
@@ -1,7 +1,7 @@
 class nodo::subsystem::dhclient(
-  $ensure                  = hiera('nodo::subsystem::dhclient::ensure',                  'present'),
-  $supersede_domain_name   = hiera('nodo::subsystem::dhclient::supersede_domain_name',   $::domain),
-  $supersede_domain_search = hiera('nodo::subsystem::dhclient::supersede_domain_search', $::domain)
+  $ensure                  = lookup('nodo::subsystem::dhclient::ensure', undef, undef,                  'present'),
+  $supersede_domain_name   = lookup('nodo::subsystem::dhclient::supersede_domain_name', undef, undef,   $::domain),
+  $supersede_domain_search = lookup('nodo::subsystem::dhclient::supersede_domain_search', undef, undef, $::domain)
 ) {
   package { 'isc-dhcp-client':
     ensure => $ensure,
index 341a827cb3bb2edfbaff973a86b771f3a8a86dbd..54d112b79dcc0e8afdebbea99aca7e96b86c4306 100644 (file)
@@ -1,5 +1,5 @@
 class nodo::subsystem::hosts(
-  $custom = hiera('nodo::subsystem::hosts::custom', false)
+  $custom = lookup('nodo::subsystem::hosts::custom', undef, undef, false)
 ) {
   # Sometimes might be useful to manage the whole
   # hosts file, see http://projects.puppetlabs.com/issues/10704
index d0773e93e16bd1274dac6d1b8141f8d81d2161a3..2bfd75e57706e872aae54429b8f9c1da525e38be 100644 (file)
@@ -1,6 +1,6 @@
 class nodo::subsystem::mail {
   # Email delivery configuration
-  $mail_delivery = hiera('nodo::subsystem::mail::delivery', 'exim')
+  $mail_delivery = lookup('nodo::subsystem::mail::delivery', undef, undef, 'exim')
 
   # A handy SMTP wrapper
   include nodo::subsystem::mail::msmtp
@@ -15,9 +15,9 @@ class nodo::subsystem::mail {
 
   case $mail_delivery {
     'tunnel': {
-      $mail_hostname = hiera('nodo::subsystem::mail::hostname')
+      $mail_hostname = lookup('nodo::subsystem::mail::hostname')
       tunnel::autossh::mail { "$mail_hostname":
-        sshport   => hiera('nodo::subsystem::mail::ssh_port'),
+        sshport   => lookup('nodo::subsystem::mail::ssh_port'),
       }
     }
     'postfix', 'disabled': { }
index b67ddbdf30a1266f25b4175617abfb7c89110291..1319e73817884eb599db71e76d6c1cbc330e28a8 100644 (file)
@@ -3,7 +3,7 @@ class nodo::subsystem::media {
   class { [ 'nodo::subsystem::media::folders', 'nodo::subsystem::media::groups' ]: }
   
   # Make sure basic media exist, no matter if there is an external disk attached
-  $cache = hiera('nodo::media::folders', '')
+  $cache = lookup('nodo::media::folders', undef, undef, '')
 
   if $cache != '' {
     file { "${cache}":
index a745a5442b056fb351fff4424b274565520f8002..8afbca8582e41a16675037c5eb6011201972e2ed 100644 (file)
@@ -1,8 +1,8 @@
 class nodo::subsystem::media::folders(
-  $base  = hiera('nodo::subsystem::media::folders::base',  '/var/cache/media'),
-  $cache = hiera('nodo::subsystem::media::folders::cache', directory),
-  $owner = hiera('nodo::subsystem::media::folders::owner', false),
-  $group = hiera('nodo::subsystem::media::folders::group', false)
+  $base  = lookup('nodo::subsystem::media::folders::base', undef, undef,  '/var/cache/media'),
+  $cache = lookup('nodo::subsystem::media::folders::cache', undef, undef, directory),
+  $owner = lookup('nodo::subsystem::media::folders::owner', undef, undef, false),
+  $group = lookup('nodo::subsystem::media::folders::group', undef, undef, false)
 ) {
   # Removable media folders
   file { [ "/media/usb", "/media/cdrom", "/media/tablet", "/media/phone" ]:
index 13372caf45cb9f1649823890be7d66eac8c5bcb1..ab3bc18c91bfe50f5c0fe997adbdb2a49bccade0 100644 (file)
@@ -1,6 +1,6 @@
 define nodo::subsystem::monkeysphere(
-  $port           = hiera('nodo::monkeysphere_host::ssh_port', ''),
-  $mail_recipient = hiera('mail::root_mail_recipient', 'nobody')
+  $port           = lookup('nodo::monkeysphere_host::ssh_port', undef, undef, ''),
+  $mail_recipient = lookup('mail::root_mail_recipient', undef, undef, 'nobody')
 ) {
   include monkeysphere
 
index df671eb9aad35ffeb4c856f136fc4bbd35966c3d..1ce0038d0d99f3db77200202b84f137d2f33756a 100644 (file)
@@ -1,6 +1,6 @@
 class nodo::subsystem::motd(
-  $message      = hiera('nodo::subsystem::motd::message', ''),
-  $network_name = hiera('nodo::subsystem::motd::network_name', 'Nodo')
+  $message      = lookup('nodo::subsystem::motd::message', undef, undef, ''),
+  $network_name = lookup('nodo::subsystem::motd::network_name', undef, undef, 'Nodo')
 ) {
   if $message != '' {
     $append = "${message}\n"
index 94f8194ed6b7f8d1138396205abd8c203ccfa251..b3e8edcfd4371431a967a94fe9796588b40f21a2 100644 (file)
@@ -21,7 +21,7 @@ define nodo::subsystem::nas::share(
   #
   # DLNA share
   #
-  $dlna = hiera('nodo::role::nas::dlna', false)
+  $dlna = lookup('nodo::role::nas::dlna', undef, undef, false)
 
   if $dlna == true and $dlna_type != '' {
     minidlna::share { $folder:
@@ -35,7 +35,7 @@ define nodo::subsystem::nas::share(
   #
   # Samba share
   #
-  $samba = hiera('nodo::role::nas::samba', false)
+  $samba = lookup('nodo::role::nas::samba', undef, undef, false)
 
   if $samba == true {
     samba::server::share { $name:
@@ -74,7 +74,7 @@ define nodo::subsystem::nas::share(
   #
   # NFS export
   #
-  $nfs = hiera('nodo::role::nas::nfs', false)
+  $nfs = lookup('nodo::role::nas::nfs', undef, undef, false)
 
   if $nfs == true {
     nfs::export { $name:
@@ -87,7 +87,7 @@ define nodo::subsystem::nas::share(
   #
   # HTTP and FTP symlinks to media assets
   #
-  $http = hiera('nodo::role::nas::http', false)
+  $http = lookup('nodo::role::nas::http', undef, undef, false)
 
   if $http == true {
     file { [ "/var/www/data/${name}", "/home/ftp/${name}" ]:
@@ -99,7 +99,7 @@ define nodo::subsystem::nas::share(
   #
   # Avahi service
   #
-  $avahi = hiera('nodo::role::nas::avahi', false)
+  $avahi = lookup('nodo::role::nas::avahi', undef, undef, false)
 
   if $avahi == true and $nfs == true {
     file { "/etc/avahi/services/nfs-${name}.service":
@@ -113,7 +113,7 @@ define nodo::subsystem::nas::share(
   }
 
   # Make sure basic media exist, no matter which disk is attached
-  $cache = hiera('nodo::subsystem::media::folders::base', '/var/cache/media')
+  $cache = lookup('nodo::subsystem::media::folders::base', undef, undef, '/var/cache/media')
 
   if $cache != '' and $manage_folder != false {
     file { [ "${cache}/${name}" ]:
index cca76098a2c072f4c84f673a47b26a119941640c..00fe6c63c26de7939ae814a9022216af828a8026 100644 (file)
@@ -1,8 +1,8 @@
 class nodo::subsystem::resolver(
-  $manage      = hiera('nodo::subsystem::resolver::manage',      false),
-  $nameservers = hiera('nodo::subsystem::resolver::nameservers', ''),
-  $domain      = hiera('nodo::subsystem::resolver::domain',      $::domain),
-  $search      = hiera('nodo::subsystem::resolver::search',      $::fqdn)
+  $manage      = lookup('nodo::subsystem::resolver::manage', undef, undef,      false),
+  $nameservers = lookup('nodo::subsystem::resolver::nameservers', undef, undef, ''),
+  $domain      = lookup('nodo::subsystem::resolver::domain', undef, undef,      $::domain),
+  $search      = lookup('nodo::subsystem::resolver::search', undef, undef,      $::fqdn)
 ) {
   # DNS resolver
   case $manage {
index 89b0cc341c121e3efa53b1734ff38adf0b56a127..b1401cd64808a698ab7d9bccf130b1e80f63210c 100644 (file)
@@ -1,4 +1,4 @@
-class nodo::subsystem::scanner($access_list = hiera('nodo::subsystem::scanner::access_list', '')) {
+class nodo::subsystem::scanner($access_list = lookup('nodo::subsystem::scanner::access_list', undef, undef, '')) {
   package { [ 'sane', 'sane-utils' ]:
     ensure  => present,
   }
index 873f8b935de4e31f28cb6a457baae84377a7e9c2..c1eb92d3686925e30af5da4547383d06f698502e 100644 (file)
@@ -1,4 +1,4 @@
-class nodo::subsystem::scanner::client($server = hiera('nodo::subsystem::scanner::client::hostname', 'localhost')) {
+class nodo::subsystem::scanner::client($server = lookup('nodo::subsystem::scanner::client::hostname', undef, undef, 'localhost')) {
   package { 'sane':
     ensure  => present,
   }
index 15f9b5671203f28f3831d9bc3e8dbb50b3ea13fa..1c3a84767ea7eb3aa60896fb5e600b52655c860f 100644 (file)
@@ -1,8 +1,8 @@
 class nodo::subsystem::screen::startup(
-  $windows = hiera('nodo::subsystem::screen::startup::windows', [ "${::hostname} 0 bash -c \"tail -F /var/log/*log /var/log/*/*log\"",
-                                                                  "journal 1 journalctl -f",
-                                                                  "top 2 top" ]),
-  $select  = hiera('nodo::subsystem::screen::startup::select', 1)
+  $windows = lookup('nodo::subsystem::screen::startup::windows', undef, undef, [ "${::hostname} 0 bash -c \"tail -F /var/log/*log /var/log/*/*log\"",
+                                                                    "journal 1 journalctl -f",
+                                                                    "top 2 top" ]),
+  $select  = lookup('nodo::subsystem::screen::startup::select', undef, undef, 1)
 ) {
   file { "/etc/screenrc.startup":
     content => template('nodo/screen/screenrc.erb'),
index c520c9e3c12042b160d547d5def6d34c00bdf128..dd0968b4b9b53ec72dbc03d0063fb4854db1e940 100644 (file)
@@ -1,5 +1,5 @@
 class nodo::subsystem::sshd {
-  $manage = hiera('nodo::subsystem::sshd::manage', true)
+  $manage = lookup('nodo::subsystem::sshd::manage', undef, undef, true)
 
   if $manage == true {
     include ::sshd
index 23b1e962659863523d8da444e35b628c2cedad51..26575428700c120ea1029525250f7e219332441f 100644 (file)
@@ -1,4 +1,4 @@
-class nodo::subsystem::sysctl::appliance($kernel_panic = hiera('nodo::sysctl::appliance', '20')) {
+class nodo::subsystem::sysctl::appliance($kernel_panic = lookup('nodo::sysctl::appliance', undef, undef, '20')) {
   file { "/etc/sysctl.d/kernel.panic.conf":
     owner   => "root",
     group   => "root",
index 2404d8f8d6a603603b9881dab7ad5a682f399bfd..2c384c3877ddd757b4e0d3140edbd94c8b80dd99 100644 (file)
@@ -1,7 +1,7 @@
 # Do not enable ipv6 by default
 # See https://wiki.debian.org/DebianIPv6
 class nodo::subsystem::sysctl::disable_ipv6(
-  $ensure = hiera('nodo::sysctl::disable_ipv6', 'present'),
+  $ensure = lookup('nodo::sysctl::disable_ipv6', undef, undef, 'present'),
 ) {
   file { "/etc/sysctl.d/disable_ipv6.conf":
     owner   => "root",
index c1f66508a92b3faf13656c0601e6738633c4a8b0..ca90e27d44264265694185682d68c70bac3a83da 100644 (file)
@@ -3,7 +3,7 @@
 # http://coolnerd.co/2016/08/researchers-announce-linux-kernel-network-snooping-bug-naked-security/
 # https://nakedsecurity.sophos.com/2016/08/12/researchers-announce-linux-kernel-network-snooping-bug/
 class nodo::subsystem::sysctl::tcp_challenge_ack_limit(
-  $ensure = hiera('nodo::sysctl::tcp_challenge_ack_limit', 'present'),
+  $ensure = lookup('nodo::sysctl::tcp_challenge_ack_limit', undef, undef, 'present'),
 ) {
   file { "/etc/sysctl.d/tcp_challenge_ack_limit.conf":
     owner   => "root",
index 2e42519448a84c418b29604dbe047c1589d03c10..734c02583cbfc3b26331a7bd6bcc54b19654088b 100644 (file)
@@ -1,5 +1,5 @@
 class nodo::subsystem::udev::network {
-  $role = hiera('nodo::role', 'default')
+  $role = lookup('nodo::role', undef, undef, 'default')
 
   file { '/etc/udev/rules.d/70-persistent-net.rules':
     ensure  => present,
index 59e26a3fc2540c91cae722b59f110f0162d91e1f..09a79a65e470279cb81471b96945eaba05f6ac2d 100644 (file)
@@ -18,7 +18,7 @@ class nodo::utils::java (
   # Java alternative
   file { "/etc/alternatives/java":
     ensure  => $ensure ? {
-      'present','installed','latest' => hiera('nodo::utils::java::alternative', '/usr/lib/jvm/java-6-openjdk-amd64/jre/bin/java'),
+      'present','installed','latest' => lookup('nodo::utils::java::alternative', undef, undef, '/usr/lib/jvm/java-6-openjdk-amd64/jre/bin/java'),
       default                        => undef,
     },
     owner   => root,
index ed40c11622a64e3be8b208a15b8f8565c0cbb2d9..3b87dc3c6df0885f35ad130c1b37ef071f3ba371 100644 (file)
@@ -51,6 +51,6 @@ class nodo::utils::multimedia inherits nodo::utils::multimedia::minimal {
   }
 
   # Flash implementation (deprecated)
-  #$flash = hiera('nodo::utils::multimedia::flash', 'gnash')
+  #$flash = lookup('nodo::utils::multimedia::flash', undef, undef, 'gnash')
   #class { "nodo::utils::multimedia::${flash}": }
 }