Merge pull request #4158 from siepkes/custom_stalt_call_args

Added support for passing arguments to salt-call.
This commit is contained in:
Rickard von Essen 2016-11-15 21:23:13 +01:00 committed by GitHub
commit 992e1284a5
2 changed files with 13 additions and 0 deletions

View File

@ -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 ""
@ -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 {

View File

@ -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`.