Skip to content

Latest commit

 

History

History
890 lines (511 loc) · 23.3 KB

REFERENCE.md

File metadata and controls

890 lines (511 loc) · 23.3 KB

Reference

Table of Contents

Classes

Public Classes

  • restic: Module to manage restic repositories via systemd service/timer.

Private Classes

  • restic::package: Install restic packages
  • restic::reload: Reload systemd via systemctl daemon-reload

Defined types

Public Defined types

Private Defined types

  • restic::service: Configure a restic service

Data types

Classes

restic

Module to manage restic repositories via systemd service/timer.

Parameters

The following parameters are available in the restic class:

package_ensure

Data type: String

Version for Restic to be installed

Default value: 'present'

package_manage

Data type: Boolean

Enable Restic package management

Default value: true

package_name

Data type: String

Name for Restic package

Default value: 'restic'

package_version

Data type: Optional[String[1]]

Restic version when installing with the url method.

Default value: undef

checksum

Data type: Optional[String[1]]

Checksum of the Restic archive. Only applicable when using install_method = 'url'.

Default value: undef

install_method

Data type: Enum['package', 'url']

Install method to use.

Default value: 'package'

repositories

Data type: Restic::Repositories

Hash of repositoriries

Default value: {}

backup_flags

Data type: Variant[Array[String[1]],String[1]]

Default flags for restic backup <flags>. See restic backup --help

Default value: []

backup_path

Data type: Optional[Restic::Path]

Default directory to backed up

Default value: undef

backup_pre_cmd

Data type: Optional[Variant[Array[String[1]],String[1]]]

Default command to run before restic backup

Default value: undef

backup_post_cmd

Data type: Optional[Variant[Array[String[1]],String[1]]]

Default command to run after restic backup

Default value: undef

backup_timer

Data type: Optional[String[1]]

Default systemd timer for backup see: https://wiki.archlinux.de/title/Systemd/Timers

Default value: undef

backup_exit3_success

Data type: Boolean

Consider restic's exit code 3 as success. https://restic.readthedocs.io/en/latest/040_backup.html#exit-status-codes

Default value: false

binary

Data type: Stdlib::Absolutepath

Default path to the Restic binary

Default value: '/usr/bin/restic'

bucket

Data type: Optional[String]

Default name for the Restic repository

Default value: undef

enable_backup

Data type: Boolean

Default enable the backup service

Default value: true

enable_forget

Data type: Boolean

Default enable the forget service

Default value: false

enable_restore

Data type: Boolean

Default enable the restore service

Default value: false

forget

Data type: Restic::Forget

Default hash with keep-* => value to configure forget flags

Default value: {}

forget_flags

Data type: Variant[Array[String[1]],String[1]]

Default flags for restic forget <flags>. See restic forget --help

Default value: []

forget_pre_cmd

Data type: Optional[Variant[Array[String[1]],String[1]]]

Default command to run before restic forget

Default value: undef

forget_post_cmd

Data type: Optional[Variant[Array[String[1]],String[1]]]

Default command to run after restic forget

Default value: undef

forget_timer

Data type: Optional[String[1]]

Default systemd timer for forget see: https://wiki.archlinux.de/title/Systemd/Timers

Default value: undef

global_flags

Data type: Variant[Array[String[1]],String[1]]

Default global flags for restic <flags>. See restic --help

Default value: []

group

Data type: String

Default group for systemd services

Default value: 'root'

host

Data type: Optional[Variant[Sensitive[String],String]]

Default hostname for the Restic repository

Default value: undef

id

Data type: Optional[Variant[Sensitive[String],String]]

Default S3 storage id for an S3 bucket

Default value: undef

init_repo

Data type: Boolean

Default enable the initialization of the repository

Default value: true

key

Data type: Optional[Variant[Sensitive[String],String]]

Default S3 storage key for an S3 bucket

Default value: undef

password

Data type: Optional[Variant[Sensitive[String],String]]

Default encryption password for the Restic repository

Default value: undef

prune

Data type: Boolean

Default enable --prune flag for restic forget

Default value: false

restore_flags

Data type: Variant[Array[String[1]],String[1]]

Default flags for restic restore <flags>. See restic restore --help

Default value: []

restore_path

Data type: Optional[Stdlib::Absolutepath]

Default directory used to restore a backup

Default value: undef

restore_pre_cmd

Data type: Optional[Variant[Array[String[1]],String[1]]]

command to run before execute restore Default command to run before restic restore

