File tree Expand file tree Collapse file tree 2 files changed +50
-11
lines changed Expand file tree Collapse file tree 2 files changed +50
-11
lines changed Original file line number Diff line number Diff line change 21
21
$reports_tables = ' -t reports"'
22
22
$logging = " > ${logging_directory} /output.log 2>&1"
23
23
24
- cron { ' pg_repack facts tables ' :
24
+ Cron {
25
25
ensure => $ensure_cron ,
26
26
user => ' root' ,
27
+ require => File [$logging_directory ],
28
+ }
29
+
30
+ cron { ' pg_repack facts tables' :
27
31
weekday => [2,6],
28
32
hour => 4,
29
33
minute => 30,
30
34
command => " ${repack} ${facts_tables} ${logging} " ,
31
- require => File [$logging_directory ],
32
35
}
33
36
34
37
cron { ' pg_repack catalogs tables' :
35
- ensure => $ensure_cron ,
36
- user => ' root' ,
37
38
weekday => [0,4],
38
39
hour => 4,
39
40
minute => 30,
40
41
command => " ${repack} ${catalogs_tables} ${logging} " ,
41
- require => File [$logging_directory ],
42
42
}
43
43
44
44
cron { ' pg_repack other tables' :
45
- ensure => $ensure_cron ,
46
- user => ' root' ,
47
45
monthday => 20,
48
46
hour => 5,
49
47
minute => 30,
50
48
command => " ${repack} ${other_tables} ${logging} " ,
51
- require => File [$logging_directory ],
52
49
}
53
50
54
51
cron { ' pg_repack reports tables' :
55
- ensure => $ensure_cron ,
56
- user => ' root' ,
57
52
weekday => [3],
58
53
hour => 4,
59
54
minute => 30,
60
55
command => " ${repack} ${reports_tables} ${logging} " ,
61
- require => File [$logging_directory ],
62
56
}
63
57
}
Original file line number Diff line number Diff line change
1
+ require 'spec_helper'
2
+
3
+ describe 'pe_databases::maintenance' do
4
+ on_supported_os . each do |os , os_facts |
5
+ context "on #{ os } " do
6
+ let ( :pre_condition ) { "class { 'pe_databases': }" }
7
+ let ( :facts ) { os_facts }
8
+
9
+ it { is_expected . to compile }
10
+
11
+ context 'on PE 2019.0.0' do
12
+ before ( :each ) do
13
+ facts [ 'pe_server_version' ] = '2019.0.0'
14
+ end
15
+
16
+ it { is_expected . to contain_class ( 'pe_databases::maintenance::vacuum_full' ) }
17
+ it { is_expected . not_to contain_class ( 'pe_databases::maintenance::pg_repack' ) }
18
+ end
19
+ context 'on PE 2018.1.4' do
20
+ before ( :each ) do
21
+ facts [ 'pe_server_version' ] = '2018.1.4'
22
+ end
23
+
24
+ it { is_expected . to contain_class ( 'pe_databases::maintenance::vacuum_full' ) }
25
+ it { is_expected . not_to contain_class ( 'pe_databases::maintenance::pg_repack' ) }
26
+ end
27
+ context 'on PE 2018.1.8' do
28
+ before ( :each ) do
29
+ facts [ 'pe_server_version' ] = '2018.1.9'
30
+ end
31
+
32
+ it { is_expected . to contain_class ( 'pe_databases::maintenance::vacuum_full' ) . with ( 'disable_maintenance' => true ) }
33
+ it { is_expected . to contain_class ( 'pe_databases::maintenance::pg_repack' ) }
34
+ end
35
+ context 'on PE 2019.0.3' do
36
+ before ( :each ) do
37
+ facts [ 'pe_server_version' ] = '2019.0.3'
38
+ end
39
+
40
+ it { is_expected . to contain_class ( 'pe_databases::maintenance::vacuum_full' ) . with ( 'disable_maintenance' => true ) }
41
+ it { is_expected . to contain_class ( 'pe_databases::maintenance::pg_repack' ) }
42
+ end
43
+ end
44
+ end
45
+ end
You can’t perform that action at this time.
0 commit comments