File tree Expand file tree Collapse file tree 5 files changed +100
-0
lines changed
site/profile/manifests/core Expand file tree Collapse file tree 5 files changed +100
-0
lines changed Original file line number Diff line number Diff line change 22network::interfaces_hash :
33 eth0 : # fqdn
44 ipaddress : " 139.229.160.6"
5+ profile::core::restic::enable : true # only backup primary ipa node
Original file line number Diff line number Diff line change 33 - " clustershell"
44 - " ipa"
55 - " profile::core::common"
6+ - " profile::core::restic"
67 - " tailscale"
78
89profile::core::common::disable_ipv6 : true
@@ -60,3 +61,14 @@ hosts::entries:
6061 ip : " 100.91.143.57"
6162 ipa3.cp.lsst.org :
6263 ip : " 100.94.76.56"
64+
65+ restic::repositories :
66+ ipa :
67+ backup_path :
68+ - " /var/lib/ipa/backup"
69+ backup_pre_cmd : " mkdir /var/lib/ipa/backup;/sbin/ipa-backup"
70+ backup_post_cmd : " rm -rf /var/lib/ipa/backup"
71+ backup_timer : " *-*-* 9:23:00"
72+ enable_forget : true
73+ forget_timer : " *-*-* 10:23:00"
74+ forget_flags : " --keep-last 90"
Original file line number Diff line number Diff line change 1+ # @summary
2+ # Provides an easy way to turn restic backups on or off for a host.
3+ #
4+ # @param enable
5+ # Whether to enable restic backups on this host.
6+ #
7+ class profile::core::restic (
8+ Boolean $enable = false ,
9+ ) {
10+ if $enable {
11+ include restic
12+ }
13+ }
Original file line number Diff line number Diff line change 1+ # frozen_string_literal: true
2+
3+ require 'spec_helper'
4+
5+ describe 'profile::core::restic' do
6+ on_supported_os . each do |os , os_facts |
7+ context "on #{ os } " do
8+ let ( :facts ) { os_facts }
9+
10+ context 'with no params' do
11+ it { is_expected . to compile . with_all_deps }
12+ it { is_expected . not_to contain_class ( 'restic' ) }
13+ end
14+
15+ context 'with enable param' do
16+ let ( :params ) do
17+ {
18+ enable : true
19+ }
20+ end
21+
22+ it { is_expected . to compile . with_all_deps }
23+ it { is_expected . to contain_class ( 'restic' ) }
24+ end
25+ end
26+ end
27+ end
Original file line number Diff line number Diff line change 1+ # frozen_string_literal: true
2+
3+ require 'spec_helper'
4+
5+ describe 'ipa1.cp.lsst.org' , :sitepp do
6+ on_supported_os . each do |os , os_facts |
7+ next unless os =~ %r{almalinux-9-x86_64}
8+
9+ context "on #{ os } " do
10+ let ( :facts ) do
11+ lsst_override_facts ( os_facts ,
12+ is_virtual : true ,
13+ virtual : 'kvm' ,
14+ dmi : {
15+ 'product' => {
16+ 'name' => 'KVM' ,
17+ } ,
18+ } )
19+ end
20+ let ( :node_params ) do
21+ {
22+ role : 'ipareplica' ,
23+ site : 'cp' ,
24+ }
25+ end
26+
27+ it { is_expected . to compile . with_all_deps }
28+
29+ include_examples 'vm'
30+ include_examples 'restic common'
31+
32+ it do
33+ is_expected . to contain_restic__repository ( 'ipa' ) . with (
34+ backup_path : %w[
35+ /var/lib/ipa/backup
36+ ] ,
37+ backup_pre_cmd : 'mkdir /var/lib/ipa/backup;/sbin/ipa-backup' ,
38+ backup_post_cmd : 'rm -rf /var/lib/ipa/backup' ,
39+ backup_timer : '*-*-* 9:23:00' ,
40+ enable_forget : true ,
41+ forget_timer : '*-*-* 10:23:00' ,
42+ forget_flags : '--keep-last 90'
43+ )
44+ end
45+ end # on os
46+ end # on_supported_os
47+ end
You can’t perform that action at this time.
0 commit comments