-
Notifications
You must be signed in to change notification settings - Fork 681
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
Added oracle linux to rhel platform section of 'service' resource. #1511
Added oracle linux to rhel platform section of 'service' resource. #1511
Conversation
@@ -134,9 +134,9 @@ def select_service_mgmt # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticCom | |||
else | |||
SysV.new(inspec, service_ctl || '/usr/sbin/service') | |||
end | |||
elsif %w{redhat fedora centos}.include?(platform) | |||
elsif %w{redhat fedora centos oracle}.include?(platform) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe we spit this and support more redhat systems?
elsif os.redhat?
if os[:release].to_i >= 7
Systemd.new(inspec, service_ctl)
else
SysV.new(inspec, service_ctl || '/sbin/service')
end
elsif %w{fedora}.include?(platform)
if os[:release].to_i >= 15
Systemd.new(inspec, service_ctl)
else
SysV.new(inspec, service_ctl || '/sbin/service')
end
to support https://github.com/chef/train/blob/master/lib/train/extras/os_detect_linux.rb#L17
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm in favor of @chris-rock's suggestion as well.
@carldjohnston Anything we can help you with to get the support for oracle linux in? |
Hi @chris-rock, thanks for the prod - just finding time to progress these :) I like you're suggestions, new commit shows this new approach. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @carldjohnston
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I forgot wrlinux. @carldjohnston Can you please update once again. I apologize for the extra work. I like the split between fedora and redhat though.
lib/resources/service.rb
Outdated
elsif %w{redhat fedora centos}.include?(platform) | ||
version = os[:release].to_i | ||
if (%w{ redhat centos }.include?(platform) && version >= 7) || (platform == 'fedora' && version >= 15) | ||
elsif os.redhat? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to go with %w{redhat fedora centos oracle}.include?(platform)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @chris-rock, I've reverted to the previous commit - messy but it works :)
I have this problem, all Oracle Linux systems, and inspec service is not supported. When will this be generally available, or is there a workaround? |
@carldjohnston Can you do me a favor? We do not need the revert in our history. We need to rebase your branch on latest master and remove the 2 of the 3 commits. You can fix that with the following commands:
Please ensure that the git history is alright before you force push to github. |
Broken when chef/train was fixed to detect oracle linux correctly. Signed-off-by: Carl Johnston <[email protected]>
Hi @chris-rock, thanks for the instruction, very cool - you learn something new every day! I've rebased and pushed up the cleaned up repo. |
cc @adamleff |
Nice work, @carldjohnston! Thanks for working with us on this contribution. |
Tests currently skipping over 'service' resource on oracle linux.
Broken when chef/train was fixed to detect oracle linux correctly.