Default value: undef

restore_post_cmd

Data type: Optional[Variant[Array[String[1]],String[1]]]

command to run after execute restore Default command to run after restic restore

Default value: undef

restore_snapshot

Data type: String[1]

Default Restic snapshot id used by the restore

Default value: 'latest'

restore_timer

Data type: Optional[String[1]]

Default systemd timer for restore see: https://wiki.archlinux.de/title/Systemd/Timers

Default value: undef

type

Data type: Restic::Repository::Type

Default name for the Restic repository. Only S3 supported

Default value: 's3'

user

Data type: String[1]

Default user for systemd services

Default value: 'root'

Defined types

restic::repository

Configure a Restic service to backup/forget/restore data.

Parameters

The following parameters are available in the restic::repository defined type:

backup_flags

Data type: Optional[Variant[Array[String[1]],String[1]]]

Default flags for restic backup <flags>. See restic backup --help

Default value: undef

backup_path

Data type: Optional[Restic::Path]

Default directory to backed up

Default value: undef

backup_pre_cmd

Data type: Optional[Variant[Array[String[1]],String[1]]]

Default command to run before restic backup

Default value: undef

backup_post_cmd

Data type: Optional[Variant[Array[String[1]],String[1]]]

Default command to run after restic backup

Default value: undef

backup_timer

Data type: Optional[String[1]]

Default systemd timer for backup see: https://wiki.archlinux.de/title/Systemd/Timers

Default value: undef

backup_exit3_success

Data type: Optional[Boolean]

Consider restic's exit code 3 as success. https://restic.readthedocs.io/en/latest/040_backup.html#exit-status-codes

Default value: undef

binary

Data type: Optional[Stdlib::Absolutepath]

Default path to the Restic binary

Default value: undef

bucket

Data type: Optional[String]

Default name for the Restic repository

Default value: undef

enable_backup

Data type: Optional[Boolean]

Default enable the backup service

Default value: undef

enable_forget

Data type: Optional[Boolean]

Default enable the forget service

Default value: undef

enable_restore

Data type: Optional[Boolean]

Default enable the restore service

Default value: undef

forget

Data type: Optional[Restic::Forget]

Default hash with keep-* => value to configure forget flags

Default value: undef

forget_flags

Data type: Optional[Variant[Array[String[1]],String[1]]]

Default flags for restic forget <flags>. See restic forget --help

Default value: undef

forget_pre_cmd

Data type: Optional[Variant[Array[String[1]],String[1]]]

Default command to run before restic forget

Default value: undef

forget_post_cmd

Data type: Optional[Variant[Array[String[1]],String[1]]]

Default command to run after restic forget

Default value: undef

forget_timer

Data type: Optional[String[1]]

Default systemd timer for forget see: https://wiki.archlinux.de/title/Systemd/Timers

Default value: undef

global_flags

Data type: Optional[Variant[Array[String[1]],String[1]]]

Default global flags for restic <flags>. See restic --help

Default value: undef

group

Data type: Optional[String]

Default group for systemd services

Default value: undef

host

Data type: Optional[Variant[Sensitive[String],String]]

Default hostname for the Restic repository

Default value: undef

id

Data type: Optional[Variant[Sensitive[String],String]]

Default S3 storage id for an S3 bucket

Default value: undef

init_repo

Data type: Optional[Boolean]

Default enable the initialization of the repository

Default value: undef

key

Data type: Optional[Variant[Sensitive[String],String]]

Default S3 storage key for an S3 bucket

Default value: undef

password

Data type: Optional[Variant[Sensitive[String],String]]

Default encryption password for the Restic repository

Default value: undef

prune

Data type: Optional[Boolean]

Default enable --prune flag for restic forget

Default value: undef

restore_flags

Data type: Optional[Variant[Array[String[1]],String[1]]]

Default flags for restic restore <flags>. See restic restore --help

Default value: undef

restore_path

Data type: Optional[Stdlib::Absolutepath]

Default directory used to restore a backup

Default value: undef

restore_pre_cmd

Data type: Optional[Variant[Array[String[1]],String[1]]]

command to run before execute restore Default command to run before restic restore

Default value: undef

restore_post_cmd

Data type: Optional[Variant[Array[String[1]],String[1]]]

command to run after execute restore Default command to run after restic restore

Default value: undef

restore_snapshot

Data type: Optional[String[1]]

Default Restic snapshot id used by the restore

Default value: undef

restore_timer

Data type: Optional[String[1]]

