Skip to content

Commit 4e93a9b

Browse files
committed
Merge pull request #212 from kscherer/suse_support
Add support of OpenSuSE and SLED
2 parents 57b0e94 + e9c0798 commit 4e93a9b

File tree

3 files changed

+56
-2
lines changed

3 files changed

+56
-2
lines changed

manifests/params.pp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,14 @@
5555
}
5656
} elsif $::operatingsystem == 'Archlinux' {
5757
$init_style = 'systemd'
58-
} elsif $::operatingsystem == 'SLES' {
59-
$init_style = 'sles'
58+
} elsif $::operatingsystem == 'OpenSuSE' {
59+
$init_style = 'systemd'
60+
} elsif $::operatingsystem =~ /SLE[SD]/ {
61+
if versioncmp($::operatingsystemrelease, '12.0') < 0 {
62+
$init_style = 'sles'
63+
} else {
64+
$init_style = 'systemd'
65+
}
6066
} elsif $::operatingsystem == 'Darwin' {
6167
$init_style = 'launchd'
6268
} elsif $::operatingsystem == 'Amazon' {

metadata.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,27 @@
7777
"20",
7878
"21"
7979
]
80+
},
81+
{
82+
"operatingsystem": "OpenSuSE",
83+
"operatingsystemrelease": [
84+
"13.1",
85+
"13.2"
86+
]
87+
},
88+
{
89+
"operatingsystem": "SLES",
90+
"operatingsystemrelease": [
91+
"11.4",
92+
"12.0"
93+
]
94+
},
95+
{
96+
"operatingsystem": "SLED",
97+
"operatingsystemrelease": [
98+
"11.4",
99+
"12.0"
100+
]
80101
}
81102
]
82103
}

spec/classes/init_spec.rb

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -690,6 +690,33 @@
690690
it { should contain_class('consul').with_init_style('debian') }
691691
end
692692

693+
context "On opensuse" do
694+
let(:facts) {{
695+
:operatingsystem => 'OpenSuSE',
696+
:operatingsystemrelease => '13.1'
697+
}}
698+
699+
it { should contain_class('consul').with_init_style('systemd') }
700+
end
701+
702+
context "On SLED" do
703+
let(:facts) {{
704+
:operatingsystem => 'SLED',
705+
:operatingsystemrelease => '11.4'
706+
}}
707+
708+
it { should contain_class('consul').with_init_style('sles') }
709+
end
710+
711+
context "On SLES" do
712+
let(:facts) {{
713+
:operatingsystem => 'SLES',
714+
:operatingsystemrelease => '12.0'
715+
}}
716+
717+
it { should contain_class('consul').with_init_style('systemd') }
718+
end
719+
693720
# Config Stuff
694721
context "With extra_options" do
695722
let(:params) {{

0 commit comments

Comments
 (0)