|
258 | 258 |
|
259 | 259 | # Is set to true, it will create the apache vhost. |
260 | 260 | if $manage_vhost { |
| 261 | + $zabbix_ui_dir = versioncmp($zabbix_version, '7.2') ? { |
| 262 | + # Version older than 7.2 |
| 263 | + -1 => '/usr/share/zabbix', |
| 264 | + # Version 7.2 and newer |
| 265 | + default => '/usr/share/zabbix/ui', |
| 266 | + } |
| 267 | + |
261 | 268 | include apache |
262 | 269 | include apache::mod::dir |
263 | 270 | if $facts['os']['family'] == 'RedHat' { |
|
277 | 284 | } |
278 | 285 |
|
279 | 286 | $fcgi_filematch = { |
280 | | - path => '/usr/share/zabbix', |
| 287 | + path => $zabbix_ui_dir, |
281 | 288 | provider => 'directory', |
282 | 289 | addhandlers => [ |
283 | 290 | { |
|
319 | 326 | # We create nonssl vhost for redirecting non ssl |
320 | 327 | # traffic to https. |
321 | 328 | apache::vhost { "${zabbix_url}_nonssl": |
322 | | - docroot => '/usr/share/zabbix', |
| 329 | + docroot => $zabbix_ui_dir, |
323 | 330 | manage_docroot => false, |
324 | 331 | default_vhost => $default_vhost, |
325 | 332 | port => $apache_listenport, |
|
344 | 351 | } |
345 | 352 |
|
346 | 353 | apache::vhost { $zabbix_url: |
347 | | - docroot => '/usr/share/zabbix', |
| 354 | + docroot => $zabbix_ui_dir, |
348 | 355 | ip => $apache_listen_ip, |
349 | 356 | port => $apache_listen_port, |
350 | 357 | default_vhost => $default_vhost, |
351 | 358 | add_listen => true, |
352 | 359 | directories => [ |
353 | 360 | merge({ |
354 | | - path => '/usr/share/zabbix', |
| 361 | + path => $zabbix_ui_dir, |
355 | 362 | provider => 'directory', |
356 | 363 | require => 'all granted', |
357 | 364 | }, $fcgi_filematch |
358 | 365 | ), |
359 | 366 | { |
360 | | - path => '/usr/share/zabbix/conf', |
| 367 | + path => "${zabbix_ui_dir}/conf", |
361 | 368 | provider => 'directory', |
362 | 369 | require => 'all denied', |
363 | 370 | }, |
364 | 371 | { |
365 | | - path => '/usr/share/zabbix/api', |
| 372 | + path => "${zabbix_ui_dir}/api", |
366 | 373 | provider => 'directory', |
367 | 374 | require => 'all denied', |
368 | 375 | }, |
369 | 376 | { |
370 | | - path => '/usr/share/zabbix/include', |
| 377 | + path => "${zabbix_ui_dir}/include", |
371 | 378 | provider => 'directory', |
372 | 379 | require => 'all denied', |
373 | 380 | }, |
374 | 381 | { |
375 | | - path => '/usr/share/zabbix/include/classes', |
| 382 | + path => "${zabbix_ui_dir}/include/classes", |
376 | 383 | provider => 'directory', |
377 | 384 | require => 'all denied', |
378 | 385 | }, |
|
0 commit comments