Commit 758618ec authored by Francisco Lopez's avatar Francisco Lopez

Add ignore_exit_codes key for provisioner puppet-server

parent c8b3dfff
...@@ -38,6 +38,10 @@ type Config struct { ...@@ -38,6 +38,10 @@ type Config struct {
// The directory where files will be uploaded. Packer requires write // The directory where files will be uploaded. Packer requires write
// permissions in this directory. // permissions in this directory.
StagingDir string `mapstructure:"staging_dir"` StagingDir string `mapstructure:"staging_dir"`
// If true, packer will ignore all exit-codes from a puppet run
IgnoreExitCodes bool `mapstructure:"ignore_exit_codes"`
} }
type Provisioner struct { type Provisioner struct {
...@@ -200,7 +204,7 @@ func (p *Provisioner) Provision(ui packer.Ui, comm packer.Communicator) error { ...@@ -200,7 +204,7 @@ func (p *Provisioner) Provision(ui packer.Ui, comm packer.Communicator) error {
return err return err
} }
if cmd.ExitStatus != 0 && cmd.ExitStatus != 2 { if cmd.ExitStatus != 0 && cmd.ExitStatus != 2 && !p.config.IgnoreExitCodes {
return fmt.Errorf("Puppet exited with a non-zero exit status: %d", cmd.ExitStatus) return fmt.Errorf("Puppet exited with a non-zero exit status: %d", cmd.ExitStatus)
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment