chefclient

package
v1.7.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 5, 2021 License: MPL-2.0 Imports: 17 Imported by: 0

Documentation

Overview

This package implements a provisioner for Packer that uses Chef to provision the remote machine, specifically with chef-client (that is, with a Chef server).

Index

Constants

This section is empty.

Variables

View Source
var DefaultConfigTemplate = `` /* 863-byte string literal not displayed */
View Source
var DefaultKnifeTemplate = `` /* 293-byte string literal not displayed */

Functions

This section is empty.

Types

type Config

type Config struct {
	common.PackerConfig `mapstructure:",squash"`

	Json map[string]interface{}

	ChefEnvironment            string   `mapstructure:"chef_environment"`
	ChefLicense                string   `mapstructure:"chef_license"`
	ClientKey                  string   `mapstructure:"client_key"`
	ConfigTemplate             string   `mapstructure:"config_template"`
	ElevatedUser               string   `mapstructure:"elevated_user"`
	ElevatedPassword           string   `mapstructure:"elevated_password"`
	EncryptedDataBagSecretPath string   `mapstructure:"encrypted_data_bag_secret_path"`
	ExecuteCommand             string   `mapstructure:"execute_command"`
	GuestOSType                string   `mapstructure:"guest_os_type"`
	InstallCommand             string   `mapstructure:"install_command"`
	KnifeCommand               string   `mapstructure:"knife_command"`
	NodeName                   string   `mapstructure:"node_name"`
	PolicyGroup                string   `mapstructure:"policy_group"`
	PolicyName                 string   `mapstructure:"policy_name"`
	PreventSudo                bool     `mapstructure:"prevent_sudo"`
	RunList                    []string `mapstructure:"run_list"`
	ServerUrl                  string   `mapstructure:"server_url"`
	SkipCleanClient            bool     `mapstructure:"skip_clean_client"`
	SkipCleanNode              bool     `mapstructure:"skip_clean_node"`
	SkipCleanStagingDirectory  bool     `mapstructure:"skip_clean_staging_directory"`
	SkipInstall                bool     `mapstructure:"skip_install"`
	SslVerifyMode              string   `mapstructure:"ssl_verify_mode"`
	TrustedCertsDir            string   `mapstructure:"trusted_certs_dir"`
	StagingDir                 string   `mapstructure:"staging_directory"`
	ValidationClientName       string   `mapstructure:"validation_client_name"`
	ValidationKeyPath          string   `mapstructure:"validation_key_path"`
	Version                    string   `mapstructure:"version"`
	// contains filtered or unexported fields
}

func (*Config) FlatMapstructure added in v1.4.5

func (*Config) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec }

FlatMapstructure returns a new FlatConfig. FlatConfig is an auto-generated flat version of Config. Where the contents a fields with a `mapstructure:,squash` tag are bubbled up.

type ConfigTemplate

type ConfigTemplate struct {
	ChefEnvironment            string
	ChefLicense                string
	ClientKey                  string
	EncryptedDataBagSecretPath string
	NodeName                   string
	PolicyGroup                string
	PolicyName                 string
	ServerUrl                  string
	SslVerifyMode              string
	TrustedCertsDir            string
	ValidationClientName       string
	ValidationKeyPath          string
}

type ExecuteTemplate

type ExecuteTemplate struct {
	ConfigPath string
	JsonPath   string
	Sudo       bool
}

type FlatConfig added in v1.4.5