Default systemd timer for restore see: https://wiki.archlinux.de/title/Systemd/Timers

Default value: undef

type

Data type: Optional[Restic::Repository::Type]

Default name for the Restic repository. Only S3 supported

Default value: undef

user

Data type: Optional[String[1]]

Default user for systemd services

Default value: undef

restic::repository::post_command

Define command(s) to be run after a restic command

Examples

Define a command to be run after the backup
restic::repository::pre_command { 'mysql':
  command => 'rm -rf /opt/xtrabackup',
}

Parameters

The following parameters are available in the restic::repository::post_command defined type:

command

Data type: Variant[Array[String[1]],String[1]]

Command to run.

repository_title

Data type: String[1]

restic::repository title where this command should be add to.

Default value: $title

restic_command

Data type: Enum['backup', 'forget', 'restore']

After which restic command this command should be run.

Default value: 'backup'

allow_fail

Data type: Boolean

If an error of this commands should be allowed.

Default value: false

order

Data type: Integer[26]

Order of Commands. Helpful if you have multiple.

Default value: 26

restic::repository::pre_command

Define command(s) to be run before a restic command

Examples

Define a command to be run before the backup
restic::repository::pre_command { 'mysql':
  command => 'xtrabackup --backup --target-dir=/opt/xtrabackup',
}

Parameters

The following parameters are available in the restic::repository::pre_command defined type:

command

Data type: Variant[Array[String[1]],String[1]]

Command to run.

repository_title

Data type: String[1]

restic::repository title where this command should be add to.

Default value: $title

restic_command

Data type: Enum['backup', 'forget', 'restore']

Before which restic command this command should be run.

Default value: 'backup'

allow_fail

Data type: Boolean

If an error of this commands should be allowed.

Default value: false

order

Data type: Integer[11,24]

Order of Commands. Helpful if you have multiple.

Default value: 11

Data types

Restic::Forget

All valid forget parameter

Alias of Hash[Enum['keep-last','keep-hourly','keep-daily','keep-weekly','keep-monthly','keep-yearly','keep-within','keep-within-hourly','keep-within-daily','keep-within-weekly','keep-within-monthly','keep-within-yearly','keep-tag'], Variant[Integer[1],String[1]]]

Restic::Path

Valid path parameter

Alias of Variant[Stdlib::Absolutepath, Array[Stdlib::Absolutepath]]

Restic::Repositories

A data hash with restic backup configuration

Alias of

Hash[String[1], Struct[
    {
      backup_exit3_success => Optional[Boolean],
      backup_flags         => Optional[Variant[Array[String[1]],String[1]]],
      backup_path          => Optional[Restic::Path],
      backup_post_cmd      => Optional[Variant[Array[String[1]],String[1]]],
      backup_pre_cmd       => Optional[Variant[Array[String[1]],String[1]]],
      backup_timer         => Optional[String[1]],
      binary               => Optional[Stdlib::Absolutepath],
      bucket               => Optional[String],
      enable_backup        => Optional[Boolean],
      enable_forget        => Optional[Boolean],
      enable_restore       => Optional[Boolean],
      forget               => Optional[Restic::Forget],
      forget_flags         => Optional[Variant[Array[String[1]],String[1]]],
      forget_post_cmd      => Optional[Variant[Array[String[1]],String[1]]],
      forget_pre_cmd       => Optional[Variant[Array[String[1]],String[1]]],
      forget_timer         => Optional[String[1]],
      global_flags         => Optional[Variant[Array[String[1]],String[1]]],
      group                => Optional[String],
      host                 => Optional[Variant[Sensitive[String],String]],
      id                   => Optional[Variant[Sensitive[String],String]],
      init_repo            => Optional[Boolean],
      key                  => Optional[Variant[Sensitive[String],String]],
      password             => Optional[Variant[Sensitive[String],String]],
      prune                => Optional[Boolean],
      restore_flags        => Optional[Variant[Array[String[1]],String[1]]],
      restore_path         => Optional[Stdlib::Absolutepath],
      restore_post_cmd     => Optional[Variant[Array[String[1]],String[1]]],
      restore_pre_cmd      => Optional[Variant[Array[String[1]],String[1]]],
      restore_snapshot     => Optional[String[1]],
      restore_timer        => Optional[String[1]],
      type                 => Optional[Restic::Repository::Type],
      user                 => Optional[String[1]],
    }
  ]]

Restic::Repository::Type

All valid repository types

Alias of Enum['rest', 's3']