Puppet Class: swap_file
- Defined in:
- manifests/init.pp
Overview
Main class to allow passing required swapfiles as hashes
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
# File 'manifests/init.pp', line 42
class swap_file (
Hash $files = {},
Variant[Boolean,Enum['true','false']] $files_hiera_merge = false,
) {
# variable handling
if $files_hiera_merge =~ Boolean {
$files_hiera_merge_bool = $files_hiera_merge
} else {
$files_hiera_merge_bool = str2bool($files_hiera_merge)
}
# functionality
if $files_hiera_merge_bool == true {
$files_real = lookup('swap_file::files', Hash, 'deep', {})
} else {
$files_real = $files
}
if $files_real != undef {
create_resources('swap_file::files', $files_real)
}
}
|