Merge pull request #128 from chef/centos-support

Merged change 2a9e20a4-e14e-4b14-8e59-bd4ca1e7ac36

From review branch centos-support into master

Signed-off-by: drichter <drichter@chef.io>
This commit is contained in:
chef-delivery 2015-10-21 12:14:55 -07:00
commit 7bc775f3b7
3 changed files with 9 additions and 8 deletions

View file

@ -21,7 +21,7 @@ class Package < Vulcano.resource(1)
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)

View file

@ -55,9 +55,9 @@ class Service < Vulcano.resource(1)
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)
@ -83,18 +83,19 @@ class Service < Vulcano.resource(1)
# 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

View file

@ -47,7 +47,7 @@ class User < Vulcano.resource(1)
# 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)
@ -56,7 +56,7 @@ class User < Vulcano.resource(1)
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