Skip to content

Commit

Permalink
Random fixes and security improvement (#83)
Browse files Browse the repository at this point in the history
* Fix .fixtures.yml for Puppet 6
* Convert the dell_api_key to a Sensitive type in `warranty.pp` so it will not show up in logs
  • Loading branch information
coreone authored and raphink committed Aug 5, 2019
1 parent f258cd7 commit 71e7ee2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .fixtures.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@ fixtures:
stdlib: 'puppetlabs-stdlib'
vcsrepo: 'puppetlabs-vcsrepo'
inifile: 'puppetlabs-inifile'
augeas_core: 'puppetlabs-augeas_core'
yumrepo_core: 'puppetlabs-yumrepo_core'
symlinks:
dell: "#{source_dir}"
17 changes: 11 additions & 6 deletions manifests/warranty.pp
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,17 @@
# Used by the fact in this module
#
class dell::warranty (
$api_key,
Optional[String] $api_key = undef,
String $file_mode = '0644',
) {
file { '/etc/dell_api_key':
content => $api_key,
owner => 'root',
group => 'root',
mode => '0644',
if $api_key {
$sec_api_key = Sensitive($api_key)

file { '/etc/dell_api_key':
content => $sec_api_key,
owner => 'root',
group => 'root',
mode => $file_mode,
}
}
}

0 comments on commit 71e7ee2

Please sign in to comment.