summaryrefslogtreecommitdiff
path: root/chef-utils
diff options
context:
space:
mode:
Diffstat (limited to 'chef-utils')
-rw-r--r--chef-utils/lib/chef-utils/dsl/platform.rb6
-rw-r--r--chef-utils/lib/chef-utils/dsl/platform_family.rb6
-rw-r--r--chef-utils/lib/chef-utils/dsl/service.rb8
3 files changed, 14 insertions, 6 deletions
diff --git a/chef-utils/lib/chef-utils/dsl/platform.rb b/chef-utils/lib/chef-utils/dsl/platform.rb
index 8ea486b268..8af405d51c 100644
--- a/chef-utils/lib/chef-utils/dsl/platform.rb
+++ b/chef-utils/lib/chef-utils/dsl/platform.rb
@@ -303,7 +303,7 @@ module ChefUtils
node["platform"] == "dragonfly"
end
- # Determine if the current node is MacOS.
+ # Determine if the current node is macOS.
#
# @param [Chef::Node] node the node to check
# @since 15.5
@@ -316,7 +316,7 @@ module ChefUtils
# chef-sugar backcompat method
alias_method :mac_os_x_platform?, :macos_platform?
- # Determine if the current node is gentoo
+ # Determine if the current node is Gentoo.
#
# @param [Chef::Node] node the node to check
# @since 15.5
@@ -327,7 +327,7 @@ module ChefUtils
node["platform"] == "gentoo"
end
- # Determine if the current node is slackware.
+ # Determine if the current node is Slackware.
#
# @param [Chef::Node] node the node to check
# @since 15.5
diff --git a/chef-utils/lib/chef-utils/dsl/platform_family.rb b/chef-utils/lib/chef-utils/dsl/platform_family.rb
index f9bc4d299d..9d0c878cb7 100644
--- a/chef-utils/lib/chef-utils/dsl/platform_family.rb
+++ b/chef-utils/lib/chef-utils/dsl/platform_family.rb
@@ -98,7 +98,7 @@ module ChefUtils
# chef-sugar backcompat method
alias_method :el?, :rhel?
- # Determine if the current node is a rhel6 compatible build (Red Hat, CentOS, Oracle or Scientific Linux)
+ # Determine if the current node is a rhel6 compatible build (Red Hat, CentOS, Oracle or Scientific Linux).
#
# @param [Chef::Node] node the node to check
# @since 15.5
@@ -109,7 +109,7 @@ module ChefUtils
node["platform_family"] == "rhel" && node["platform_version"].to_f >= 6.0 && node["platform_version"].to_f < 7.0
end
- # Determine if the current node is a rhel7 compatible build (Red Hat, CentOS, Oracle or Scientific Linux)
+ # Determine if the current node is a rhel7 compatible build (Red Hat, CentOS, Oracle or Scientific Linux).
#
# @param [Chef::Node] node the node to check
# @since 15.5
@@ -120,7 +120,7 @@ module ChefUtils
node["platform_family"] == "rhel" && node["platform_version"].to_f >= 7.0 && node["platform_version"].to_f < 8.0
end
- # Determine if the current node is a rhel8 compatible build (Red Hat, CentOS, Oracle or Scientific Linux)
+ # Determine if the current node is a rhel8 compatible build (Red Hat, CentOS, Oracle or Scientific Linux).
#
# @param [Chef::Node] node the node to check
# @since 15.5
diff --git a/chef-utils/lib/chef-utils/dsl/service.rb b/chef-utils/lib/chef-utils/dsl/service.rb
index be1ea0708e..567c0f4a33 100644
--- a/chef-utils/lib/chef-utils/dsl/service.rb
+++ b/chef-utils/lib/chef-utils/dsl/service.rb
@@ -76,6 +76,14 @@ module ChefUtils
file_exist?("/sbin/chkconfig")
end
+ #
+ # Returns if a particular service exists for a particular service init system. Init systems may be :initd, :upstart, :etc_rcd, :xinetd, and :systemd. Example: service_script_exist?(:systemd, 'ntpd')
+ #
+ # @param [Symbol] type The type of init system. :initd, :upstart, :xinetd, :etc_rcd, or :systemd
+ # @param [String] script The name of the service
+ #
+ # @return [Boolean]
+ #
def service_script_exist?(type, script)
case type
when :initd