Skip to content

Commit

Permalink
Merge pull request #320 from gfa/gfa_mark_passwords_as_sensitive
Browse files Browse the repository at this point in the history
Hide passwords from output
  • Loading branch information
bastelfreak authored May 7, 2024
2 parents 8505a7c + 9592788 commit f9b7f7f
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 14 deletions.
5 changes: 3 additions & 2 deletions manifests/server/database.pp
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,9 @@

if $database_password != undef and $manage_db_password {
ini_setting { 'puppetdb_psdatabase_password':
setting => 'password',
value => $database_password,
setting => 'password',
value => $database_password,
show_diff => false,
}
}

Expand Down
5 changes: 3 additions & 2 deletions manifests/server/read_database.pp
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,9 @@

if $read_database_password != undef and $manage_db_password {
ini_setting { 'puppetdb_read_database_password':
setting => 'password',
value => $read_database_password,
setting => 'password',
value => $read_database_password,
show_diff => false,
}
}

Expand Down
11 changes: 6 additions & 5 deletions spec/unit/classes/server/database_ini_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,12 @@
it {
is_expected.to contain_ini_setting('puppetdb_psdatabase_password')
.with(
'ensure' => 'present',
'path' => "#{pdbconfdir}/database.ini",
'section' => 'database',
'setting' => 'password',
'value' => 'puppetdb',
'ensure' => 'present',
'path' => "#{pdbconfdir}/database.ini",
'section' => 'database',
'setting' => 'password',
'value' => 'puppetdb',
'show_diff' => false,
)
}
it {
Expand Down
11 changes: 6 additions & 5 deletions spec/unit/classes/server/read_database_ini_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,12 @@
it {
is_expected.to contain_ini_setting('puppetdb_read_database_password')
.with(
'ensure' => 'present',
'path' => '/etc/puppetlabs/puppetdb/conf.d/read_database.ini',
'section' => 'read-database',
'setting' => 'password',
'value' => 'puppetdb-read',
'ensure' => 'present',
'path' => '/etc/puppetlabs/puppetdb/conf.d/read_database.ini',
'section' => 'read-database',
'setting' => 'password',
'value' => 'puppetdb-read',
'show_diff' => false,
)
}
it {
Expand Down

0 comments on commit f9b7f7f

Please sign in to comment.