@ -16,25 +16,26 @@ import (
type Config struct {
common . PackerConfig ` mapstructure:",squash" `
BucketName string ` mapstructure:"bucket_name" `
ClientSecretsFile string ` mapstructure:"client_secrets_file" `
DiskSizeGb int64 ` mapstructure:"disk_size" `
ImageName string ` mapstructure:"image_name" `
ImageDescription string ` mapstructure:"image_description" `
InstanceName string ` mapstructure:"instance_name" `
MachineType string ` mapstructure:"machine_type" `
Metadata map [ string ] string ` mapstructure:"metadata" `
Network string ` mapstructure:"network" `
Passphrase string ` mapstructure:"passphrase" `
PrivateKeyFile string ` mapstructure:"private_key_file" `
ProjectId string ` mapstructure:"project_id" `
SourceImage string ` mapstructure:"source_image" `
SSHUsername string ` mapstructure:"ssh_username" `
SSHPort uint ` mapstructure:"ssh_port" `
RawSSHTimeout string ` mapstructure:"ssh_timeout" `
RawStateTimeout string ` mapstructure:"state_timeout" `
Tags [ ] string ` mapstructure:"tags" `
Zone string ` mapstructure:"zone" `
BucketName string ` mapstructure:"bucket_name" `
ClientSecretsFile string ` mapstructure:"client_secrets_file" `
DiskSizeGb int64 ` mapstructure:"disk_size" `
ImageName string ` mapstructure:"image_name" `
ImageDescription string ` mapstructure:"image_description" `
InstanceName string ` mapstructure:"instance_name" `
MachineType string ` mapstructure:"machine_type" `
Metadata map [ string ] string ` mapstructure:"metadata" `
Network string ` mapstructure:"network" `
Passphrase string ` mapstructure:"passphrase" `
PrivateKeyFile string ` mapstructure:"private_key_file" `
ProjectId string ` mapstructure:"project_id" `
SourceImage string ` mapstructure:"source_image" `
SourceImageProjectId string ` mapstructure:"source_image_project_id" `
SSHUsername string ` mapstructure:"ssh_username" `
SSHPort uint ` mapstructure:"ssh_port" `
RawSSHTimeout string ` mapstructure:"ssh_timeout" `
RawStateTimeout string ` mapstructure:"state_timeout" `
Tags [ ] string ` mapstructure:"tags" `
Zone string ` mapstructure:"zone" `
clientSecrets * clientSecrets
instanceName string
@ -103,21 +104,22 @@ func NewConfig(raws ...interface{}) (*Config, []string, error) {
// Process Templates
templates := map [ string ] * string {
"bucket_name" : & c . BucketName ,
"client_secrets_file" : & c . ClientSecretsFile ,
"image_name" : & c . ImageName ,
"image_description" : & c . ImageDescription ,
"instance_name" : & c . InstanceName ,
"machine_type" : & c . MachineType ,
"network" : & c . Network ,
"passphrase" : & c . Passphrase ,
"private_key_file" : & c . PrivateKeyFile ,
"project_id" : & c . ProjectId ,
"source_image" : & c . SourceImage ,
"ssh_username" : & c . SSHUsername ,
"ssh_timeout" : & c . RawSSHTimeout ,
"state_timeout" : & c . RawStateTimeout ,
"zone" : & c . Zone ,
"bucket_name" : & c . BucketName ,
"client_secrets_file" : & c . ClientSecretsFile ,
"image_name" : & c . ImageName ,
"image_description" : & c . ImageDescription ,
"instance_name" : & c . InstanceName ,
"machine_type" : & c . MachineType ,
"network" : & c . Network ,
"passphrase" : & c . Passphrase ,
"private_key_file" : & c . PrivateKeyFile ,
"project_id" : & c . ProjectId ,
"source_image" : & c . SourceImage ,
"source_image_project_id" : & c . SourceImageProjectId ,
"ssh_username" : & c . SSHUsername ,
"ssh_timeout" : & c . RawSSHTimeout ,
"state_timeout" : & c . RawStateTimeout ,
"zone" : & c . Zone ,
}
for n , ptr := range templates {