Skip to content

Commit

Permalink
Support create_slot and primary_conninfo parameters (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
shamil authored Nov 22, 2024
1 parent a38915a commit 703eef5
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 6 deletions.
10 changes: 4 additions & 6 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,6 @@
# @param archiver_batch_size
# Setting this option enables batch processing of WAL files.
# The default processes all currently available files.
# @param backup_directory
# Directory where backup data for a server will be placed.
# @param backup_method
# Configure the method barman used for backup execution. If set to rsync (default),
# barman will execute backup using the rsync command. If set to postgres barman will use the
Expand All @@ -87,6 +85,9 @@
# @param compression
# Compression algorithm. Currently supports 'gzip' (default),
# 'bzip2', and 'custom'. Disabled if false.
# @param create_slot
# Determines whether Barman should automatically create a replication slot if it’s
# not already present for streaming WAL files. One of 'auto' or 'manual' (default).
# @param custom_compression_filter
# Customised compression algorithm applied to WAL files.
# @param custom_decompression_filter
Expand Down Expand Up @@ -207,10 +208,6 @@
# pg_basebackup command. Only available with
# pg_basebackup >= 9.3. By default it is set to
# barman_streaming_backup.
# @param streaming_conninfo
# Connection string used by Barman to connect to the
# Postgres server via streaming replication protocol. By
# default it is set to the same value as *conninfo*.
# @param streaming_wals_directory
# Directory where WAL files are streamed from the
# PostgreSQL server to Barman.
Expand Down Expand Up @@ -291,6 +288,7 @@
Optional[Integer] $basebackup_retry_sleep = undef,
Optional[Integer] $basebackup_retry_times = undef,
Optional[Integer] $check_timeout = undef,
Barman::CreateSlot $create_slot = undef,
Optional[String] $custom_compression_filter = undef,
Optional[String] $custom_decompression_filter = undef,
Stdlib::IP::Address $exported_ipaddress = "${facts['networking']['ip']}/32",
Expand Down
9 changes: 9 additions & 0 deletions manifests/server.pp
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@
# @param compression
# Compression algorithm. Currently supports 'gzip' (default),
# 'bzip2', and 'custom'. Disabled if false.
# @param create_slot
# Determines whether Barman should automatically create a replication slot if it’s
# not already present for streaming WAL files.
# One of 'auto' or 'manual' (default).
# @param custom_compression_filter
# Customised compression algorithm applied to WAL
# files.
Expand Down Expand Up @@ -178,6 +182,9 @@
# Value must be greater than or equal to the server
# minimum redundancy level (if not is is assigned to
# that value and a warning is generated).
# @param primary_conninfo
# Connection string for Barman to connect to the primary Postgres server during
# a standby backup. Default: undef (disabled).
# @param retention_policy_mode
# Can only be set to auto (retention policies are
# automatically enforced by the barman cron command)
Expand Down Expand Up @@ -259,6 +266,7 @@
Optional[Integer] $basebackup_retry_times = $barman::basebackup_retry_times,
Optional[Integer] $check_timeout = $barman::check_timeout,
Variant[String,Boolean] $compression = $barman::compression,
Barman::CreateSlot $create_slot = $barman::create_slot,
Optional[String] $custom_compression_filter = $barman::custom_compression_filter,
Optional[String] $custom_decompression_filter = $barman::custom_decompression_filter,
Optional[Stdlib::Absolutepath] $errors_directory = undef,
Expand All @@ -277,6 +285,7 @@
Optional[String] $pre_archive_script = $barman::pre_archive_script,
Optional[String] $pre_backup_retry_script = $barman::pre_backup_retry_script,
Optional[String] $pre_backup_script = $barman::pre_backup_script,
Optional[String] $primary_conninfo = undef,
Barman::RecoveryOptions $recovery_options = $barman::recovery_options,
Barman::RetentionPolicy $retention_policy = $barman::retention_policy,
Barman::RetentionPolicyMode $retention_policy_mode = $barman::retention_policy_mode,
Expand Down
3 changes: 3 additions & 0 deletions templates/barman.conf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ check_timeout = <%= @check_timeout %>
<%- if @compression -%>
compression = <%= @compression %>
<%- end -%>
<%- if @create_slot -%>
create_slot = <%= @create_slot %>
<%- end -%>
<%- if @custom_compression_filter -%>
custom_compression_filter = <%= @custom_compression_filter %>
<%- end -%>
Expand Down
6 changes: 6 additions & 0 deletions templates/server.conf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ check_timeout = <%= @check_timeout %>
<%- if @compression -%>
compression = <%= @compression %>
<%- end -%>
<%- if @create_slot -%>
create_slot = <%= @create_slot %>
<%- end -%>
<%- if @custom_compression_filter -%>
custom_compression_filter = <%= @custom_compression_filter %>
<%- end -%>
Expand Down Expand Up @@ -91,6 +94,9 @@ pre_backup_retry_script = <%= @pre_backup_retry_script %>
<%- if @pre_backup_script -%>
pre_backup_script = <%= @pre_backup_script %>
<%- end -%>
<%- if @primary_conninfo -%>
primary_conninfo = <%= @primary_conninfo %>
<%- end -%>
<%- if @recovery_options -%>
recovery_options = <%= @recovery_options %>
<%- end -%>
Expand Down
2 changes: 2 additions & 0 deletions types/createslot.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# create_slow parrams
type Barman::CreateSlot = Optional[Enum['manual', 'auto']]

0 comments on commit 703eef5

Please sign in to comment.