@@ -15,10 +15,6 @@ def unindent
15
15
16
16
RSpec . configure do |c |
17
17
c . before :suite do
18
- # Install iproute on AlmaLinux
19
- # Package is used to check if ports are listening
20
- LitmusHelper . instance . run_shell ( 'sudo dnf install iproute -y' ) if %r{redhat} . match? ( os [ :family ] ) && os [ :release ] . to_f >= 8
21
-
22
18
install_dependencies
23
19
end
24
20
end
@@ -41,32 +37,31 @@ def pre_run
41
37
end
42
38
43
39
def install_dependencies
44
- iproute2 = <<-MANIFEST
45
- package { 'iproute2': ensure => installed }
46
- MANIFEST
47
- LitmusHelper . instance . apply_manifest ( iproute2 ) if os [ :family ] == 'ubuntu' && os [ :release ] . start_with? ( '18.04' )
48
-
49
- netstat = <<-MANIFEST
50
- # needed for netstat, for serverspec checks
51
- if $::osfamily == 'SLES' or $::osfamily == 'SUSE' {
52
- package { 'net-tools-deprecated':
53
- ensure => 'latest',
40
+ LitmusHelper . instance . apply_manifest <<~MANIFEST
41
+ if $facts['os']['name'] == 'Ubuntu' and $facts['os']['release']['major'] == '18.04' {
42
+ package { 'iproute2':
43
+ ensure => installed,
44
+ }
54
45
}
55
- }
56
- MANIFEST
57
-
58
- LitmusHelper . instance . apply_manifest ( netstat )
59
46
60
- return unless os [ :family ] == 'redhat' && os [ :release ] . start_with? ( '6' , '7' , '8' )
61
-
62
- policycoreutils_pkg = 'policycoreutils-python' if os [ :release ] . start_with? ( '6' , '7' )
63
- policycoreutils_pkg = 'policycoreutils-python-utils' if os [ :release ] . start_with? ( '8' )
47
+ # needed for netstat, for serverspec checks
48
+ if $facts['os']['family'] in ['SLES', 'SUSE'] {
49
+ package { 'net-tools-deprecated':
50
+ ensure => 'latest',
51
+ }
52
+ }
64
53
65
- selinux = <<-MANIFEST
66
- package { '#{ policycoreutils_pkg } ': ensure => installed }
54
+ if $facts['os']['family'] == 'RedHat' {
55
+ if versioncmp($facts['os']['release']['major'], '8') >= 0 {
56
+ $package = ['iproute', 'policycoreutils-python-utils']
57
+ } else {
58
+ $package = 'policycoreutils-python'
59
+ }
60
+ package { $package:
61
+ ensure => installed,
62
+ }
63
+ }
67
64
MANIFEST
68
-
69
- LitmusHelper . instance . apply_manifest ( selinux )
70
65
end
71
66
72
67
def postgresql_version
0 commit comments