Merge pull request #4158 from siepkes/custom_stalt_call_args

Added support for passing arguments to salt-call.
pull/4175/head
Rickard von Essen 10 years ago committed by GitHub
commit 992e1284a5

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

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

Loading…
Cancel
Save