Skip to content

Commit

Permalink
Fixes Issue-104 - No Hiera support (voxpupuli#128)
Browse files Browse the repository at this point in the history
* Fixes Issue-104 - No Hiera support

Hiera hash are managed only if they exist 
+ hiera lookups outside of the variables part of the manifest.

* Puppet lint fix

https://travis-ci.org/voxpupuli/puppet-selinux/jobs/173201284

* Another lint fix

* Fix following @jyaworski comment

* Puppet lint
  • Loading branch information
ryayon authored and jyaworski committed Nov 7, 2016
1 parent ad96003 commit dab72fd
Showing 1 changed file with 21 additions and 8 deletions.
29 changes: 21 additions & 8 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,13 @@
$package_name = $::selinux::params::package_name,

### START Hiera Lookups ###
$selinux_booleans = {},
$selinux_modules = {},
$selinux_fcontexts = {},
$selinux_ports = {}
$boolean = undef,
$fcontext = undef,
$module = undef,
$permissive = undef,
$port = undef,
### END Hiera Lookups ###

) inherits selinux::params {

$mode_real = $mode ? {
Expand All @@ -60,8 +62,19 @@
} ->
class { '::selinux::config': }

create_resources('selinux::boolean', $selinux_booleans)
create_resources('selinux::module', $selinux_modules)
create_resources('selinux::fcontext', $selinux_fcontexts)
create_resources('selinux::port', $selinux_ports)
if $boolean {
create_resources ( 'selinux::boolean', hiera_hash('selinux::boolean') )
}
if $fcontext {
create_resources ( 'selinux::fcontext', hiera_hash('selinux::fcontext') )
}
if $module {
create_resources ( 'selinux::module', hiera_hash('selinux::module') )
}
if $permissive {
create_resources ( 'selinux::fcontext', hiera_hash('selinux::permissive') )
}
if $port {
create_resources ( 'selinux::port', hiera_hash('selinux::port') )
}
}

0 comments on commit dab72fd

Please sign in to comment.