This commit is contained in:
Chris Bednarski 2016-04-29 19:25:41 -07:00
commit 3b6435ec8d
1 changed files with 8 additions and 7 deletions

View File

@ -235,6 +235,14 @@ func (p *Provisioner) Provision(ui packer.Ui, comm packer.Communicator) error {
return fmt.Errorf("Error uploading encrypted data bag secret: %s", err) return fmt.Errorf("Error uploading encrypted data bag secret: %s", err)
} }
} }
if p.config.ValidationKeyPath != "" {
remoteValidationKeyPath = fmt.Sprintf("%s/validation.pem", p.config.StagingDir)
if err := p.uploadFile(ui, comm, remoteValidationKeyPath, p.config.ValidationKeyPath); err != nil {
return fmt.Errorf("Error copying validation key: %s", err)
}
}
configPath, err := p.createConfig( configPath, err := p.createConfig(
ui, ui,
comm, comm,
@ -250,13 +258,6 @@ func (p *Provisioner) Provision(ui packer.Ui, comm packer.Communicator) error {
return fmt.Errorf("Error creating Chef config file: %s", err) return fmt.Errorf("Error creating Chef config file: %s", err)
} }
if p.config.ValidationKeyPath != "" {
remoteValidationKeyPath = fmt.Sprintf("%s/validation.pem", p.config.StagingDir)
if err := p.uploadFile(ui, comm, remoteValidationKeyPath, p.config.ValidationKeyPath); err != nil {
return fmt.Errorf("Error copying validation key: %s", err)
}
}
jsonPath, err := p.createJson(ui, comm) jsonPath, err := p.createJson(ui, comm)
if err != nil { if err != nil {
return fmt.Errorf("Error creating JSON attributes: %s", err) return fmt.Errorf("Error creating JSON attributes: %s", err)