Created
May 14, 2015 17:22
-
-
Save flopex/9ec4be0442bed2bcf7bd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- 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