From 819db52ff4835dca1e29bd868c24d99e32091500 Mon Sep 17 00:00:00 2001 From: markuszilch Date: Mon, 25 Mar 2024 23:09:10 +0100 Subject: [PATCH] add datatypes to parameters --- REFERENCE.md | 52 ++++++++++++++-------------- manifests/init.pp | 18 +++++----- manifests/install/bundle.pp | 4 +-- manifests/install/gem.pp | 4 +-- manifests/mcollective.pp | 10 +++--- manifests/mcollective/application.pp | 12 +++---- manifests/postrun_command.pp | 2 +- manifests/prerun_command.pp | 2 +- manifests/webhook.pp | 15 ++++++-- 9 files changed, 65 insertions(+), 54 deletions(-) diff --git a/REFERENCE.md b/REFERENCE.md index a6cdbfab..0eba9768 100644 --- a/REFERENCE.md +++ b/REFERENCE.md @@ -82,7 +82,7 @@ The following parameters are available in the `r10k` class: ##### `remote` -Data type: `Any` +Data type: `String[1]` @@ -98,7 +98,7 @@ Default value: `'/etc/puppetlabs/r10k/r10k.yaml'` ##### `version` -Data type: `Any` +Data type: `String[1]` @@ -106,7 +106,7 @@ Default value: `$r10k::params::version` ##### `puppet_master` -Data type: `Any` +Data type: `Boolean` @@ -114,7 +114,7 @@ Default value: `$r10k::params::puppet_master` ##### `modulepath` -Data type: `Any` +Data type: `String[1]` @@ -146,7 +146,7 @@ Default value: `$r10k::params::r10k_basedir` ##### `package_name` -Data type: `Any` +Data type: `String[1]` @@ -154,7 +154,7 @@ Default value: `$r10k::params::package_name` ##### `provider` -Data type: `Any` +Data type: `String[1]` @@ -178,7 +178,7 @@ Default value: `[]` ##### `mcollective` -Data type: `Any` +Data type: `Boolean` @@ -202,7 +202,7 @@ Default value: `{ 'generate_types' => true, 'exclude_spec' => true, }` ##### `root_user` -Data type: `Any` +Data type: `String[1]` @@ -218,7 +218,7 @@ Default value: `undef` ##### `root_group` -Data type: `Any` +Data type: `String[1]` @@ -333,7 +333,7 @@ The following parameters are available in the `r10k::install::bundle` class: ##### `revision` -Data type: `Any` +Data type: `String[1]` @@ -341,7 +341,7 @@ Default value: `'master'` ##### `source` -Data type: `Any` +Data type: `String[1]` @@ -360,13 +360,13 @@ The following parameters are available in the `r10k::install::gem` class: ##### `manage_ruby_dependency` -Data type: `Any` +Data type: `String[1]` ##### `version` -Data type: `Any` +Data type: `String[1]` R10k gem version @@ -390,7 +390,7 @@ The following parameters are available in the `r10k::mcollective` class: ##### `ensure` -Data type: `Any` +Data type: `String[1]` @@ -398,7 +398,7 @@ Default value: `'present'` ##### `server` -Data type: `Any` +Data type: `Boolean` @@ -406,7 +406,7 @@ Default value: `true` ##### `client` -Data type: `Any` +Data type: `Boolean` @@ -414,7 +414,7 @@ Default value: `true` ##### `http_proxy` -Data type: `Any` +Data type: `String` @@ -422,7 +422,7 @@ Default value: `''` ##### `policies` -Data type: `Any` +Data type: `Array` @@ -445,7 +445,7 @@ The following parameters are available in the `r10k::mcollective::application` c ##### `agent_name` -Data type: `Any` +Data type: `Optional[String]` @@ -453,7 +453,7 @@ Default value: `$r10k::params::mc_agent_name` ##### `app_name` -Data type: `Any` +Data type: `Optional[String]` @@ -461,7 +461,7 @@ Default value: `$r10k::params::mc_app_name` ##### `agent_ddl` -Data type: `Any` +Data type: `Optional[String]` @@ -469,7 +469,7 @@ Default value: `$r10k::params::mc_agent_ddl_name` ##### `agent_path` -Data type: `Any` +Data type: `Optional[String]` @@ -477,7 +477,7 @@ Default value: `$r10k::params::mc_agent_path` ##### `app_path` -Data type: `Any` +Data type: `Optional[String]` @@ -485,7 +485,7 @@ Default value: `$r10k::params::mc_application_path` ##### `mc_service` -Data type: `Any` +Data type: `Optional[String]` @@ -508,7 +508,7 @@ The following parameters are available in the `r10k::postrun_command` class: ##### `command` -Data type: `Any` +Data type: `String[1]` @@ -535,7 +535,7 @@ The following parameters are available in the `r10k::prerun_command` class: ##### `command` -Data type: `Any` +Data type: `String[1]` diff --git a/manifests/init.pp b/manifests/init.pp index 4ec767e4..c5465086 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -40,31 +40,31 @@ # @param ensure # if r10k should be installed or purged class r10k ( - $remote = $r10k::params::remote, + String[1] $remote = $r10k::params::remote, Optional[Hash] $sources = undef, Stdlib::Absolutepath $cachedir = "${facts['puppet_vardir']}/r10k", Stdlib::Absolutepath $configfile = '/etc/puppetlabs/r10k/r10k.yaml', - $version = $r10k::params::version, - $puppet_master = $r10k::params::puppet_master, - $modulepath = $r10k::params::modulepath, + String[1] $version = $r10k::params::version, + Boolean $puppet_master = $r10k::params::puppet_master, + String[1] $modulepath = $r10k::params::modulepath, Boolean $manage_modulepath = $r10k::params::manage_modulepath, Enum['include','declare','ignore'] $manage_ruby_dependency = $r10k::params::manage_ruby_dependency, Stdlib::Absolutepath $r10k_basedir = $r10k::params::r10k_basedir, - $package_name = $r10k::params::package_name, - $provider = $r10k::params::provider, + String[1] $package_name = $r10k::params::package_name, + String[1] $provider = $r10k::params::provider, String $gentoo_keywords = '', # lint:ignore:params_empty_string_assignment Variant[Array,String] $install_options = [], - $mcollective = $r10k::params::mcollective, + Boolean $mcollective = $r10k::params::mcollective, Boolean $manage_configfile_symlink = false, Stdlib::Absolutepath $configfile_symlink = '/etc/r10k.yaml', Optional[Hash] $git_settings = undef, Optional[Hash] $forge_settings = undef, Hash $deploy_settings = { 'generate_types' => true, 'exclude_spec' => true, }, - $root_user = $r10k::params::root_user, + String[1] $root_user = $r10k::params::root_user, Optional[String[1]] $proxy = undef, Integer[1] $pool_size = $facts['processors']['count'], Optional[String[1]] $gem_source = undef, - $root_group = $r10k::params::root_group, + String[1] $root_group = $r10k::params::root_group, Optional[Array[String[1]]] $postrun = undef, Boolean $include_prerun_command = false, Boolean $include_postrun_command = false, diff --git a/manifests/install/bundle.pp b/manifests/install/bundle.pp index 2e56270e..3918a53d 100644 --- a/manifests/install/bundle.pp +++ b/manifests/install/bundle.pp @@ -4,8 +4,8 @@ # @param source # class r10k::install::bundle ( - $revision = 'master', - $source = 'https://github.com/adrienthebo/r10k.git', + String[1] $revision = 'master', + String[1] $source = 'https://github.com/adrienthebo/r10k.git', ) { # The bundle install has prefix support as of writing this, I want bleeding edge. package { "${module_name}-bundle": diff --git a/manifests/install/gem.pp b/manifests/install/gem.pp index 6b97e589..592c2f16 100644 --- a/manifests/install/gem.pp +++ b/manifests/install/gem.pp @@ -5,8 +5,8 @@ # R10k gem version # class r10k::install::gem ( - $manage_ruby_dependency, - $version, + String[1] $manage_ruby_dependency, + String[1] $version, ) { case $manage_ruby_dependency { 'include': { diff --git a/manifests/mcollective.pp b/manifests/mcollective.pp index b59d8509..fbe039a7 100644 --- a/manifests/mcollective.pp +++ b/manifests/mcollective.pp @@ -7,11 +7,11 @@ # @param policies # class r10k::mcollective ( - $ensure = 'present', - $server = true, - $client = true, - $http_proxy = '', - $policies = [], + String[1] $ensure = 'present', + Boolean $server = true, + Boolean $client = true, + String $http_proxy = '', # lint:ignore:params_empty_string_assignment + Array $policies = [], ) inherits r10k::params { include mcollective mcollective::module_plugin { 'mcollective_agent_r10k': diff --git a/manifests/mcollective/application.pp b/manifests/mcollective/application.pp index 2b126294..e0075f21 100644 --- a/manifests/mcollective/application.pp +++ b/manifests/mcollective/application.pp @@ -8,12 +8,12 @@ # @param mc_service # class r10k::mcollective::application ( - $agent_name = $r10k::params::mc_agent_name, - $app_name = $r10k::params::mc_app_name, - $agent_ddl = $r10k::params::mc_agent_ddl_name, - $agent_path = $r10k::params::mc_agent_path, - $app_path = $r10k::params::mc_application_path, - $mc_service = $r10k::params::mc_service_name, + Optional[String] $agent_name = $r10k::params::mc_agent_name, + Optional[String] $app_name = $r10k::params::mc_app_name, + Optional[String] $agent_ddl = $r10k::params::mc_agent_ddl_name, + Optional[String] $agent_path = $r10k::params::mc_agent_path, + Optional[String] $app_path = $r10k::params::mc_application_path, + Optional[String] $mc_service = $r10k::params::mc_service_name, ) inherits r10k::params { require r10k diff --git a/manifests/postrun_command.pp b/manifests/postrun_command.pp index 51f80dc4..fba65c19 100644 --- a/manifests/postrun_command.pp +++ b/manifests/postrun_command.pp @@ -4,7 +4,7 @@ # @param ensure # class r10k::postrun_command ( - $command = $r10k::params::pre_postrun_command, + String[1] $command = $r10k::params::pre_postrun_command, Enum['present', 'absent'] $ensure = 'present', ) inherits r10k::params { ini_setting { 'r10k_postrun_command': diff --git a/manifests/prerun_command.pp b/manifests/prerun_command.pp index c7c14ca3..73f84cd3 100644 --- a/manifests/prerun_command.pp +++ b/manifests/prerun_command.pp @@ -4,7 +4,7 @@ # @param ensure # class r10k::prerun_command ( - $command = $r10k::params::pre_postrun_command, + String[1] $command = $r10k::params::pre_postrun_command, Enum['present', 'absent'] $ensure = 'present', ) inherits r10k::params { ini_setting { 'r10k_prerun_command': diff --git a/manifests/webhook.pp b/manifests/webhook.pp index 55330ab2..902e3dcd 100644 --- a/manifests/webhook.pp +++ b/manifests/webhook.pp @@ -1,7 +1,18 @@ -# # @summary install and configure the webhook-go package as local webhook receiver to trigger r10k runs # -# @param install_method how the package should be installed +# @param install_method +# how the package should be installed +# @param ensure +# @param version +# @param service_ensure +# @param service_enabled +# @param config_ensure +# @param config_path +# @param chatops +# @param tls +# @param server +# @param r10k +# @param config # class r10k::webhook ( Enum['package', 'repo', 'none'] $install_method = 'package',