Skip to content

Commit

Permalink
More param documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
bzed committed Jan 27, 2025
1 parent 1b6ef48 commit e7d0a85
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/puppet/functions/dehydrated/file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
require 'base64'

Puppet::Functions.create_function(:'dehydrated::file') do
# @param files File to check
# @param more_files optional other files to check
dispatch :getfile do
required_param 'String', :files
optional_repeated_param 'String', :more_files
Expand Down
2 changes: 2 additions & 0 deletions lib/puppet/type/dehydrated_csr.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
desc 'CSRs for dehydrated'

newparam(:path, namevar: true) do
desc 'Absolute path of the CSR location'
validate do |value|
path = Pathname.new(value)
raise ArgumentError, "Path must be absolute: #{path}" unless path.absolute?
Expand All @@ -26,6 +27,7 @@
end

newparam(:private_key) do
desc 'Absolute path of the key we want to use'
defaultto do
path = Pathname.new(@resource[:path])
"#{path.dirname}/#{path.basename(path.extname)}.key"
Expand Down
1 change: 1 addition & 0 deletions lib/puppet/type/dehydrated_dhparam.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
desc 'DH params for dehydrated'

newparam(:path, namevar: true) do
desc 'Absolute pathname of the DH file'
validate do |value|
path = Pathname.new(value)
raise ArgumentError, "Path must be absolute: #{path}" unless path.absolute?
Expand Down
2 changes: 2 additions & 0 deletions lib/puppet/type/dehydrated_pfx.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
desc 'pkcs12 / pfx files for dehydrated'

newparam(:path, namevar: true) do
desc 'Absolute path of the pfx file'
validate do |value|
path = Pathname.new(value)
raise ArgumentError, "Path must be absolute: #{path}" unless path.absolute?
Expand Down Expand Up @@ -48,6 +49,7 @@
end

newparam(:private_key) do
desc 'absolute path of the private keyfile'
defaultto do
path = Pathname.new(@resource[:path])
"#{path.dirname}/#{path.basename(path.extname)}.key"
Expand Down

0 comments on commit e7d0a85

Please sign in to comment.