2020-03-18 18:46:47 -04:00
|
|
|
---
|
|
|
|
description: |
|
|
|
|
The salt-masterless Packer provisioner provisions machines built by Packer
|
|
|
|
using Salt states, without connecting to a Salt master.
|
|
|
|
page_title: Salt Masterless - Provisioners
|
2020-04-02 19:39:47 -04:00
|
|
|
sidebar_title: Salt Masterless
|
2020-03-18 18:46:47 -04:00
|
|
|
---
|
|
|
|
|
|
|
|
# Salt Masterless Provisioner
|
|
|
|
|
2020-07-08 07:17:13 -04:00
|
|
|
@include 'provisioners/unmaintained-plugin.mdx'
|
|
|
|
|
2020-03-18 18:46:47 -04:00
|
|
|
Type: `salt-masterless`
|
|
|
|
|
|
|
|
The `salt-masterless` Packer provisioner provisions machines built by Packer
|
|
|
|
using [Salt](http://saltstack.com/) states, without connecting to a Salt
|
|
|
|
master.
|
|
|
|
|
|
|
|
## Basic Example
|
|
|
|
|
|
|
|
The example below is fully functional.
|
|
|
|
|
2020-08-26 13:17:59 -04:00
|
|
|
<Tabs>
|
|
|
|
<Tab heading="JSON">
|
|
|
|
|
2020-03-18 18:46:47 -04:00
|
|
|
```json
|
|
|
|
{
|
|
|
|
"type": "salt-masterless",
|
|
|
|
"local_state_tree": "/Users/me/salt"
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
2020-08-26 13:17:59 -04:00
|
|
|
</Tab>
|
|
|
|
<Tab heading="HCL2">
|
|
|
|
|
|
|
|
```hcl
|
|
|
|
provisioner "salt-masterless" {
|
|
|
|
local_state_tree = "/Users/me/salt"
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
</Tab>
|
|
|
|
</Tabs>
|
|
|
|
|
2020-03-18 18:46:47 -04:00
|
|
|
## Configuration Reference
|
|
|
|
|
|
|
|
The reference of available configuration options is listed below. The only
|
|
|
|
required element is "local_state_tree".
|
|
|
|
|
|
|
|
Required:
|
|
|
|
|
|
|
|
- `local_state_tree` (string) - The path to your local [state
|
2021-02-05 16:46:53 -05:00
|
|
|
tree](http://docs.saltproject.io/en/latest/ref/states/highstate.html#the-salt-state-tree).
|
2020-03-18 18:46:47 -04:00
|
|
|
This will be uploaded to the `remote_state_tree` on the remote.
|
|
|
|
|
|
|
|
Optional:
|
|
|
|
|
|
|
|
- `bootstrap_args` (string) - Arguments to send to the bootstrap script.
|
|
|
|
Usage is somewhat documented on
|
|
|
|
[github](https://github.com/saltstack/salt-bootstrap), but the [script
|
|
|
|
itself](https://github.com/saltstack/salt-bootstrap/blob/develop/bootstrap-salt.sh)
|
|
|
|
has more detailed usage instructions. By default, no arguments are sent to
|
|
|
|
the script.
|
|
|
|
|
|
|
|
- `disable_sudo` (boolean) - By default, the bootstrap install command is
|
|
|
|
prefixed with `sudo`. When using a Docker builder, you will likely want to
|
|
|
|
pass `true` since `sudo` is often not pre-installed.
|
|
|
|
|
|
|
|
- `remote_pillar_roots` (string) - The path to your remote [pillar
|
2021-02-05 16:46:53 -05:00
|
|
|
roots](http://docs.saltproject.io/en/latest/ref/configuration/master.html#pillar-configuration).
|
2020-03-18 18:46:47 -04:00
|
|
|
default: `/srv/pillar`. This option cannot be used with `minion_config`.
|
|
|
|
|
|
|
|
- `remote_state_tree` (string) - The path to your remote [state
|
2021-02-05 16:46:53 -05:00
|
|
|
tree](http://docs.saltproject.io/en/latest/ref/states/highstate.html#the-salt-state-tree).
|
2020-03-18 18:46:47 -04:00
|
|
|
default: `/srv/salt`. This option cannot be used with `minion_config`.
|
|
|
|
|
|
|
|
- `local_pillar_roots` (string) - The path to your local [pillar
|
2021-02-05 16:46:53 -05:00
|
|
|
roots](http://docs.saltproject.io/en/latest/ref/configuration/master.html#pillar-configuration).
|
2020-03-18 18:46:47 -04:00
|
|
|
This will be uploaded to the `remote_pillar_roots` on the remote.
|
|
|
|
|
|
|
|
- `custom_state` (string) - A state to be run instead of `state.highstate`.
|
|
|
|
Defaults to `state.highstate` if unspecified.
|
|
|
|
|
|
|
|
- `minion_config` (string) - The path to your local [minion config
|
2021-02-05 16:46:53 -05:00
|
|
|
file](http://docs.saltproject.io/en/latest/ref/configuration/minion.html). This will
|
2020-03-18 18:46:47 -04:00
|
|
|
be uploaded to the `/etc/salt` on the remote. This option overrides the
|
|
|
|
`remote_state_tree` or `remote_pillar_roots` options.
|
|
|
|
|
|
|
|
- `grains_file` (string) - The path to your local [grains
|
2021-02-05 16:46:53 -05:00
|
|
|
file](https://docs.saltproject.io/en/latest/topics/grains). This will be
|
2020-03-18 18:46:47 -04:00
|
|
|
uploaded to `/etc/salt/grains` on the remote.
|
|
|
|
|
|
|
|
- `skip_bootstrap` (boolean) - By default the salt provisioner runs [salt
|
|
|
|
bootstrap](https://github.com/saltstack/salt-bootstrap) to install salt.
|
|
|
|
Set this to true to skip this step.
|
|
|
|
|
|
|
|
- `temp_config_dir` (string) - Where your local state tree will be copied
|
|
|
|
before moving to the `/srv/salt` directory. Default is `/tmp/salt`.
|
|
|
|
|
|
|
|
- `no_exit_on_failure` (boolean) - Packer will exit if the `salt-call`
|
|
|
|
command fails. Set this option to true to ignore Salt failures.
|
|
|
|
|
|
|
|
- `log_level` (string) - Set the logging level for the `salt-call` run.
|
|
|
|
|
|
|
|
- `salt_call_args` (string) - Additional arguments to pass directly to
|
|
|
|
`salt-call`. See
|
2021-02-05 16:46:53 -05:00
|
|
|
[salt-call](https://docs.saltproject.io/en/latest/ref/cli/salt-call.html)
|
2020-03-18 18:46:47 -04:00
|
|
|
documentation for more information. By default no additional arguments
|
|
|
|
(besides the ones Packer generates) are passed to `salt-call`.
|
|
|
|
|
|
|
|
- `salt_bin_dir` (string) - Path to the `salt-call` executable. Useful if it
|
|
|
|
is not on the PATH.
|
|
|
|
|
|
|
|
- `guest_os_type` (string) - The target guest OS type, either "unix" or
|
|
|
|
"windows".
|
|
|
|
|
2020-08-07 18:38:41 -04:00
|
|
|
- `formulas` (array of strings) - An array of git source formulas to be downloaded to the local
|
2020-08-26 13:17:59 -04:00
|
|
|
state tree prior to moving to the remote state tree. Note: `//directory` must be included in
|
2020-08-07 18:38:41 -04:00
|
|
|
the URL to download the appropriate formula directory. Example:
|
|
|
|
`git::https://github.com/saltstack-formulas/vault-formula.git//vault?ref=v1.2.3`
|
|
|
|
|
2020-03-23 20:02:12 -04:00
|
|
|
@include 'provisioners/common-config.mdx'
|