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%2Fsalt.html | 75 ++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 devdocs/vagrant/provisioning%2Fsalt.html (limited to 'devdocs/vagrant/provisioning%2Fsalt.html') diff --git a/devdocs/vagrant/provisioning%2Fsalt.html b/devdocs/vagrant/provisioning%2Fsalt.html new file mode 100644 index 00000000..7d16bad3 --- /dev/null +++ b/devdocs/vagrant/provisioning%2Fsalt.html @@ -0,0 +1,75 @@ +

Salt Provisioner

Provisioner name: salt

The Vagrant Salt provisioner allows you to provision the guest using Salt states.

Salt states are YAML documents that describes the current state a machine should be in, e.g. what packages should be installed, which services are running, and the contents of arbitrary files.

NOTE: The Salt provisioner is builtin to Vagrant. If the vagrant-salt plugin is installed, it should be uninstalled to ensure expected behavior.

Masterless Quickstart

What follows is a basic Vagrantfile that will get salt working on a single minion, without a master:

  Vagrant.configure("2") do |config|
+    ## Choose your base box
+    config.vm.box = "precise64"
+
+    ## For masterless, mount your salt file root
+    config.vm.synced_folder "salt/roots/", "/srv/salt/"
+
+    ## Use all the defaults:
+    config.vm.provision :salt do |salt|
+
+      salt.masterless = true
+      salt.minion_config = "salt/minion"
+      salt.run_highstate = true
+
+    end
+  end
+
+

This sets up a shared folder for the salt root, and copies the minion file over, then runs state.highstate on the machine. Your minion file must contain the line file_client: local in order to work in a masterless setup.

Install Options

Minion Options

These only make sense when no_minion is false.

Master Options

These only make sense when install_master is true. Not supported on Windows guest machines.

Execute States

Either of the following may be used to actually execute states during provisioning.

Execute Runners

Either of the following may be used to actually execute runners during provisioning.

Output Control

These may be used to control the output of state execution:

Pillar Data

You can export pillar data for use during provisioning by using the pillar command. Each call will merge the data so you can safely call it multiple times. The data passed in should only be hashes and lists. Here is an example::

      config.vm.provision :salt do |salt|
+
+        # Export hostnames for webserver config
+        salt.pillar({
+          "hostnames" => {
+            "www" => "www.example.com",
+            "intranet" => "intranet.example.com"
+          }
+        })
+
+        # Export database credentials
+        salt.pillar({
+          "database" => {
+            "user" => "jdoe",
+            "password" => "topsecret"
+          }
+        })
+
+        salt.run_highstate = true
+
+      end
+
+

On Windows guests, this requires PowerShell 3.0 or higher.

Preseeding Keys

Preseeding keys is the recommended way to handle provisioning using a master. On a machine with salt installed, run salt-key --gen-keys=[minion_id] to generate the necessary .pub and .pem files

For an example of a more advanced setup, look at the original plugin.

+

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

+
-- cgit v1.2.3