|
17 | 17 | 'major_version' => 5, |
18 | 18 | 'version' => nil, |
19 | 19 | 'lvm' => false, |
| 20 | + 'volume_group' => nil, |
| 21 | + 'volume_size' => nil, |
| 22 | + 'log_volume_size' => nil, |
20 | 23 | 'initial_heap_size' => '512m', |
21 | 24 | 'maximum_heap_size' => '512m', |
22 | 25 | 'backup' => true, |
|
57 | 60 | 'restart_on_change' => true, |
58 | 61 | 'datadir' => '/var/lib/elasticsearch', |
59 | 62 | 'manage_datadir' => false, |
| 63 | + 'manage_logdir' => true, |
60 | 64 | 'init_defaults' => { 'ES_JAVA_OPTS' => '"-Xms512m -Xmx512m"' } |
61 | 65 | ) } |
62 | 66 |
|
|
86 | 90 | it { is_expected.not_to contain_class('profiles::elasticsearch::backup') } |
87 | 91 | end |
88 | 92 |
|
89 | | - context "with version => 8.2.1, lvm => true, volume_group => myvg, volume_size => 20G, initial_heap_size => 768m, maximum_heap_size => 1024m, backup_lvm => true, backup_volume_group => mybackupvg, backup_volume_size => 10G, backup_hour => 10 and backup_retention_days =>5" do |
| 93 | + context "with version => 8.2.1, lvm => true, volume_group => myvg, volume_size => 20G, log_volume_size => 5G, initial_heap_size => 768m, maximum_heap_size => 1024m, backup_lvm => true, backup_volume_group => mybackupvg, backup_volume_size => 10G, backup_hour => 10 and backup_retention_days =>5" do |
90 | 94 | let(:params) { { |
91 | 95 | 'version' => '8.2.1', |
92 | 96 | 'lvm' => true, |
93 | 97 | 'volume_group' => 'myvg', |
94 | 98 | 'volume_size' => '20G', |
| 99 | + 'log_volume_size' => '5G', |
95 | 100 | 'initial_heap_size' => '768m', |
96 | 101 | 'maximum_heap_size' => '1024m', |
97 | 102 | 'backup_lvm' => true, |
|
128 | 133 | 'group' => 'elasticsearch' |
129 | 134 | ) } |
130 | 135 |
|
| 136 | + it { is_expected.to contain_profiles__lvm__mount('elasticsearchlogs').with( |
| 137 | + 'volume_group' => 'myvg', |
| 138 | + 'size' => '5G', |
| 139 | + 'mountpoint' => '/data/elasticsearchlogs', |
| 140 | + 'fs_type' => 'ext4', |
| 141 | + 'owner' => 'elasticsearch', |
| 142 | + 'group' => 'elasticsearch' |
| 143 | + ) } |
| 144 | + |
| 145 | + it { is_expected.to contain_mount('/var/log/elasticsearch').with( |
| 146 | + 'ensure' => 'mounted', |
| 147 | + 'device' => '/data/elasticsearchlogs', |
| 148 | + 'fstype' => 'none', |
| 149 | + 'options' => 'rw,bind' |
| 150 | + ) } |
| 151 | + |
| 152 | + it { is_expected.to contain_file('/var/log/elasticsearch').with( |
| 153 | + 'ensure' => 'directory', |
| 154 | + 'owner' => 'elasticsearch', |
| 155 | + 'group' => 'elasticsearch' |
| 156 | + ) } |
| 157 | + |
131 | 158 | it { is_expected.to contain_class('elasticsearch').with( |
132 | 159 | 'version' => '8.2.1', |
133 | 160 | 'manage_repo' => false, |
134 | 161 | 'api_timeout' => 30, |
135 | 162 | 'restart_on_change' => true, |
136 | 163 | 'datadir' => '/var/lib/elasticsearch', |
137 | 164 | 'manage_datadir' => false, |
| 165 | + 'manage_logdir' => false, |
138 | 166 | 'init_defaults' => { 'ES_JAVA_OPTS' => '"-Xms768m -Xmx1024m"' } |
139 | 167 | ) } |
140 | 168 |
|
|
154 | 182 | it { is_expected.to contain_mount('/var/lib/elasticsearch').that_requires('Profiles::Lvm::Mount[elasticsearchdata]') } |
155 | 183 | it { is_expected.to contain_mount('/var/lib/elasticsearch').that_requires('File[/var/lib/elasticsearch]') } |
156 | 184 | it { is_expected.to contain_mount('/var/lib/elasticsearch').that_comes_before('Class[elasticsearch]') } |
| 185 | + it { is_expected.to contain_profiles__lvm__mount('elasticsearchlogs').that_requires('Group[elasticsearch]') } |
| 186 | + it { is_expected.to contain_profiles__lvm__mount('elasticsearchlogs').that_requires('User[elasticsearch]') } |
| 187 | + it { is_expected.to contain_file('/var/log/elasticsearch').that_requires('Group[elasticsearch]') } |
| 188 | + it { is_expected.to contain_file('/var/log/elasticsearch').that_requires('User[elasticsearch]') } |
| 189 | + it { is_expected.to contain_file('/var/log/elasticsearch').that_comes_before('Class[elasticsearch]') } |
| 190 | + it { is_expected.to contain_mount('/var/log/elasticsearch').that_requires('Profiles::Lvm::Mount[elasticsearchlogs]') } |
| 191 | + it { is_expected.to contain_mount('/var/log/elasticsearch').that_requires('File[/var/log/elasticsearch]') } |
| 192 | + it { is_expected.to contain_mount('/var/log/elasticsearch').that_comes_before('Class[elasticsearch]') } |
157 | 193 | it { is_expected.to contain_class('elasticsearch').that_requires('Apt::Source[elastic-8.x]') } |
158 | 194 | end |
159 | 195 | end |
|
192 | 228 | 'options' => 'rw,bind' |
193 | 229 | ) } |
194 | 230 |
|
| 231 | + it { is_expected.not_to contain_profiles__lvm__mount('elasticsearchlogs') } |
| 232 | + it { is_expected.not_to contain_mount('/var/log/elasticsearch') } |
| 233 | + |
195 | 234 | it { is_expected.to contain_class('elasticsearch').with( |
196 | 235 | 'version' => '5.2.2', |
197 | 236 | 'manage_repo' => false, |
198 | 237 | 'api_timeout' => 30, |
199 | 238 | 'restart_on_change' => true, |
200 | 239 | 'datadir' => '/var/lib/elasticsearch', |
201 | 240 | 'manage_datadir' => false, |
| 241 | + 'manage_logdir' => true, |
202 | 242 | 'init_defaults' => { 'ES_JAVA_OPTS' => '"-Xms512m -Xmx512m"' } |
203 | 243 | ) } |
204 | 244 |
|
|
0 commit comments