diff --git a/manifests/init.pp b/manifests/init.pp index b1f59d1..54d5bcb 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -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 @@ -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 @@ -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. @@ -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", diff --git a/manifests/server.pp b/manifests/server.pp index 0faa329..46796f2 100644 --- a/manifests/server.pp +++ b/manifests/server.pp @@ -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. @@ -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) @@ -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, @@ -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, diff --git a/templates/barman.conf.erb b/templates/barman.conf.erb index 975e702..7bc92a0 100644 --- a/templates/barman.conf.erb +++ b/templates/barman.conf.erb @@ -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 -%> diff --git a/templates/server.conf.erb b/templates/server.conf.erb index 75ae139..e9db14e 100644 --- a/templates/server.conf.erb +++ b/templates/server.conf.erb @@ -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 -%> @@ -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 -%> diff --git a/types/createslot.pp b/types/createslot.pp new file mode 100644 index 0000000..1e58688 --- /dev/null +++ b/types/createslot.pp @@ -0,0 +1,2 @@ +# create_slow parrams +type Barman::CreateSlot = Optional[Enum['manual', 'auto']]