module ChefUtils::DSL::Cloud

Public Instance Methods

alibaba?(node = __getnode) click to toggle source

Determine if the current node is running in Alibaba Cloud

@param [Chef::Node] node the node to check @since 17.0

@return [Boolean]

# File lib/chef-utils/dsl/cloud.rb, line 45
def alibaba?(node = __getnode)
  node.key?("alibaba")
end
azure?(node = __getnode) click to toggle source

Determine if the current node is running in Microsoft Azure.

@param [Chef::Node] node the node to check @since 15.8

@return [Boolean]

# File lib/chef-utils/dsl/cloud.rb, line 124
def azure?(node = __getnode)
  node.key?("azure")
end
cloud?(node = __getnode) click to toggle source

Determine if the current node is running in a known cloud.

@param [Chef::Node] node the node to check @since 15.8

@return [Boolean]

# File lib/chef-utils/dsl/cloud.rb, line 33
def cloud?(node = __getnode)
  # cloud is always present, but nil if not on a cloud
  !node["cloud"].nil?
end
digital_ocean?(node = __getnode) click to toggle source

Determine if the current node is running in DigitalOcean.

@param [Chef::Node] node the node to check @since 15.8

@return [Boolean]

# File lib/chef-utils/dsl/cloud.rb, line 135
def digital_ocean?(node = __getnode)
  node.key?("digital_ocean")
end
Also aliased as: digitalocean?
digitalocean?(node = __getnode)

chef-sugar backcompat method

Alias for: digital_ocean?
ec2?(node = __getnode) click to toggle source

Determine if the current node is running in AWS EC2.

@param [Chef::Node] node the node to check @since 15.8

@return [Boolean]

# File lib/chef-utils/dsl/cloud.rb, line 56
def ec2?(node = __getnode)
  node.key?("ec2")
end
euca?(node = __getnode)

chef-sugar backcompat method

Alias for: eucalyptus?
eucalyptus?(node = __getnode) click to toggle source

Determine if the current node is running in Eucalyptus.

@param [Chef::Node] node the node to check @since 15.8

@return [Boolean]

# File lib/chef-utils/dsl/cloud.rb, line 89
def eucalyptus?(node = __getnode)
  node.key?("eucalyptus")
end
Also aliased as: euca?
gce?(node = __getnode) click to toggle source

Determine if the current node running in Google Compute Engine (GCE).

@param [Chef::Node] node the node to check @since 15.8

@return [Boolean]

# File lib/chef-utils/dsl/cloud.rb, line 67
def gce?(node = __getnode)
  node.key?("gce")
end
linode?(node = __getnode) click to toggle source

Determine if the current node is running in Linode.

@param [Chef::Node] node the node to check @since 15.8

@return [Boolean]

# File lib/chef-utils/dsl/cloud.rb, line 102
def linode?(node = __getnode)
  node.key?("linode")
end
openstack?(node = __getnode) click to toggle source

Determine if the current node is running in OpenStack.

@param [Chef::Node] node the node to check @since 15.8

@return [Boolean]

# File lib/chef-utils/dsl/cloud.rb, line 113
def openstack?(node = __getnode)
  node.key?("openstack")
end
rackspace?(node = __getnode) click to toggle source

Determine if the current node is running in Rackspace.

@param [Chef::Node] node the node to check @since 15.8

@return [Boolean]

# File lib/chef-utils/dsl/cloud.rb, line 78
def rackspace?(node = __getnode)
  node.key?("rackspace")
end
softlayer?(node = __getnode) click to toggle source

Determine if the current node is running in SoftLayer (IBM Cloud).

@param [Chef::Node] node the node to check @since 15.8

@return [Boolean]

# File lib/chef-utils/dsl/cloud.rb, line 148
def softlayer?(node = __getnode)
  node.key?("softlayer")
end