From a0b6e70c19fd615a499281f7e1752d16c1746cd9 Mon Sep 17 00:00:00 2001 From: Cedric DEFORTIS Date: Mon, 19 Feb 2018 09:43:59 +0100 Subject: [PATCH] Fix lint warnings --- examples/chroot.pp | 2 +- manifests/chroot/manual.pp | 19 ++++++++++--------- manifests/chroot/package.pp | 1 + manifests/init.pp | 2 +- 4 files changed, 13 insertions(+), 11 deletions(-) diff --git a/examples/chroot.pp b/examples/chroot.pp index cf50fec..dcd7ed9 100644 --- a/examples/chroot.pp +++ b/examples/chroot.pp @@ -1,4 +1,4 @@ -class { 'bind': +class { '::bind': chroot => true, # Note: this file MUST be into the /etc/named directory so the # RHEL7 specific setup-named-chroot.sh script will make it available into diff --git a/manifests/chroot/manual.pp b/manifests/chroot/manual.pp index d3fc3a3..8a002a0 100644 --- a/manifests/chroot/manual.pp +++ b/manifests/chroot/manual.pp @@ -1,13 +1,14 @@ +# Chroot class for distribution without specific packaging class bind::chroot::manual( $chroot_dir = $::bind::defaults::chroot_dir, ) inherits bind::defaults { exec { 'mkdir-p-$chroot_dir': command => "mkdir -p ${::bind::defaults::chroot_dir}", path => ['/bin', '/usr/bin'], - creates => "${::bind::defaults::chroot_dir}", + creates => $::bind::defaults::chroot_dir, } # Creating system dirs under chroot dir: - file { ["${::bind::defaults::chroot_dir}", + file { [$::bind::defaults::chroot_dir, "${::bind::defaults::chroot_dir}/etc", "${::bind::defaults::chroot_dir}/dev", "${::bind::defaults::chroot_dir}/var", @@ -20,9 +21,9 @@ class bind::chroot::manual( file { ["${::bind::defaults::chroot_dir}/var/cache/bind", "${::bind::defaults::chroot_dir}/var/run/named"]: - ensure => directory, - mode => '0775', - group => $::bind::defaults::bind_group, + ensure => directory, + mode => '0775', + group => $::bind::defaults::bind_group, require => Exec['mkdir-p-$chroot_dir'], } @@ -42,8 +43,8 @@ class bind::chroot::manual( creates => "${::bind::defaults::chroot_dir}/dev/urandom", } file { [ "${::bind::defaults::chroot_dir}/dev/null", - "${::bind::defaults::chroot_dir}/dev/random", - "${::bind::defaults::chroot_dir}/dev/urandom"]: + "${::bind::defaults::chroot_dir}/dev/random", + "${::bind::defaults::chroot_dir}/dev/urandom"]: mode => '0660', require => [ Exec['mknod-dev-null'], Exec['mknod-dev-random'], Exec['mknod-dev-urandom'] ], } @@ -54,7 +55,7 @@ class bind::chroot::manual( require => [ Package['bind'], File["${::bind::defaults::chroot_dir}/etc"] ], } -> file { '/etc/bind': - ensure => link, - target => "${::bind::defaults::chroot_dir}${::bind::defaults::confdir}", + ensure => link, + target => "${::bind::defaults::chroot_dir}${::bind::defaults::confdir}", } } diff --git a/manifests/chroot/package.pp b/manifests/chroot/package.pp index fc3e38f..9e27197 100644 --- a/manifests/chroot/package.pp +++ b/manifests/chroot/package.pp @@ -1,3 +1,4 @@ +# Chroot class for distribution using dedicated package class bind::chroot::package( $chroot_dir = $::bind::defaults::chroot_dir, ) inherits bind::defaults { diff --git a/manifests/init.pp b/manifests/init.pp index f3e9bed..ec31384 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -19,7 +19,7 @@ class bind ( # especially when not using hiera (i.e. when using Foreman as ENC): $default_zones_include = $::bind::defaults::default_zones_include, ) inherits bind::defaults { - if $chroot and !$chroot_supported { + if $chroot and !$::bind::defaults::chroot_supported { fail('Chroot for bind is not supported on your OS') } File {