diff options
-rw-r--r-- | chef-utils/lib/chef-utils/dsl/platform.rb | 6 | ||||
-rw-r--r-- | chef-utils/lib/chef-utils/dsl/platform_family.rb | 6 | ||||
-rw-r--r-- | chef-utils/lib/chef-utils/dsl/service.rb | 8 |
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 d3d33ece5c..3968a20f15 100644 --- a/chef-utils/lib/chef-utils/dsl/platform.rb +++ b/chef-utils/lib/chef-utils/dsl/platform.rb @@ -281,7 +281,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 # @@ -293,7 +293,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 # @@ -303,7 +303,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 # diff --git a/chef-utils/lib/chef-utils/dsl/platform_family.rb b/chef-utils/lib/chef-utils/dsl/platform_family.rb index fe96c73150..6fa7b7829b 100644 --- a/chef-utils/lib/chef-utils/dsl/platform_family.rb +++ b/chef-utils/lib/chef-utils/dsl/platform_family.rb @@ -92,7 +92,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 # @@ -102,7 +102,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 # @@ -112,7 +112,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 # diff --git a/chef-utils/lib/chef-utils/dsl/service.rb b/chef-utils/lib/chef-utils/dsl/service.rb index da4ea6c8a1..41478f85fe 100644 --- a/chef-utils/lib/chef-utils/dsl/service.rb +++ b/chef-utils/lib/chef-utils/dsl/service.rb @@ -66,6 +66,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 |