diff --git a/.fixtures.yml b/.fixtures.yml index 11a6f91..245f671 100644 --- a/.fixtures.yml +++ b/.fixtures.yml @@ -1,3 +1,4 @@ +--- fixtures: repositories: stdlib: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b66d8ca..7216724 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,7 +4,12 @@ name: CI -on: pull_request +on: + pull_request: {} + push: + branches: + - main + - master concurrency: group: ${{ github.ref_name }} diff --git a/.msync.yml b/.msync.yml index f818344..f46ee02 100644 --- a/.msync.yml +++ b/.msync.yml @@ -2,4 +2,4 @@ # Managed by modulesync - DO NOT EDIT # https://voxpupuli.org/docs/updating-files-managed-with-modulesync/ -modulesync_config_version: '7.2.0' +modulesync_config_version: '7.3.0' diff --git a/manifests/files.pp b/manifests/files.pp index 6d5ddd5..3be4b05 100644 --- a/manifests/files.pp +++ b/manifests/files.pp @@ -33,15 +33,15 @@ # define swap_file::files ( Enum['absent','present'] $ensure = 'present', - Stdlib::Unixpath $swapfile = '/mnt/swap.1', + Stdlib::Absolutepath $swapfile = '/mnt/swap.1', $swapfilesize = $facts['memory']['system']['total'], Boolean $add_mount = true, - $options = 'defaults', + String $options = 'defaults', $timeout = 300, - $cmd = 'dd', - $resize_existing = false, + String $cmd = 'dd', + Bootlan $resize_existing = false, $resize_margin = '50MB', - $resize_verbose = false, + Boolean $resize_verbose = false, ) { # Parameter validation $swapfilesize_mb = to_bytes($swapfilesize) / 1048576 diff --git a/manifests/init.pp b/manifests/init.pp index ac27f43..0d56b65 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -40,19 +40,12 @@ # @author - Peter Souter # class swap_file ( - Hash $files = {}, - Variant[Boolean,Enum['true','false']] $files_hiera_merge = false, + Hash $files = {}, + Boolean $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', {}) + if $files_hiera_merge { + $files_real = hiera_hash('swap_file::files', {}) } else { $files_real = $files } diff --git a/manifests/resize.pp b/manifests/resize.pp index 51f7ab1..77cef0b 100644 --- a/manifests/resize.pp +++ b/manifests/resize.pp @@ -16,11 +16,11 @@ # @author - Peter Souter # define swap_file::resize ( - $swapfile_path, + Stdlib::Absolutepath $swapfile_path, $expected_swapfile_size, $actual_swapfile_size, - $margin = '50MB', - $verbose = false, + $margin = '50MB', + Boolean $verbose = false, ) { $margin_bytes = to_bytes($margin) $existing_swapfile_bytes = to_bytes("${actual_swapfile_size}kb") diff --git a/metadata.json b/metadata.json index e1796c2..9141f2e 100644 --- a/metadata.json +++ b/metadata.json @@ -11,23 +11,31 @@ { "operatingsystem": "RedHat", "operatingsystemrelease": [ - "5", - "6", - "7" + "7", + "8", + "9" + ] + }, + { + "operatingsystem": "CentOS", + "operatingsystemrelease": [ + "7", + "8", + "9" ] }, { "operatingsystem": "Debian", "operatingsystemrelease": [ - "6", - "7" + "11", + "12" ] }, { "operatingsystem": "Ubuntu", "operatingsystemrelease": [ - "12.04", - "14.04" + "20.04", + "22.04" ] } ],