type FlatConfig struct {
	PackerBuildName            *string                `mapstructure:"packer_build_name" cty:"packer_build_name" hcl:"packer_build_name"`
	PackerBuilderType          *string                `mapstructure:"packer_builder_type" cty:"packer_builder_type" hcl:"packer_builder_type"`
	PackerCoreVersion          *string                `mapstructure:"packer_core_version" cty:"packer_core_version" hcl:"packer_core_version"`
	PackerDebug                *bool                  `mapstructure:"packer_debug" cty:"packer_debug" hcl:"packer_debug"`
	PackerForce                *bool                  `mapstructure:"packer_force" cty:"packer_force" hcl:"packer_force"`
	PackerOnError              *string                `mapstructure:"packer_on_error" cty:"packer_on_error" hcl:"packer_on_error"`
	PackerUserVars             map[string]string      `mapstructure:"packer_user_variables" cty:"packer_user_variables" hcl:"packer_user_variables"`
	PackerSensitiveVars        []string               `mapstructure:"packer_sensitive_variables" cty:"packer_sensitive_variables" hcl:"packer_sensitive_variables"`
	Json                       map[string]interface{} `cty:"json" hcl:"json"`
	ChefEnvironment            *string                `mapstructure:"chef_environment" cty:"chef_environment" hcl:"chef_environment"`
	ChefLicense                *string                `mapstructure:"chef_license" cty:"chef_license" hcl:"chef_license"`
	ClientKey                  *string                `mapstructure:"client_key" cty:"client_key" hcl:"client_key"`
	ConfigTemplate             *string                `mapstructure:"config_template" cty:"config_template" hcl:"config_template"`
	ElevatedUser               *string                `mapstructure:"elevated_user" cty:"elevated_user" hcl:"elevated_user"`
	ElevatedPassword           *string                `mapstructure:"elevated_password" cty:"elevated_password" hcl:"elevated_password"`
	EncryptedDataBagSecretPath *string                `mapstructure:"encrypted_data_bag_secret_path" cty:"encrypted_data_bag_secret_path" hcl:"encrypted_data_bag_secret_path"`
	ExecuteCommand             *string                `mapstructure:"execute_command" cty:"execute_command" hcl:"execute_command"`
	GuestOSType                *string                `mapstructure:"guest_os_type" cty:"guest_os_type" hcl:"guest_os_type"`
	InstallCommand             *string                `mapstructure:"install_command" cty:"install_command" hcl:"install_command"`
	KnifeCommand               *string                `mapstructure:"knife_command" cty:"knife_command" hcl:"knife_command"`
	NodeName                   *string                `mapstructure:"node_name" cty:"node_name" hcl:"node_name"`
	PolicyGroup                *string                `mapstructure:"policy_group" cty:"policy_group" hcl:"policy_group"`
	PolicyName                 *string                `mapstructure:"policy_name" cty:"policy_name" hcl:"policy_name"`
	PreventSudo                *bool                  `mapstructure:"prevent_sudo" cty:"prevent_sudo" hcl:"prevent_sudo"`
	RunList                    []string               `mapstructure:"run_list" cty:"run_list" hcl:"run_list"`
	ServerUrl                  *string                `mapstructure:"server_url" cty:"server_url" hcl:"server_url"`
	SkipCleanClient            *bool                  `mapstructure:"skip_clean_client" cty:"skip_clean_client" hcl:"skip_clean_client"`
	SkipCleanNode              *bool                  `mapstructure:"skip_clean_node" cty:"skip_clean_node" hcl:"skip_clean_node"`
	SkipCleanStagingDirectory  *bool                  `mapstructure:"skip_clean_staging_directory" cty:"skip_clean_staging_directory" hcl:"skip_clean_staging_directory"`
	SkipInstall                *bool                  `mapstructure:"skip_install" cty:"skip_install" hcl:"skip_install"`
	SslVerifyMode              *string                `mapstructure:"ssl_verify_mode" cty:"ssl_verify_mode" hcl:"ssl_verify_mode"`
	TrustedCertsDir            *string                `mapstructure:"trusted_certs_dir" cty:"trusted_certs_dir" hcl:"trusted_certs_dir"`
	StagingDir                 *string                `mapstructure:"staging_directory" cty:"staging_directory" hcl:"staging_directory"`
	ValidationClientName       *string                `mapstructure:"validation_client_name" cty:"validation_client_name" hcl:"validation_client_name"`
	ValidationKeyPath          *string                `mapstructure:"validation_key_path" cty:"validation_key_path" hcl:"validation_key_path"`
	Version                    *string                `mapstructure:"version" cty:"version" hcl:"version"`
}

FlatConfig is an auto-generated flat version of Config. Where the contents of a field with a `mapstructure:,squash` tag are bubbled up.

func (*FlatConfig) HCL2Spec added in v1.4.5

func (*FlatConfig) HCL2Spec() map[string]hcldec.Spec

HCL2Spec returns the hcl spec of a Config. This spec is used by HCL to read the fields of Config. The decoded values from this spec will then be applied to a FlatConfig.

type InstallChefTemplate

type InstallChefTemplate struct {
	Sudo    bool
	Version string
}

type KnifeTemplate added in v0.11.0

type KnifeTemplate struct {
	Sudo  bool
	Flags string
	Args  string
}

type Provisioner

type Provisioner struct {
	// contains filtered or unexported fields
}

func (*Provisioner) Communicator added in v1.3.4

func (p *Provisioner) Communicator() packersdk.Communicator

func (*Provisioner) ConfigSpec added in v1.5.0

func (p *Provisioner) ConfigSpec() hcldec.ObjectSpec

func (*Provisioner) ElevatedPassword added in v1.3.4

func (p *Provisioner) ElevatedPassword() string

func (*Provisioner) ElevatedUser added in v1.3.4

func (p *Provisioner) ElevatedUser() string

func (*Provisioner) Prepare

func (p *Provisioner) Prepare(raws ...interface{}) error

func (*Provisioner) Provision

func (p *Provisioner) Provision(ctx context.Context, ui packersdk.Ui, comm packersdk.Communicator, generatedData map[string]interface{}) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL