Skip to content

Commit

Permalink
Support sensitive type
Browse files Browse the repository at this point in the history
  • Loading branch information
deric committed Aug 9, 2023
1 parent eb55613 commit c3b957a
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 6 deletions.
2 changes: 2 additions & 0 deletions manifests/archive_command.pp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
# should be fine, so you don't need to change this.
# @param barman_user
# The default value is the one contained in the 'settings' class.
# @param barman_home
# Home directory
# @param barman_server
# The value is set when the resource is created
# (in the 'autoconfigure' class).
Expand Down
6 changes: 3 additions & 3 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@
owner => $user,
group => $group,
mode => $home_mode,
require => Package['barman']
require => Package['barman'],
}

if $manage_ssh_host_keys {
Expand All @@ -380,7 +380,7 @@
exec { 'barman-check-all':
command => '/usr/bin/barman check all',
subscribe => File[$home],
refreshonly => true
refreshonly => true,
}

file { '/etc/logrotate.d/barman':
Expand All @@ -389,7 +389,7 @@
group => $group,
mode => '0644',
content => template($logrotate_template),
require => Package['barman']
require => Package['barman'],
}

# Set the autoconfiguration
Expand Down
6 changes: 3 additions & 3 deletions manifests/postgres.pp
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@
Optional[Integer] $backup_wday = undef,
Integer $backup_hour = 4,
Integer $backup_minute = 0,
Optional[String] $password = '',
Barman::Password $password = undef,
String $server_address = $facts['networking']['fqdn'],
Integer $server_port = 5432,
String $postgres_server_id = $facts['networking']['hostname'],
Expand Down Expand Up @@ -300,12 +300,12 @@

# Generate a new password if not defined
$real_password = $password ? {
'' => fqdn_rand_string(30,'','fwsfbsfw'),
undef => fqdn_rand_string(30,'','fwsfbsfw'),
default => $password,
}

$archive_mode = $archiver ? {
true => 'on',
true => 'on',
default => 'off',
}

Expand Down
7 changes: 7 additions & 0 deletions types/password.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
type Barman::Password = Optional[
Variant[
String,
Sensitive[String],
Integer
]
]

0 comments on commit c3b957a

Please sign in to comment.