Skip to content

Commit

Permalink
backup foreman
Browse files Browse the repository at this point in the history
  • Loading branch information
evgeni committed Sep 12, 2023
1 parent 6abf11a commit 6f44bc1
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
1 change: 1 addition & 0 deletions puppet/data/common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ profiles::backup::receiver::targets:
- redmine01
- master02
- discourse01
- foreman01

profiles::backup::sender::host: '%{alias("backup_servicename")}'
profiles::backup::sender::ssh_key: 'AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBNfA651gsxAgFzWdBjFbTTXgZ+mIovdHE2TZShmyDJ9h6On+qQ3WOGVXflyrocM93vR4diZT80bnyIpLZtIf5RY='
Expand Down
15 changes: 15 additions & 0 deletions puppet/modules/profiles/manifests/foreman.pp
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,19 @@
puppet::config::main { 'dns_alt_names':
value => $foreman::serveraliases,
}

package {'rubygem-foreman_maintain':
ensure => present,
}

file {'/var/backups':
ensure => directory,
owner => 'restic',
}

restic::repository { 'foreman':
backup_cap_dac_read_search => true,
backup_path => '/var/backups',
backup_pre_cmd => ['foreman-maintain backup online --assumeyes /var/backups/foreman'],
}
}
7 changes: 7 additions & 0 deletions puppet/spec/classes/profiles_foreman_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@
on_supported_os.each do |os, os_facts|
context "on #{os}" do
let(:facts) { os_facts }
let(:pre_condition) do
<<~PUPPET
class { 'restic':
password => 'SuperSecret',
}
PUPPET
end

it { is_expected.to compile.with_all_deps }
end
Expand Down

0 comments on commit 6f44bc1

Please sign in to comment.