module ChefUtils::DSL::Introspection
def ci?(node = __getnode)
-
(Boolean)
-
Other tags:
- Since: - 15.5
Parameters:
-
node
(Chef::Node
) -- the node to check
def ci?(node = __getnode) ENV.key?("CI") end
def docker?(node = __getnode)
-
(Boolean)
-
Other tags:
- Since: - 12.11
Parameters:
-
node
(Chef::Node
) -- the node to check
def docker?(node = __getnode) # Using "File.exist?('/.dockerinit') || File.exist?('/.dockerenv')" makes Travis sad, # and that makes us sad too. !!(node && node.read("virtualization", "systems", "docker") == "guest") end
def has_systemd_service_unit?(svc_name)
-
(Boolean)
-
Other tags:
- Since: - 15.5
Parameters:
-
svc_name
(String
) --
def has_systemd_service_unit?(svc_name) %w{ /etc /usr/lib /lib /run }.any? do |load_path| file_exist?( "#{load_path}/systemd/system/#{svc_name.gsub(/@.*$/, "@")}.service" ) end end
def has_systemd_unit?(svc_name)
-
(Boolean)
-
Other tags:
- Since: - 15.5
Parameters:
-
svc_name
(String
) --
def has_systemd_unit?(svc_name) # TODO: stop supporting non-service units with service resource %w{ /etc /usr/lib /lib /run }.any? do |load_path| file_exist?("#{load_path}/systemd/system/#{svc_name}") end end
def includes_recipe?(recipe_name, node = __getnode)
-
(Boolean)
-
Other tags:
- Since: - 15.8
Parameters:
-
recipe_name
(String
) --
def includes_recipe?(recipe_name, node = __getnode) node.recipe?(recipe_name) end
def kitchen?(node = __getnode)
-
(Boolean)
-
Other tags:
- Since: - 15.5
Parameters:
-
node
(Chef::Node
) -- the node to check
def kitchen?(node = __getnode) ENV.key?("TEST_KITCHEN") end
def systemd?(node = __getnode)
-
(Boolean)
-
Other tags:
- Since: - 15.5
Parameters:
-
node
(Chef::Node
) -- the node to check
def systemd?(node = __getnode) file_exist?("/proc/1/comm") && file_open("/proc/1/comm").gets.chomp == "systemd" end