From 754bbf7a25a8dda49b5d08ef0d0443bbf5af0e36 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Sun, 7 Apr 2024 13:41:34 -0500 Subject: new repository --- devdocs/vagrant/provisioning%2Fchef_apply.html | 34 ++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 devdocs/vagrant/provisioning%2Fchef_apply.html (limited to 'devdocs/vagrant/provisioning%2Fchef_apply.html') diff --git a/devdocs/vagrant/provisioning%2Fchef_apply.html b/devdocs/vagrant/provisioning%2Fchef_apply.html new file mode 100644 index 00000000..b701ee4e --- /dev/null +++ b/devdocs/vagrant/provisioning%2Fchef_apply.html @@ -0,0 +1,34 @@ +

Chef Apply Provisioner

Provisioner name: chef_apply

The Vagrant Chef Apply provisioner allows you to provision the guest using Chef, specifically with Chef Apply.

Chef Apply is ideal for people who are already experienced with Chef and the Chef ecosystem. Specifically, this documentation page does not cover how use Chef or how to write Chef recipes.

Warning: If you are not familiar with Chef and Vagrant already, we recommend starting with the shell provisioner.

+

Options

This section lists the complete set of available options for the Chef Apply provisioner. More detailed examples of how to use the provisioner are available below this section.

In addition to all the options listed above, the Chef Apply provisioner supports the common options for all Chef provisioners.

Specifying a Recipe

The easiest way to get started with the Chef Apply provisioner is to just specify an inline Chef recipe. For example:

Vagrant.configure("2") do |config|
+  config.vm.provision "chef_apply" do |chef|
+    chef.recipe = "package[apache2]"
+  end
+end
+
+

This causes Vagrant to run Chef Apply with the given recipe contents. If you are familiar with Chef, you know this will install the apache2 package from the system package provider.

Since single-line Chef recipes are rare, you can also specify the recipe using a "heredoc":

Vagrant.configure("2") do |config|
+  config.vm.provision "chef_apply" do |chef|
+    chef.recipe = <<-RECIPE
+      package "apache2"
+
+      template "/etc/apache2/my.config" do
+        # ...
+      end
+    RECIPE
+  end
+end
+
+

Finally, if you would prefer to store the recipe as plain-text, you can set the recipe to the contents of a file:

Vagrant.configure("2") do |config|
+  config.vm.provision "chef_apply" do |chef|
+    chef.recipe = File.read("/path/to/my/recipe.rb")
+  end
+end
+
+

Roles

The Vagrant Chef Apply provisioner does not support roles. Please use a different Vagrant Chef provisioner if you need support for roles.

Data Bags

The Vagrant Chef Apply provisioner does not support data_bags. Please use a different Vagrant Chef provisioner if you need support for data_bags.

+

+ © 2010–2018 Mitchell Hashimoto
Licensed under the MPL 2.0 License.
+ https://www.vagrantup.com/docs/provisioning/chef_apply.html +

+
-- cgit v1.2.3