Skip to content

Commit

Permalink
Added support for passing arguments to salt-call.
Browse files Browse the repository at this point in the history
  • Loading branch information
siepkes committed Nov 11, 2016
1 parent 671f155 commit 200aa74
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
8 changes: 8 additions & 0 deletions provisioner/salt-masterless/provisioner.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ type Config struct {
// Set the logging level for the salt-call run
LogLevel string `mapstructure:"log_level"`

// Arguments to pass to salt-call
SaltCallArgs string `mapstructure:"salt_call_args"`

// Command line args passed onto salt-call
CmdArgs string ""

Expand Down Expand Up @@ -143,6 +146,11 @@ func (p *Provisioner) Prepare(raws ...interface{}) error {
cmd_args.WriteString(p.config.LogLevel)
}

if p.config.SaltCallArgs != "" {
cmd_args.WriteString(" ")
cmd_args.WriteString(p.config.SaltCallArgs)
}

p.config.CmdArgs = cmd_args.String()

if errs != nil && len(errs.Errors) > 0 {
Expand Down
5 changes: 5 additions & 0 deletions website/source/docs/provisioners/salt-masterless.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,8 @@ Optional:
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
[salt-call](https://docs.saltstack.com/ref/cli/salt-call.html) documentation for more
information. By default no additional arguments (besides the ones Packer generates)
are passed to `salt-call`.

0 comments on commit 200aa74

Please sign in to comment.