Skip to content

Instantly share code, notes, and snippets.

@flopex
Created May 14, 2015 17:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save flopex/9ec4be0442bed2bcf7bd to your computer and use it in GitHub Desktop.
Save flopex/9ec4be0442bed2bcf7bd to your computer and use it in GitHub Desktop.
--- a/provisioner/puppet-server/provisioner.go
+++ b/provisioner/puppet-server/provisioner.go
@@ -38,6 +38,9 @@ type Config struct {
// The directory where files will be uploaded. Packer requires write
// permissions in this directory.
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 {
@@ -200,7 +203,7 @@ func (p *Provisioner) Provision(ui packer.Ui, comm packer.Communicator) error {
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)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment