]> gitweb.fluxo.info Git - puppet-backup.git/commitdiff
Hiera 5 migration
authorSilvio Rhatto <rhatto@riseup.net>
Thu, 7 May 2020 23:55:39 +0000 (20:55 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Thu, 7 May 2020 23:55:39 +0000 (20:55 -0300)
manifests/init.pp
manifests/params.pp
manifests/user.pp

index f4ce07cf50cbd567185950cb6b2b55073c48af79..fee575c0385f77d6d5fd35afcbffbba1365a9541 100644 (file)
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 class backup(
-  $when          = hiera('backup::when',          'everyday at 01:00'),
-  $audit_rsync   = hiera('backup::audit_rsync',   true),
-  $reportwarning = hiera('backup::reportwarning', true),
-  $hwinfo        = hiera('backup::hwinfo',        'installed')
+  $when          = lookup('backup::when', undef, undef,          'everyday at 01:00'),
+  $audit_rsync   = lookup('backup::audit_rsync', undef, undef,   true),
+  $reportwarning = lookup('backup::reportwarning', undef, undef, true),
+  $hwinfo        = lookup('backup::hwinfo', undef, undef,       'installed')
 ) {
 
   include backup::params
index 212fd8ebe8e6ae26cac71f3e78c67cd7b29d3187..5c25b1d3311715e0d157e6f4b0d902af63d9f94c 100644 (file)
@@ -1,9 +1,9 @@
 class backup::params {
   # backup folder
-  $backupdir        = hiera('backup::dir',         "/var/backups")
-  $backupdir_remote = hiera('backup::dir::remote', "$backupdir/remote")
-  $backupdir_users  = hiera('backup::dir::users',  "$backupdir/users")
-  $backupdir_ensure = hiera('backup::dir::ensure', 'directory')
+  $backupdir        = lookup('backup::dir', undef, undef,         "/var/backups")
+  $backupdir_remote = lookup('backup::dir::remote', undef, undef, "$backupdir/remote")
+  $backupdir_users  = lookup('backup::dir::users', undef, undef,  "$backupdir/users")
+  $backupdir_ensure = lookup('backup::dir::ensure', undef, undef, 'directory')
 
   # for data that's going to be encrypted and signed
   $include_unencrypted = [ "/etc", "/var", "/home", "/root" ]
index 3ada103498831867086a88df7ae95f8565105a97..d31fb3a82c9d2f4fe35aa6dfc10d28b70b5fe824 100644 (file)
@@ -5,7 +5,7 @@
 define backup::user(
   $ensure         = present,
   $hosting_domain = $::domain,
-  $sshkey         = hiera("'ssh_authorized_key::${name}.${hosting_domain}'"),
+  $sshkey         = lookup("'ssh_authorized_key::${name}.${hosting_domain}'"),
 ) {
   user::manage { $name:
     ensure   => $ensure,