Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
mirror
rsyslog
Commits
b45accd6
Commit
b45accd6
authored
Aug 21, 2015
by
Tim Smith
Browse files
Merge pull request #89 from fjg/fix-ubuntu-service-provider
fix(provider): since Ubuntu 15.04 should use Systemd
parents
0595dc43
d0584032
Changes
1
Hide whitespace changes
Inline
Side-by-side
libraries/helpers.rb
View file @
b45accd6
module
RsyslogCookbook
# helpers for the various service providers on Ubuntu systems
module
Helpers
def
declare_rsyslog_service
if
node
[
'platform'
]
==
'ubuntu'
&&
node
[
'platform_version'
].
to_f
>=
12.04
service_provider
=
Chef
::
Provider
::
Service
::
Upstart
else
service_provider
=
nil
end
service
node
[
'rsyslog'
][
'service_name'
]
do
supports
:restart
=>
true
,
:status
=>
true
action
[
:enable
,
:start
]
provider
service_provider
end
end
end
module
RsyslogCookbook
# helpers for the various service providers on Ubuntu systems
module
Helpers
def
declare_rsyslog_service
if
'ubuntu'
==
node
[
'platform'
]
if
Chef
::
VersionConstraint
.
new
(
'>= 15.04'
).
include?
(
node
[
'platform_version'
])
service_provider
=
Chef
::
Provider
::
Service
::
Systemd
elsif
Chef
::
VersionConstraint
.
new
(
'>= 12.04'
).
include?
(
node
[
'platform_version'
])
service_provider
=
Chef
::
Provider
::
Service
::
Upstart
else
service_provider
=
nil
end
end
service
'rsyslog'
do
service_name
node
[
'rsyslog'
][
'service_name'
]
supports
:restart
=>
true
,
:status
=>
true
action
[
:enable
,
:start
]
provider
service_provider
end
end
end
end
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment