From b219b79eab6b70c8d3837eeb28ab9f58f367bab8 Mon Sep 17 00:00:00 2001 From: Stephen Benjamin Date: Wed, 11 Jan 2017 09:24:30 -0500 Subject: [PATCH] Change existing Kafo type definitions to Puppet 4 types (#114) --- Gemfile | 1 + Rakefile | 5 ++++ manifests/foreman_proxy_content.pp | 9 ++++--- manifests/init.pp | 38 ++++++++++++++++++++---------- 4 files changed, 37 insertions(+), 16 deletions(-) diff --git a/Gemfile b/Gemfile index 64e64fff..4eec1a31 100644 --- a/Gemfile +++ b/Gemfile @@ -26,5 +26,6 @@ gem 'puppet-blacksmith', '>= 3.1.0', {"groups"=>["development"]} gem 'json', '~> 1.0', {"platforms"=>["ruby_19"], "groups"=>["test"]} gem 'json_pure', '~> 1.0', {"platforms"=>["ruby_19"], "groups"=>["test"]} gem 'metadata-json-lint' +gem 'kafo_module_lint' # vim:ft=ruby diff --git a/Rakefile b/Rakefile index 54cc9904..454a5685 100644 --- a/Rakefile +++ b/Rakefile @@ -27,4 +27,9 @@ PuppetLintParamDocs.define_selective do |config| config.pattern = ["manifests/foreman_proxy_content.pp", "manifests/init.pp"] end +require 'kafo_module_lint/tasks' +KafoModuleLint::RakeTask.new do |config| + config.pattern = ["manifests/foreman_proxy_content.pp", "manifests/init.pp"] +end + task :default => [:validate, :lint, :spec] diff --git a/manifests/foreman_proxy_content.pp b/manifests/foreman_proxy_content.pp index 3b8564ff..c244ec68 100644 --- a/manifests/foreman_proxy_content.pp +++ b/manifests/foreman_proxy_content.pp @@ -2,12 +2,15 @@ # # === Parameters: # -# $parent_fqdn:: fqdn of the parent node. Does not usually +# $parent_fqdn:: FQDN of the parent node. Does not usually # need to be set. +# type:Optional[String] # -# $foreman_proxy_fqdn:: fqdn of the foreman proxy. REQUIRED +# $foreman_proxy_fqdn:: FQDN of the foreman proxy +# type:String # -# $certs_tar:: path to tar file with certs to generate. REQUIRED +# $certs_tar:: Path to tar file with certs to generate +# type:Optional[Stdlib::Absolutepath] # class certs::foreman_proxy_content ( $parent_fqdn = $fqdn, diff --git a/manifests/init.pp b/manifests/init.pp index a8b19812..15cf67a4 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -8,73 +8,85 @@ # # $node_fqdn:: The fqdn of the host the generated certificates # should be for +# type:String # # $server_ca_cert:: Path to the CA that issued the ssl certificates for https # if not specified, the default CA will be used +# type:Optional[Stdlib::Absolutepath] # # $server_cert:: Path to the ssl certificate for https # if not specified, the default CA will generate one +# type:Optional[Stdlib::Absolutepath] # # $server_key:: Path to the ssl key for https # if not specified, the default CA will generate one +# type:Optional[Stdlib::Absolutepath] # # $server_cert_req:: Path to the ssl certificate request for https # if not specified, the default CA will generate one +# type:Optional[Stdlib::Absolutepath] # # === Advanced parameters: # # $log_dir:: Where the log files should go +# type:Stdlib::Absolutepath # # $generate:: Should the generation of the certs be part of the # configuration -# type: boolean +# type:Boolean # # $regenerate:: Force regeneration of the certificates (excluding # ca certificates) -# type: boolean +# type:Boolean # # $regenerate_ca:: Force regeneration of the ca certificate -# type: boolean +# type:Boolean # # $deploy:: Deploy the certs on the configured system. False means # we want apply it on a different system -# type: boolean +# type:Boolean # # $ca_common_name:: Common name for the generated CA certificate -# type: string +# type:String # # $country:: Country attribute for managed certificates -# type: string +# type:String[2] # # $state:: State attribute for managed certificates -# type: string +# type:String # # $city:: City attribute for managed certificates -# type: string +# type:String # # $org:: Org attribute for managed certificates -# type: string +# type:String # # $org_unit:: Org unit attribute for managed certificates -# type: string +# type:String # # $expiration:: Expiration attribute for managed certificates -# type: string +# type:String # -# $ca_expiration:: Ca expiration attribute for managed certificates -# type: string +# $ca_expiration:: CA expiration attribute for managed certificates +# type:String # # $pki_dir:: The PKI directory under which to place certs +# type:Stdlib::Absolutepath # # $ssl_build_dir:: The directory where SSL keys, certs and RPMs will be generated +# type:Stdlib::Absolutepath # # $user:: The system user name who should own the certs +# type:String # # $group:: The group who should own the certs +# type:String # # $default_ca_name:: The name of the default CA +# type:String # # $server_ca_name:: The name of the server CA (used for https) +# type:String # class certs (