Skip to content

Commit

Permalink
Merge pull request #212 from kscherer/suse_support
Browse files Browse the repository at this point in the history
Add support of OpenSuSE and SLED
  • Loading branch information
hopperd committed Jan 6, 2016
2 parents 57b0e94 + e9c0798 commit 4e93a9b
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 2 deletions.
10 changes: 8 additions & 2 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,14 @@
}
} elsif $::operatingsystem == 'Archlinux' {
$init_style = 'systemd'
} elsif $::operatingsystem == 'SLES' {
$init_style = 'sles'
} elsif $::operatingsystem == 'OpenSuSE' {
$init_style = 'systemd'
} elsif $::operatingsystem =~ /SLE[SD]/ {
if versioncmp($::operatingsystemrelease, '12.0') < 0 {
$init_style = 'sles'
} else {
$init_style = 'systemd'
}
} elsif $::operatingsystem == 'Darwin' {
$init_style = 'launchd'
} elsif $::operatingsystem == 'Amazon' {
Expand Down
21 changes: 21 additions & 0 deletions metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,27 @@
"20",
"21"
]
},
{
"operatingsystem": "OpenSuSE",
"operatingsystemrelease": [
"13.1",
"13.2"
]
},
{
"operatingsystem": "SLES",
"operatingsystemrelease": [
"11.4",
"12.0"
]
},
{
"operatingsystem": "SLED",
"operatingsystemrelease": [
"11.4",
"12.0"
]
}
]
}
27 changes: 27 additions & 0 deletions spec/classes/init_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -690,6 +690,33 @@
it { should contain_class('consul').with_init_style('debian') }
end

context "On opensuse" do
let(:facts) {{
:operatingsystem => 'OpenSuSE',
:operatingsystemrelease => '13.1'
}}

it { should contain_class('consul').with_init_style('systemd') }
end

context "On SLED" do
let(:facts) {{
:operatingsystem => 'SLED',
:operatingsystemrelease => '11.4'
}}

it { should contain_class('consul').with_init_style('sles') }
end

context "On SLES" do
let(:facts) {{
:operatingsystem => 'SLES',
:operatingsystemrelease => '12.0'
}}

it { should contain_class('consul').with_init_style('systemd') }
end

# Config Stuff
context "With extra_options" do
let(:params) {{
Expand Down

0 comments on commit 4e93a9b

Please sign in to comment.