Module: Chef::Sugar::DSL
- Defined in:
- lib/chef/sugar/ip.rb,
lib/chef/sugar/init.rb,
lib/chef/sugar/ruby.rb,
lib/chef/sugar/cloud.rb,
lib/chef/sugar/shell.rb,
lib/chef/sugar/docker.rb,
lib/chef/sugar/filters.rb,
lib/chef/sugar/kitchen.rb,
lib/chef/sugar/vagrant.rb,
lib/chef/sugar/data_bag.rb,
lib/chef/sugar/platform.rb,
lib/chef/sugar/run_context.rb,
lib/chef/sugar/architecture.rb,
lib/chef/sugar/virtualization.rb,
lib/chef/sugar/constraints_dsl.rb,
lib/chef/sugar/platform_family.rb
Instance Method Summary collapse
- #_32_bit? ⇒ Boolean
- #_64_bit? ⇒ Boolean
- #aarch64? ⇒ Boolean
-
#after(identifier, &block) ⇒ Object
Dynamically insert resources after an existing resource in the resource_collection.
- #armhf? ⇒ Boolean
-
#at_compile_time(&block) ⇒ Object
Dynamically run resources specified in the block during the compilation phase, instead of the convergence phase.
- #azure? ⇒ Boolean
-
#before(identifier, &block) ⇒ Object
Dynamically insert resources before an existing resource in the resource_collection.
- #best_ip_for(other) ⇒ Object
-
#chef_version ⇒ Chef::Sugar::Constraints::Version
This wrapper/convenience method is only available in the recipe DSL.
- #cloud? ⇒ Boolean
- #cloudstack? ⇒ Boolean
- #constraint(*constraints) ⇒ Object
- #data_bag_item_for_environment(bag, id) ⇒ Object
- #dev_null ⇒ Object
- #digitalocean? ⇒ Boolean
- #docker? ⇒ Boolean
- #ec2? ⇒ Boolean
- #encrypted_data_bag_item(bag, id, secret = nil) ⇒ Object
- #encrypted_data_bag_item_for_environment(bag, id, secret = nil) ⇒ Object
- #eucalyptus? ⇒ Boolean (also: #euca?)
- #gce? ⇒ Boolean
- #i386? ⇒ Boolean
- #includes_recipe?(recipe_name) ⇒ Boolean (also: #include_recipe?)
- #installed?(cmd) ⇒ Boolean
- #installed_at_version?(cmd, version, flag = '--version') ⇒ Boolean
- #intel? ⇒ Boolean
- #kitchen? ⇒ Boolean
- #kvm? ⇒ Boolean
- #linode? ⇒ Boolean
- #lxc? ⇒ Boolean
- #openstack? ⇒ Boolean
- #openvz? ⇒ Boolean
- #parallels? ⇒ Boolean
- #physical? ⇒ Boolean
- #powerpc? ⇒ Boolean
- #ppc64? ⇒ Boolean
- #ppc64le? ⇒ Boolean
- #rackspace? ⇒ Boolean
- #ruby_19? ⇒ Boolean
- #ruby_20? ⇒ Boolean
- #runit? ⇒ Boolean
- #s390x? ⇒ Boolean
- #softlayer? ⇒ Boolean
- #sparc? ⇒ Boolean
- #systemd? ⇒ Boolean
- #upstart? ⇒ Boolean
- #vagrant? ⇒ Boolean
- #version(version) ⇒ Object
- #version_for(cmd, flag = '--version') ⇒ Object
- #virtual? ⇒ Boolean
- #virtualbox? ⇒ Boolean
- #vmware? ⇒ Boolean
- #which(cmd) ⇒ Object
Instance Method Details
#_32_bit? ⇒ Boolean
144 |
# File 'lib/chef/sugar/architecture.rb', line 144 def _32_bit?; Chef::Sugar::Architecture._32_bit?(node); end |
#_64_bit? ⇒ Boolean
141 |
# File 'lib/chef/sugar/architecture.rb', line 141 def _64_bit?; Chef::Sugar::Architecture._64_bit?(node); end |
#aarch64? ⇒ Boolean
168 |
# File 'lib/chef/sugar/architecture.rb', line 168 def aarch64?; Chef::Sugar::Architecture.aarch64?(node); end |
#after(identifier, &block) ⇒ Object
Dynamically insert resources after an existing resource in the resource_collection.
after 'service[apache2]' do
template '/etc/apache2/thing.conf' do
source '...'
end
end
148 149 150 |
# File 'lib/chef/sugar/filters.rb', line 148 def after(identifier, &block) Chef::Sugar::Filters::Injector.new(self, identifier, :after).evaluate(&block) end |
#armhf? ⇒ Boolean
165 |
# File 'lib/chef/sugar/architecture.rb', line 165 def armhf?; Chef::Sugar::Architecture.armhf?(node); end |
#at_compile_time(&block) ⇒ Object
Dynamically run resources specified in the block during the compilation phase, instead of the convergence phase.
108 109 110 |
# File 'lib/chef/sugar/filters.rb', line 108 def at_compile_time(&block) Chef::Sugar::Filters::AtCompileTime.new(self).evaluate(&block) end |
#azure? ⇒ Boolean
183 |
# File 'lib/chef/sugar/cloud.rb', line 183 def azure?; Chef::Sugar::Cloud.azure?(node); end |
#before(identifier, &block) ⇒ Object
Dynamically insert resources before an existing resource in the resource_collection.
before 'service[apache2]' do
template '/etc/apache2/thing.conf' do
source '...'
end
end
128 129 130 |
# File 'lib/chef/sugar/filters.rb', line 128 def before(identifier, &block) Chef::Sugar::Filters::Injector.new(self, identifier, :before).evaluate(&block) end |
#best_ip_for(other) ⇒ Object
45 |
# File 'lib/chef/sugar/ip.rb', line 45 def best_ip_for(other); Chef::Sugar::IP.best_ip_for(node, other); end |
#chef_version ⇒ Chef::Sugar::Constraints::Version
This wrapper/convenience method is only available in the recipe DSL. It creates a new version object from the VERSION.
78 79 80 |
# File 'lib/chef/sugar/constraints_dsl.rb', line 78 def chef_version version(Chef::VERSION) end |
#cloud? ⇒ Boolean
158 |
# File 'lib/chef/sugar/cloud.rb', line 158 def cloud?; Chef::Sugar::Cloud.cloud?(node); end |
#cloudstack? ⇒ Boolean
180 |
# File 'lib/chef/sugar/cloud.rb', line 180 def cloudstack?; Chef::Sugar::Cloud.cloudstack?(node); end |
#constraint(*constraints) ⇒ Object
64 65 66 |
# File 'lib/chef/sugar/constraints_dsl.rb', line 64 def constraint(*constraints) Chef::Sugar::Constraints.constraint(*constraints) end |
#data_bag_item_for_environment(bag, id) ⇒ Object
141 142 143 |
# File 'lib/chef/sugar/data_bag.rb', line 141 def data_bag_item_for_environment(bag, id) Chef::Sugar::DataBag.data_bag_item_for_environment(node, bag, id) end |
#dev_null ⇒ Object
141 |
# File 'lib/chef/sugar/shell.rb', line 141 def dev_null; Chef::Sugar::Shell.dev_null(node); end |
#digitalocean? ⇒ Boolean
186 |
# File 'lib/chef/sugar/cloud.rb', line 186 def digitalocean?; Chef::Sugar::Cloud.digitalocean?(node); end |
#docker? ⇒ Boolean
41 |
# File 'lib/chef/sugar/docker.rb', line 41 def docker?; Chef::Sugar::Docker.docker?(node); end |
#ec2? ⇒ Boolean
161 |
# File 'lib/chef/sugar/cloud.rb', line 161 def ec2?; Chef::Sugar::Cloud.ec2?(node); end |
#encrypted_data_bag_item(bag, id, secret = nil) ⇒ Object
131 132 133 |
# File 'lib/chef/sugar/data_bag.rb', line 131 def encrypted_data_bag_item(bag, id, secret = nil) Chef::Sugar::DataBag.encrypted_data_bag_item(bag, id, secret) end |
#encrypted_data_bag_item_for_environment(bag, id, secret = nil) ⇒ Object
136 137 138 |
# File 'lib/chef/sugar/data_bag.rb', line 136 def encrypted_data_bag_item_for_environment(bag, id, secret = nil) Chef::Sugar::DataBag.encrypted_data_bag_item_for_environment(node, bag, id, secret) end |
#eucalyptus? ⇒ Boolean Also known as: euca?
170 |
# File 'lib/chef/sugar/cloud.rb', line 170 def eucalyptus?; Chef::Sugar::Cloud.eucalyptus?(node); end |
#gce? ⇒ Boolean
164 |
# File 'lib/chef/sugar/cloud.rb', line 164 def gce?; Chef::Sugar::Cloud.gce?(node); end |
#i386? ⇒ Boolean
147 |
# File 'lib/chef/sugar/architecture.rb', line 147 def i386?; Chef::Sugar::Architecture.i386?(node); end |
#includes_recipe?(recipe_name) ⇒ Boolean Also known as: include_recipe?
35 36 37 |
# File 'lib/chef/sugar/run_context.rb', line 35 def includes_recipe?(recipe_name) Chef::Sugar::RunContext.includes_recipe?(node, recipe_name) end |
#installed?(cmd) ⇒ Boolean
144 |
# File 'lib/chef/sugar/shell.rb', line 144 def installed?(cmd); Chef::Sugar::Shell.installed?(cmd); end |
#installed_at_version?(cmd, version, flag = '--version') ⇒ Boolean
147 148 149 |
# File 'lib/chef/sugar/shell.rb', line 147 def installed_at_version?(cmd, version, flag = '--version') Chef::Sugar::Shell.installed_at_version?(cmd, version, flag) end |
#intel? ⇒ Boolean
150 |
# File 'lib/chef/sugar/architecture.rb', line 150 def intel?; Chef::Sugar::Architecture.intel?(node); end |
#kitchen? ⇒ Boolean
41 |
# File 'lib/chef/sugar/kitchen.rb', line 41 def kitchen?; Chef::Sugar::Kitchen.kitchen?(node); end |
#kvm? ⇒ Boolean
111 112 113 |
# File 'lib/chef/sugar/virtualization.rb', line 111 def kvm? Chef::Sugar::Virtualization.kvm?(node) end |
#linode? ⇒ Boolean
174 |
# File 'lib/chef/sugar/cloud.rb', line 174 def linode?; Chef::Sugar::Cloud.linode?(node); end |
#lxc? ⇒ Boolean
116 117 118 |
# File 'lib/chef/sugar/virtualization.rb', line 116 def lxc? Chef::Sugar::Virtualization.lxc?(node) end |
#openstack? ⇒ Boolean
177 |
# File 'lib/chef/sugar/cloud.rb', line 177 def openstack?; Chef::Sugar::Cloud.openstack?(node); end |
#openvz? ⇒ Boolean
136 137 138 |
# File 'lib/chef/sugar/virtualization.rb', line 136 def openvz? Chef::Sugar::Virtualization.openvz?(node) end |
#parallels? ⇒ Boolean
121 122 123 |
# File 'lib/chef/sugar/virtualization.rb', line 121 def parallels? Chef::Sugar::Virtualization.parallels?(node) end |
#physical? ⇒ Boolean
146 147 148 |
# File 'lib/chef/sugar/virtualization.rb', line 146 def physical? Chef::Sugar::Virtualization.physical?(node) end |
#powerpc? ⇒ Boolean
162 |
# File 'lib/chef/sugar/architecture.rb', line 162 def powerpc?; Chef::Sugar::Architecture.powerpc?(node); end |
#ppc64? ⇒ Boolean
156 |
# File 'lib/chef/sugar/architecture.rb', line 156 def ppc64?; Chef::Sugar::Architecture.ppc64?(node); end |
#ppc64le? ⇒ Boolean
159 |
# File 'lib/chef/sugar/architecture.rb', line 159 def ppc64le?; Chef::Sugar::Architecture.ppc64le?(node); end |
#rackspace? ⇒ Boolean
167 |
# File 'lib/chef/sugar/cloud.rb', line 167 def rackspace?; Chef::Sugar::Cloud.rackspace?(node); end |
#ruby_19? ⇒ Boolean
48 |
# File 'lib/chef/sugar/ruby.rb', line 48 def ruby_19?; Chef::Sugar::Ruby.ruby_19?(node); end |
#ruby_20? ⇒ Boolean
45 |
# File 'lib/chef/sugar/ruby.rb', line 45 def ruby_20?; Chef::Sugar::Ruby.ruby_20?(node); end |
#runit? ⇒ Boolean
58 |
# File 'lib/chef/sugar/init.rb', line 58 def runit?; Chef::Sugar::Init.runit?(node); end |
#s390x? ⇒ Boolean
171 |
# File 'lib/chef/sugar/architecture.rb', line 171 def s390x?; Chef::Sugar::Architecture.s390x?(node); end |
#softlayer? ⇒ Boolean
189 |
# File 'lib/chef/sugar/cloud.rb', line 189 def softlayer?; Chef::Sugar::Cloud.softlayer?(node); end |
#sparc? ⇒ Boolean
153 |
# File 'lib/chef/sugar/architecture.rb', line 153 def sparc?; Chef::Sugar::Architecture.sparc?(node); end |
#systemd? ⇒ Boolean
52 |
# File 'lib/chef/sugar/init.rb', line 52 def systemd?; Chef::Sugar::Init.systemd?(node); end |
#upstart? ⇒ Boolean
55 |
# File 'lib/chef/sugar/init.rb', line 55 def upstart?; Chef::Sugar::Init.upstart?(node); end |
#vagrant? ⇒ Boolean
74 |
# File 'lib/chef/sugar/vagrant.rb', line 74 def vagrant?; Chef::Sugar::Vagrant.vagrant?(node); end |
#version(version) ⇒ Object
59 60 61 |
# File 'lib/chef/sugar/constraints_dsl.rb', line 59 def version(version) Chef::Sugar::Constraints::Version.new(version) end |
#version_for(cmd, flag = '--version') ⇒ Object
152 153 154 |
# File 'lib/chef/sugar/shell.rb', line 152 def version_for(cmd, flag = '--version') Chef::Sugar::Shell.version_for(cmd, flag) end |
#virtual? ⇒ Boolean
141 142 143 |
# File 'lib/chef/sugar/virtualization.rb', line 141 def virtual? Chef::Sugar::Virtualization.virtual?(node) end |
#virtualbox? ⇒ Boolean
126 127 128 |
# File 'lib/chef/sugar/virtualization.rb', line 126 def virtualbox? Chef::Sugar::Virtualization.virtualbox?(node) end |
#vmware? ⇒ Boolean
131 132 133 |
# File 'lib/chef/sugar/virtualization.rb', line 131 def vmware? Chef::Sugar::Virtualization.vmware?(node) end |