Skip to content

Commit

Permalink
Merge pull request #6 from tallenaz/master
Browse files Browse the repository at this point in the history
Add barman_lock_directory
  • Loading branch information
deric committed Aug 18, 2023
2 parents 51b3b77 + bae6b38 commit 4d3abd8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions manifests/init.pp
Expand Up @@ -38,6 +38,7 @@
# [*bandwidth_limit*] - This option allows you to specify a maximum transfer rate
# in kilobytes per second. A value of zero specifies no
# limit (default).
# [*barman_lock_directory*] - Global option for a directory for lock files.
# [*check_timeout*] - Maximum execution time, in seconds per server, for a barman
# check command. Set to 0 to disable the timeout. Positive
# integer, default 30.
Expand Down Expand Up @@ -239,6 +240,7 @@
Barman::BackupMethod $backup_method = undef,
Barman::BackupOptions $backup_options = undef,
Optional[Integer] $bandwidth_limit = undef,
Optional[String] $barman_lock_directory = undef,
Optional[Integer] $basebackup_retry_sleep = undef,
Optional[Integer] $basebackup_retry_times = undef,
Optional[Integer] $check_timeout = undef,
Expand Down
2 changes: 2 additions & 0 deletions spec/classes/barman_spec.rb
Expand Up @@ -135,13 +135,15 @@
context 'with different parameters' do
let(:params) do
{
barman_lock_directory: '/var/run/barman',
compression: false,
pre_backup_script: '/bin/false',
post_backup_script: '/bin/false',
custom_lines: 'thisisastring',
}
end

it { is_expected.to contain_file('/etc/barman/barman.conf').with_content(%r{barman_lock_directory = /var/run/barman}) }
it { is_expected.not_to contain_file('/etc/barman/barman.conf').with_content(%r{compression}) }
it { is_expected.to contain_file('/etc/barman/barman.conf').with_content(%r{pre_backup_script = /bin/false}) }
it { is_expected.to contain_file('/etc/barman/barman.conf').with_content(%r{post_backup_script = /bin/false}) }
Expand Down
3 changes: 3 additions & 0 deletions templates/barman.conf.erb
Expand Up @@ -21,6 +21,9 @@ recovery_options = <%= @recovery_options %>
<%- if @bandwidth_limit -%>
bandwidth_limit = <%= @bandwidth_limit %>
<%- end -%>
<%- if @barman_lock_directory -%>
barman_lock_directory = <%= @barman_lock_directory %>
<%- end -%>
<%- if @check_timeout -%>
check_timeout = <%= @check_timeout %>
<%- end -%>
Expand Down

0 comments on commit 4d3abd8

Please sign in to comment.