Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

more CentOS support #128

Merged
merged 4 commits into from
Oct 21, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/resources/package.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def initialize(package_name = nil)
case vulcano.os[:family]
when 'ubuntu', 'debian'
@pkgman = Deb.new(vulcano)
when 'redhat', 'fedora'
when 'redhat', 'fedora', 'centos'
@pkgman = Rpm.new(vulcano)
when 'arch'
@pkgman = Pacman.new(vulcano)
Expand Down
11 changes: 6 additions & 5 deletions lib/resources/service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ def select_package_manager # rubocop:disable Metrics/AbcSize, Metrics/Cyclomatic
else
@service_mgmt = SysV.new(vulcano)
end
when 'redhat', 'fedora'
when 'redhat', 'fedora', 'centos'
version = vulcano.os[:release].to_i
if (family == 'redhat' && version >= 7) || (family == 'fedora' && version >= 15)
if (%w{ redhat centos }.include?(family) && version >= 7) || (family == 'fedora' && version >= 15)
@service_mgmt = Systemd.new(vulcano)
else
@service_mgmt = SysV.new(vulcano)
Expand All @@ -83,18 +83,19 @@ def info

# verifies the service is enabled
def enabled?(_level = nil)
return nil if info.nil?
return false if info.nil?
info[:enabled]
end

# verifies the service is registered
def installed?(_name = nil, _version = nil)
!info.nil?
return false if info.nil?
info[:installed]
end

# verifies the service is currently running
def running?(_under = nil)
return nil if info.nil?
return false if info.nil?
info[:running]
end

Expand Down
4 changes: 2 additions & 2 deletions lib/resources/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def initialize(user)
# select package manager
@user_provider = nil
case vulcano.os[:family]
when 'ubuntu', 'debian', 'redhat', 'fedora', 'arch'
when 'ubuntu', 'debian', 'redhat', 'fedora', 'centos', 'arch'
@user_provider = LinuxUser.new(vulcano)
when 'windows'
@user_provider = WindowsUser.new(vulcano)
Expand All @@ -56,7 +56,7 @@ def initialize(user)
when 'freebsd'
@user_provider = FreeBSDUser.new(vulcano)
else
return skip_resource 'The `package` resource is not supported on your OS yet.'
return skip_resource 'The `user` resource is not supported on your OS yet.'
end
end

Expand Down