Add ability to skip chef registration

This change allows a user to skip the bootstrap stage for a machine.
This commit is contained in:
Sam Dunne 2016-09-29 14:37:48 +01:00 committed by Sander van Harmelen
parent c307dc9557
commit 628743b24c
2 changed files with 16 additions and 9 deletions

View File

@ -104,6 +104,7 @@ type Provisioner struct {
SecretKey string `mapstructure:"secret_key"`
ServerURL string `mapstructure:"server_url"`
SkipInstall bool `mapstructure:"skip_install"`
SkipRegister bool `mapstructure:"skip_register"`
SSLVerifyMode string `mapstructure:"ssl_verify_mode"`
UserName string `mapstructure:"user_name"`
UserKey string `mapstructure:"user_key"`
@ -213,6 +214,7 @@ func (r *ResourceProvisioner) Apply(
return err
}
if !p.SkipRegister {
if p.FetchChefCertificates {
o.Output("Fetch Chef certificates...")
if err := p.fetchChefCertificates(o, comm); err != nil {
@ -224,6 +226,7 @@ func (r *ResourceProvisioner) Apply(
if err := p.generateClientKey(o, comm); err != nil {
return err
}
}
if p.VaultJSON != "" {
o.Output("Configure Chef vaults...")

View File

@ -115,6 +115,10 @@ The following arguments are supported:
machine. This assumes Chef Client is already installed when you run the `chef`
provisioner.
* `skip_register (boolean)` - (Optional) Skip the registration of Chef Client on the remote
machine. This assumes Chef Client is already registered when you run the `chef`
provisioner.
* `ssl_verify_mode (string)` - (Optional) Use to set the verify mode for Chef Client HTTPS
requests.