From 41edd09d3c0e8e0df054535d1202ca8602cccd0e Mon Sep 17 00:00:00 2001 From: Moss Date: Wed, 1 Jul 2020 14:32:26 +0200 Subject: [PATCH 01/38] undocument temporary_key_pair_name and ssh_private_key_file --- builder/alicloud/ecs/builder.hcl2spec.go | 8 ++++---- builder/amazon/ebs/builder.hcl2spec.go | 6 +++--- builder/amazon/ebssurrogate/builder.hcl2spec.go | 6 +++--- builder/amazon/ebsvolume/builder.hcl2spec.go | 6 +++--- builder/amazon/instance/builder.hcl2spec.go | 6 +++--- builder/azure/arm/config.hcl2spec.go | 8 ++++---- builder/azure/dtl/config.hcl2spec.go | 8 ++++---- builder/cloudstack/config.hcl2spec.go | 8 ++++---- builder/digitalocean/config.hcl2spec.go | 8 ++++---- builder/docker/config.hcl2spec.go | 8 ++++---- builder/googlecompute/config.hcl2spec.go | 8 ++++---- builder/hcloud/config.hcl2spec.go | 8 ++++---- builder/hyperone/config.hcl2spec.go | 8 ++++---- builder/hyperv/iso/builder.hcl2spec.go | 8 ++++---- builder/hyperv/vmcx/builder.hcl2spec.go | 8 ++++---- builder/jdcloud/common.hcl2spec.go | 8 ++++---- builder/linode/config.hcl2spec.go | 8 ++++---- builder/ncloud/config.hcl2spec.go | 8 ++++---- builder/null/config.hcl2spec.go | 8 ++++---- builder/oneandone/config.hcl2spec.go | 8 ++++---- builder/openstack/builder.hcl2spec.go | 8 ++++---- builder/oracle/classic/builder.hcl2spec.go | 8 ++++---- builder/oracle/oci/config.hcl2spec.go | 8 ++++---- builder/osc/bsu/builder.hcl2spec.go | 6 +++--- builder/osc/bsusurrogate/builder.hcl2spec.go | 6 +++--- builder/osc/bsuvolume/builder.hcl2spec.go | 6 +++--- builder/parallels/iso/builder.hcl2spec.go | 8 ++++---- builder/parallels/pvm/config.hcl2spec.go | 8 ++++---- builder/profitbricks/config.hcl2spec.go | 8 ++++---- builder/proxmox/config.hcl2spec.go | 8 ++++---- builder/qemu/builder.hcl2spec.go | 8 ++++---- builder/scaleway/config.hcl2spec.go | 8 ++++---- builder/tencentcloud/cvm/builder.hcl2spec.go | 8 ++++---- builder/triton/config.hcl2spec.go | 8 ++++---- builder/ucloud/uhost/builder.hcl2spec.go | 8 ++++---- builder/vagrant/builder.hcl2spec.go | 8 ++++---- builder/virtualbox/iso/builder.hcl2spec.go | 8 ++++---- builder/virtualbox/ovf/config.hcl2spec.go | 8 ++++---- builder/virtualbox/vm/config.hcl2spec.go | 8 ++++---- builder/vmware/iso/config.hcl2spec.go | 8 ++++---- builder/vmware/vmx/config.hcl2spec.go | 8 ++++---- builder/vsphere/clone/config.hcl2spec.go | 8 ++++---- builder/vsphere/iso/config.hcl2spec.go | 8 ++++---- builder/yandex/config.hcl2spec.go | 8 ++++---- helper/communicator/config.go | 8 ++++---- helper/communicator/config.hcl2spec.go | 16 ++++++++-------- .../alicloud-import/post-processor.hcl2spec.go | 8 ++++---- website/pages/docs/builders/amazon/ebs.mdx | 2 ++ .../pages/docs/builders/amazon/ebssurrogate.mdx | 2 ++ website/pages/docs/builders/amazon/ebsvolume.mdx | 2 ++ website/pages/docs/builders/amazon/instance.mdx | 2 ++ website/pages/docs/builders/openstack.mdx | 2 ++ website/pages/docs/builders/virtualbox/iso.mdx | 2 ++ website/pages/docs/builders/virtualbox/ovf.mdx | 2 ++ website/pages/docs/builders/virtualbox/vm.mdx | 2 ++ .../communicator/SSH-Key-Pair-not-required.mdx | 8 ++++++++ .../helper/communicator/SSH-not-required.mdx | 13 +------------ 57 files changed, 210 insertions(+), 197 deletions(-) create mode 100644 website/pages/partials/helper/communicator/SSH-Key-Pair-not-required.mdx diff --git a/builder/alicloud/ecs/builder.hcl2spec.go b/builder/alicloud/ecs/builder.hcl2spec.go index 6f970fe21..bead44c15 100644 --- a/builder/alicloud/ecs/builder.hcl2spec.go +++ b/builder/alicloud/ecs/builder.hcl2spec.go @@ -106,10 +106,10 @@ type FlatConfig struct { SSHUsername *string `mapstructure:"ssh_username" cty:"ssh_username" hcl:"ssh_username"` SSHPassword *string `mapstructure:"ssh_password" cty:"ssh_password" hcl:"ssh_password"` SSHKeyPairName *string `mapstructure:"ssh_keypair_name" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` - SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` + SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" undocumented:"true" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` SSHCiphers []string `mapstructure:"ssh_ciphers" cty:"ssh_ciphers" hcl:"ssh_ciphers"` SSHClearAuthorizedKeys *bool `mapstructure:"ssh_clear_authorized_keys" cty:"ssh_clear_authorized_keys" hcl:"ssh_clear_authorized_keys"` - SSHPrivateKeyFile *string `mapstructure:"ssh_private_key_file" cty:"ssh_private_key_file" hcl:"ssh_private_key_file"` + SSHPrivateKeyFile *string `mapstructure:"ssh_private_key_file" undocumented:"true" cty:"ssh_private_key_file" hcl:"ssh_private_key_file"` SSHPty *bool `mapstructure:"ssh_pty" cty:"ssh_pty" hcl:"ssh_pty"` SSHTimeout *string `mapstructure:"ssh_timeout" cty:"ssh_timeout" hcl:"ssh_timeout"` SSHWaitTimeout *string `mapstructure:"ssh_wait_timeout" undocumented:"true" cty:"ssh_wait_timeout" hcl:"ssh_wait_timeout"` @@ -132,8 +132,8 @@ type FlatConfig struct { SSHReadWriteTimeout *string `mapstructure:"ssh_read_write_timeout" cty:"ssh_read_write_timeout" hcl:"ssh_read_write_timeout"` SSHRemoteTunnels []string `mapstructure:"ssh_remote_tunnels" cty:"ssh_remote_tunnels" hcl:"ssh_remote_tunnels"` SSHLocalTunnels []string `mapstructure:"ssh_local_tunnels" cty:"ssh_local_tunnels" hcl:"ssh_local_tunnels"` - SSHPublicKey []byte `mapstructure:"ssh_public_key" cty:"ssh_public_key" hcl:"ssh_public_key"` - SSHPrivateKey []byte `mapstructure:"ssh_private_key" cty:"ssh_private_key" hcl:"ssh_private_key"` + SSHPublicKey []byte `mapstructure:"ssh_public_key" undocumented:"true" cty:"ssh_public_key" hcl:"ssh_public_key"` + SSHPrivateKey []byte `mapstructure:"ssh_private_key" undocumented:"true" cty:"ssh_private_key" hcl:"ssh_private_key"` WinRMUser *string `mapstructure:"winrm_username" cty:"winrm_username" hcl:"winrm_username"` WinRMPassword *string `mapstructure:"winrm_password" cty:"winrm_password" hcl:"winrm_password"` WinRMHost *string `mapstructure:"winrm_host" cty:"winrm_host" hcl:"winrm_host"` diff --git a/builder/amazon/ebs/builder.hcl2spec.go b/builder/amazon/ebs/builder.hcl2spec.go index d68eae53e..04100036e 100644 --- a/builder/amazon/ebs/builder.hcl2spec.go +++ b/builder/amazon/ebs/builder.hcl2spec.go @@ -93,7 +93,7 @@ type FlatConfig struct { SSHKeyPairName *string `mapstructure:"ssh_keypair_name" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` SSHCiphers []string `mapstructure:"ssh_ciphers" cty:"ssh_ciphers" hcl:"ssh_ciphers"` SSHClearAuthorizedKeys *bool `mapstructure:"ssh_clear_authorized_keys" cty:"ssh_clear_authorized_keys" hcl:"ssh_clear_authorized_keys"` - SSHPrivateKeyFile *string `mapstructure:"ssh_private_key_file" cty:"ssh_private_key_file" hcl:"ssh_private_key_file"` + SSHPrivateKeyFile *string `mapstructure:"ssh_private_key_file" undocumented:"true" cty:"ssh_private_key_file" hcl:"ssh_private_key_file"` SSHPty *bool `mapstructure:"ssh_pty" cty:"ssh_pty" hcl:"ssh_pty"` SSHTimeout *string `mapstructure:"ssh_timeout" cty:"ssh_timeout" hcl:"ssh_timeout"` SSHWaitTimeout *string `mapstructure:"ssh_wait_timeout" undocumented:"true" cty:"ssh_wait_timeout" hcl:"ssh_wait_timeout"` @@ -116,8 +116,8 @@ type FlatConfig struct { SSHReadWriteTimeout *string `mapstructure:"ssh_read_write_timeout" cty:"ssh_read_write_timeout" hcl:"ssh_read_write_timeout"` SSHRemoteTunnels []string `mapstructure:"ssh_remote_tunnels" cty:"ssh_remote_tunnels" hcl:"ssh_remote_tunnels"` SSHLocalTunnels []string `mapstructure:"ssh_local_tunnels" cty:"ssh_local_tunnels" hcl:"ssh_local_tunnels"` - SSHPublicKey []byte `mapstructure:"ssh_public_key" cty:"ssh_public_key" hcl:"ssh_public_key"` - SSHPrivateKey []byte `mapstructure:"ssh_private_key" cty:"ssh_private_key" hcl:"ssh_private_key"` + SSHPublicKey []byte `mapstructure:"ssh_public_key" undocumented:"true" cty:"ssh_public_key" hcl:"ssh_public_key"` + SSHPrivateKey []byte `mapstructure:"ssh_private_key" undocumented:"true" cty:"ssh_private_key" hcl:"ssh_private_key"` WinRMUser *string `mapstructure:"winrm_username" cty:"winrm_username" hcl:"winrm_username"` WinRMPassword *string `mapstructure:"winrm_password" cty:"winrm_password" hcl:"winrm_password"` WinRMHost *string `mapstructure:"winrm_host" cty:"winrm_host" hcl:"winrm_host"` diff --git a/builder/amazon/ebssurrogate/builder.hcl2spec.go b/builder/amazon/ebssurrogate/builder.hcl2spec.go index 6e678a4a3..343c63262 100644 --- a/builder/amazon/ebssurrogate/builder.hcl2spec.go +++ b/builder/amazon/ebssurrogate/builder.hcl2spec.go @@ -115,7 +115,7 @@ type FlatConfig struct { SSHKeyPairName *string `mapstructure:"ssh_keypair_name" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` SSHCiphers []string `mapstructure:"ssh_ciphers" cty:"ssh_ciphers" hcl:"ssh_ciphers"` SSHClearAuthorizedKeys *bool `mapstructure:"ssh_clear_authorized_keys" cty:"ssh_clear_authorized_keys" hcl:"ssh_clear_authorized_keys"` - SSHPrivateKeyFile *string `mapstructure:"ssh_private_key_file" cty:"ssh_private_key_file" hcl:"ssh_private_key_file"` + SSHPrivateKeyFile *string `mapstructure:"ssh_private_key_file" undocumented:"true" cty:"ssh_private_key_file" hcl:"ssh_private_key_file"` SSHPty *bool `mapstructure:"ssh_pty" cty:"ssh_pty" hcl:"ssh_pty"` SSHTimeout *string `mapstructure:"ssh_timeout" cty:"ssh_timeout" hcl:"ssh_timeout"` SSHWaitTimeout *string `mapstructure:"ssh_wait_timeout" undocumented:"true" cty:"ssh_wait_timeout" hcl:"ssh_wait_timeout"` @@ -138,8 +138,8 @@ type FlatConfig struct { SSHReadWriteTimeout *string `mapstructure:"ssh_read_write_timeout" cty:"ssh_read_write_timeout" hcl:"ssh_read_write_timeout"` SSHRemoteTunnels []string `mapstructure:"ssh_remote_tunnels" cty:"ssh_remote_tunnels" hcl:"ssh_remote_tunnels"` SSHLocalTunnels []string `mapstructure:"ssh_local_tunnels" cty:"ssh_local_tunnels" hcl:"ssh_local_tunnels"` - SSHPublicKey []byte `mapstructure:"ssh_public_key" cty:"ssh_public_key" hcl:"ssh_public_key"` - SSHPrivateKey []byte `mapstructure:"ssh_private_key" cty:"ssh_private_key" hcl:"ssh_private_key"` + SSHPublicKey []byte `mapstructure:"ssh_public_key" undocumented:"true" cty:"ssh_public_key" hcl:"ssh_public_key"` + SSHPrivateKey []byte `mapstructure:"ssh_private_key" undocumented:"true" cty:"ssh_private_key" hcl:"ssh_private_key"` WinRMUser *string `mapstructure:"winrm_username" cty:"winrm_username" hcl:"winrm_username"` WinRMPassword *string `mapstructure:"winrm_password" cty:"winrm_password" hcl:"winrm_password"` WinRMHost *string `mapstructure:"winrm_host" cty:"winrm_host" hcl:"winrm_host"` diff --git a/builder/amazon/ebsvolume/builder.hcl2spec.go b/builder/amazon/ebsvolume/builder.hcl2spec.go index 0212f86ca..ebfabf7d7 100644 --- a/builder/amazon/ebsvolume/builder.hcl2spec.go +++ b/builder/amazon/ebsvolume/builder.hcl2spec.go @@ -117,7 +117,7 @@ type FlatConfig struct { SSHKeyPairName *string `mapstructure:"ssh_keypair_name" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` SSHCiphers []string `mapstructure:"ssh_ciphers" cty:"ssh_ciphers" hcl:"ssh_ciphers"` SSHClearAuthorizedKeys *bool `mapstructure:"ssh_clear_authorized_keys" cty:"ssh_clear_authorized_keys" hcl:"ssh_clear_authorized_keys"` - SSHPrivateKeyFile *string `mapstructure:"ssh_private_key_file" cty:"ssh_private_key_file" hcl:"ssh_private_key_file"` + SSHPrivateKeyFile *string `mapstructure:"ssh_private_key_file" undocumented:"true" cty:"ssh_private_key_file" hcl:"ssh_private_key_file"` SSHPty *bool `mapstructure:"ssh_pty" cty:"ssh_pty" hcl:"ssh_pty"` SSHTimeout *string `mapstructure:"ssh_timeout" cty:"ssh_timeout" hcl:"ssh_timeout"` SSHWaitTimeout *string `mapstructure:"ssh_wait_timeout" undocumented:"true" cty:"ssh_wait_timeout" hcl:"ssh_wait_timeout"` @@ -140,8 +140,8 @@ type FlatConfig struct { SSHReadWriteTimeout *string `mapstructure:"ssh_read_write_timeout" cty:"ssh_read_write_timeout" hcl:"ssh_read_write_timeout"` SSHRemoteTunnels []string `mapstructure:"ssh_remote_tunnels" cty:"ssh_remote_tunnels" hcl:"ssh_remote_tunnels"` SSHLocalTunnels []string `mapstructure:"ssh_local_tunnels" cty:"ssh_local_tunnels" hcl:"ssh_local_tunnels"` - SSHPublicKey []byte `mapstructure:"ssh_public_key" cty:"ssh_public_key" hcl:"ssh_public_key"` - SSHPrivateKey []byte `mapstructure:"ssh_private_key" cty:"ssh_private_key" hcl:"ssh_private_key"` + SSHPublicKey []byte `mapstructure:"ssh_public_key" undocumented:"true" cty:"ssh_public_key" hcl:"ssh_public_key"` + SSHPrivateKey []byte `mapstructure:"ssh_private_key" undocumented:"true" cty:"ssh_private_key" hcl:"ssh_private_key"` WinRMUser *string `mapstructure:"winrm_username" cty:"winrm_username" hcl:"winrm_username"` WinRMPassword *string `mapstructure:"winrm_password" cty:"winrm_password" hcl:"winrm_password"` WinRMHost *string `mapstructure:"winrm_host" cty:"winrm_host" hcl:"winrm_host"` diff --git a/builder/amazon/instance/builder.hcl2spec.go b/builder/amazon/instance/builder.hcl2spec.go index cf70e5909..c558efc17 100644 --- a/builder/amazon/instance/builder.hcl2spec.go +++ b/builder/amazon/instance/builder.hcl2spec.go @@ -93,7 +93,7 @@ type FlatConfig struct { SSHKeyPairName *string `mapstructure:"ssh_keypair_name" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` SSHCiphers []string `mapstructure:"ssh_ciphers" cty:"ssh_ciphers" hcl:"ssh_ciphers"` SSHClearAuthorizedKeys *bool `mapstructure:"ssh_clear_authorized_keys" cty:"ssh_clear_authorized_keys" hcl:"ssh_clear_authorized_keys"` - SSHPrivateKeyFile *string `mapstructure:"ssh_private_key_file" cty:"ssh_private_key_file" hcl:"ssh_private_key_file"` + SSHPrivateKeyFile *string `mapstructure:"ssh_private_key_file" undocumented:"true" cty:"ssh_private_key_file" hcl:"ssh_private_key_file"` SSHPty *bool `mapstructure:"ssh_pty" cty:"ssh_pty" hcl:"ssh_pty"` SSHTimeout *string `mapstructure:"ssh_timeout" cty:"ssh_timeout" hcl:"ssh_timeout"` SSHWaitTimeout *string `mapstructure:"ssh_wait_timeout" undocumented:"true" cty:"ssh_wait_timeout" hcl:"ssh_wait_timeout"` @@ -116,8 +116,8 @@ type FlatConfig struct { SSHReadWriteTimeout *string `mapstructure:"ssh_read_write_timeout" cty:"ssh_read_write_timeout" hcl:"ssh_read_write_timeout"` SSHRemoteTunnels []string `mapstructure:"ssh_remote_tunnels" cty:"ssh_remote_tunnels" hcl:"ssh_remote_tunnels"` SSHLocalTunnels []string `mapstructure:"ssh_local_tunnels" cty:"ssh_local_tunnels" hcl:"ssh_local_tunnels"` - SSHPublicKey []byte `mapstructure:"ssh_public_key" cty:"ssh_public_key" hcl:"ssh_public_key"` - SSHPrivateKey []byte `mapstructure:"ssh_private_key" cty:"ssh_private_key" hcl:"ssh_private_key"` + SSHPublicKey []byte `mapstructure:"ssh_public_key" undocumented:"true" cty:"ssh_public_key" hcl:"ssh_public_key"` + SSHPrivateKey []byte `mapstructure:"ssh_private_key" undocumented:"true" cty:"ssh_private_key" hcl:"ssh_private_key"` WinRMUser *string `mapstructure:"winrm_username" cty:"winrm_username" hcl:"winrm_username"` WinRMPassword *string `mapstructure:"winrm_password" cty:"winrm_password" hcl:"winrm_password"` WinRMHost *string `mapstructure:"winrm_host" cty:"winrm_host" hcl:"winrm_host"` diff --git a/builder/azure/arm/config.hcl2spec.go b/builder/azure/arm/config.hcl2spec.go index 143401264..c828ab151 100644 --- a/builder/azure/arm/config.hcl2spec.go +++ b/builder/azure/arm/config.hcl2spec.go @@ -79,10 +79,10 @@ type FlatConfig struct { SSHUsername *string `mapstructure:"ssh_username" cty:"ssh_username" hcl:"ssh_username"` SSHPassword *string `mapstructure:"ssh_password" cty:"ssh_password" hcl:"ssh_password"` SSHKeyPairName *string `mapstructure:"ssh_keypair_name" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` - SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` + SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" undocumented:"true" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` SSHCiphers []string `mapstructure:"ssh_ciphers" cty:"ssh_ciphers" hcl:"ssh_ciphers"` SSHClearAuthorizedKeys *bool `mapstructure:"ssh_clear_authorized_keys" cty:"ssh_clear_authorized_keys" hcl:"ssh_clear_authorized_keys"` - SSHPrivateKeyFile *string `mapstructure:"ssh_private_key_file" cty:"ssh_private_key_file" hcl:"ssh_private_key_file"` + SSHPrivateKeyFile *string `mapstructure:"ssh_private_key_file" undocumented:"true" cty:"ssh_private_key_file" hcl:"ssh_private_key_file"` SSHPty *bool `mapstructure:"ssh_pty" cty:"ssh_pty" hcl:"ssh_pty"` SSHTimeout *string `mapstructure:"ssh_timeout" cty:"ssh_timeout" hcl:"ssh_timeout"` SSHWaitTimeout *string `mapstructure:"ssh_wait_timeout" undocumented:"true" cty:"ssh_wait_timeout" hcl:"ssh_wait_timeout"` @@ -105,8 +105,8 @@ type FlatConfig struct { SSHReadWriteTimeout *string `mapstructure:"ssh_read_write_timeout" cty:"ssh_read_write_timeout" hcl:"ssh_read_write_timeout"` SSHRemoteTunnels []string `mapstructure:"ssh_remote_tunnels" cty:"ssh_remote_tunnels" hcl:"ssh_remote_tunnels"` SSHLocalTunnels []string `mapstructure:"ssh_local_tunnels" cty:"ssh_local_tunnels" hcl:"ssh_local_tunnels"` - SSHPublicKey []byte `mapstructure:"ssh_public_key" cty:"ssh_public_key" hcl:"ssh_public_key"` - SSHPrivateKey []byte `mapstructure:"ssh_private_key" cty:"ssh_private_key" hcl:"ssh_private_key"` + SSHPublicKey []byte `mapstructure:"ssh_public_key" undocumented:"true" cty:"ssh_public_key" hcl:"ssh_public_key"` + SSHPrivateKey []byte `mapstructure:"ssh_private_key" undocumented:"true" cty:"ssh_private_key" hcl:"ssh_private_key"` WinRMUser *string `mapstructure:"winrm_username" cty:"winrm_username" hcl:"winrm_username"` WinRMPassword *string `mapstructure:"winrm_password" cty:"winrm_password" hcl:"winrm_password"` WinRMHost *string `mapstructure:"winrm_host" cty:"winrm_host" hcl:"winrm_host"` diff --git a/builder/azure/dtl/config.hcl2spec.go b/builder/azure/dtl/config.hcl2spec.go index 1b27639c9..24f870942 100644 --- a/builder/azure/dtl/config.hcl2spec.go +++ b/builder/azure/dtl/config.hcl2spec.go @@ -92,10 +92,10 @@ type FlatConfig struct { SSHUsername *string `mapstructure:"ssh_username" cty:"ssh_username" hcl:"ssh_username"` SSHPassword *string `mapstructure:"ssh_password" cty:"ssh_password" hcl:"ssh_password"` SSHKeyPairName *string `mapstructure:"ssh_keypair_name" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` - SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` + SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" undocumented:"true" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` SSHCiphers []string `mapstructure:"ssh_ciphers" cty:"ssh_ciphers" hcl:"ssh_ciphers"` SSHClearAuthorizedKeys *bool `mapstructure:"ssh_clear_authorized_keys" cty:"ssh_clear_authorized_keys" hcl:"ssh_clear_authorized_keys"` - SSHPrivateKeyFile *string `mapstructure:"ssh_private_key_file" cty:"ssh_private_key_file" hcl:"ssh_private_key_file"` + SSHPrivateKeyFile *string `mapstructure:"ssh_private_key_file" undocumented:"true" cty:"ssh_private_key_file" hcl:"ssh_private_key_file"` SSHPty *bool `mapstructure:"ssh_pty" cty:"ssh_pty" hcl:"ssh_pty"` SSHTimeout *string `mapstructure:"ssh_timeout" cty:"ssh_timeout" hcl:"ssh_timeout"` SSHWaitTimeout *string `mapstructure:"ssh_wait_timeout" undocumented:"true" cty:"ssh_wait_timeout" hcl:"ssh_wait_timeout"` @@ -118,8 +118,8 @@ type FlatConfig struct { SSHReadWriteTimeout *string `mapstructure:"ssh_read_write_timeout" cty:"ssh_read_write_timeout" hcl:"ssh_read_write_timeout"` SSHRemoteTunnels []string `mapstructure:"ssh_remote_tunnels" cty:"ssh_remote_tunnels" hcl:"ssh_remote_tunnels"` SSHLocalTunnels []string `mapstructure:"ssh_local_tunnels" cty:"ssh_local_tunnels" hcl:"ssh_local_tunnels"` - SSHPublicKey []byte `mapstructure:"ssh_public_key" cty:"ssh_public_key" hcl:"ssh_public_key"` - SSHPrivateKey []byte `mapstructure:"ssh_private_key" cty:"ssh_private_key" hcl:"ssh_private_key"` + SSHPublicKey []byte `mapstructure:"ssh_public_key" undocumented:"true" cty:"ssh_public_key" hcl:"ssh_public_key"` + SSHPrivateKey []byte `mapstructure:"ssh_private_key" undocumented:"true" cty:"ssh_private_key" hcl:"ssh_private_key"` WinRMUser *string `mapstructure:"winrm_username" cty:"winrm_username" hcl:"winrm_username"` WinRMPassword *string `mapstructure:"winrm_password" cty:"winrm_password" hcl:"winrm_password"` WinRMHost *string `mapstructure:"winrm_host" cty:"winrm_host" hcl:"winrm_host"` diff --git a/builder/cloudstack/config.hcl2spec.go b/builder/cloudstack/config.hcl2spec.go index 9454a686c..613dca946 100644 --- a/builder/cloudstack/config.hcl2spec.go +++ b/builder/cloudstack/config.hcl2spec.go @@ -27,10 +27,10 @@ type FlatConfig struct { SSHUsername *string `mapstructure:"ssh_username" cty:"ssh_username" hcl:"ssh_username"` SSHPassword *string `mapstructure:"ssh_password" cty:"ssh_password" hcl:"ssh_password"` SSHKeyPairName *string `mapstructure:"ssh_keypair_name" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` - SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` + SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" undocumented:"true" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` SSHCiphers []string `mapstructure:"ssh_ciphers" cty:"ssh_ciphers" hcl:"ssh_ciphers"` SSHClearAuthorizedKeys *bool `mapstructure:"ssh_clear_authorized_keys" cty:"ssh_clear_authorized_keys" hcl:"ssh_clear_authorized_keys"` - SSHPrivateKeyFile *string `mapstructure:"ssh_private_key_file" cty:"ssh_private_key_file" hcl:"ssh_private_key_file"` + SSHPrivateKeyFile *string `mapstructure:"ssh_private_key_file" undocumented:"true" cty:"ssh_private_key_file" hcl:"ssh_private_key_file"` SSHPty *bool `mapstructure:"ssh_pty" cty:"ssh_pty" hcl:"ssh_pty"` SSHTimeout *string `mapstructure:"ssh_timeout" cty:"ssh_timeout" hcl:"ssh_timeout"` SSHWaitTimeout *string `mapstructure:"ssh_wait_timeout" undocumented:"true" cty:"ssh_wait_timeout" hcl:"ssh_wait_timeout"` @@ -53,8 +53,8 @@ type FlatConfig struct { SSHReadWriteTimeout *string `mapstructure:"ssh_read_write_timeout" cty:"ssh_read_write_timeout" hcl:"ssh_read_write_timeout"` SSHRemoteTunnels []string `mapstructure:"ssh_remote_tunnels" cty:"ssh_remote_tunnels" hcl:"ssh_remote_tunnels"` SSHLocalTunnels []string `mapstructure:"ssh_local_tunnels" cty:"ssh_local_tunnels" hcl:"ssh_local_tunnels"` - SSHPublicKey []byte `mapstructure:"ssh_public_key" cty:"ssh_public_key" hcl:"ssh_public_key"` - SSHPrivateKey []byte `mapstructure:"ssh_private_key" cty:"ssh_private_key" hcl:"ssh_private_key"` + SSHPublicKey []byte `mapstructure:"ssh_public_key" undocumented:"true" cty:"ssh_public_key" hcl:"ssh_public_key"` + SSHPrivateKey []byte `mapstructure:"ssh_private_key" undocumented:"true" cty:"ssh_private_key" hcl:"ssh_private_key"` WinRMUser *string `mapstructure:"winrm_username" cty:"winrm_username" hcl:"winrm_username"` WinRMPassword *string `mapstructure:"winrm_password" cty:"winrm_password" hcl:"winrm_password"` WinRMHost *string `mapstructure:"winrm_host" cty:"winrm_host" hcl:"winrm_host"` diff --git a/builder/digitalocean/config.hcl2spec.go b/builder/digitalocean/config.hcl2spec.go index dbced7bc2..03e1be044 100644 --- a/builder/digitalocean/config.hcl2spec.go +++ b/builder/digitalocean/config.hcl2spec.go @@ -23,10 +23,10 @@ type FlatConfig struct { SSHUsername *string `mapstructure:"ssh_username" cty:"ssh_username" hcl:"ssh_username"` SSHPassword *string `mapstructure:"ssh_password" cty:"ssh_password" hcl:"ssh_password"` SSHKeyPairName *string `mapstructure:"ssh_keypair_name" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` - SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` + SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" undocumented:"true" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` SSHCiphers []string `mapstructure:"ssh_ciphers" cty:"ssh_ciphers" hcl:"ssh_ciphers"` SSHClearAuthorizedKeys *bool `mapstructure:"ssh_clear_authorized_keys" cty:"ssh_clear_authorized_keys" hcl:"ssh_clear_authorized_keys"` - SSHPrivateKeyFile *string `mapstructure:"ssh_private_key_file" cty:"ssh_private_key_file" hcl:"ssh_private_key_file"` + SSHPrivateKeyFile *string `mapstructure:"ssh_private_key_file" undocumented:"true" cty:"ssh_private_key_file" hcl:"ssh_private_key_file"` SSHPty *bool `mapstructure:"ssh_pty" cty:"ssh_pty" hcl:"ssh_pty"` SSHTimeout *string `mapstructure:"ssh_timeout" cty:"ssh_timeout" hcl:"ssh_timeout"` SSHWaitTimeout *string `mapstructure:"ssh_wait_timeout" undocumented:"true" cty:"ssh_wait_timeout" hcl:"ssh_wait_timeout"` @@ -49,8 +49,8 @@ type FlatConfig struct { SSHReadWriteTimeout *string `mapstructure:"ssh_read_write_timeout" cty:"ssh_read_write_timeout" hcl:"ssh_read_write_timeout"` SSHRemoteTunnels []string `mapstructure:"ssh_remote_tunnels" cty:"ssh_remote_tunnels" hcl:"ssh_remote_tunnels"` SSHLocalTunnels []string `mapstructure:"ssh_local_tunnels" cty:"ssh_local_tunnels" hcl:"ssh_local_tunnels"` - SSHPublicKey []byte `mapstructure:"ssh_public_key" cty:"ssh_public_key" hcl:"ssh_public_key"` - SSHPrivateKey []byte `mapstructure:"ssh_private_key" cty:"ssh_private_key" hcl:"ssh_private_key"` + SSHPublicKey []byte `mapstructure:"ssh_public_key" undocumented:"true" cty:"ssh_public_key" hcl:"ssh_public_key"` + SSHPrivateKey []byte `mapstructure:"ssh_private_key" undocumented:"true" cty:"ssh_private_key" hcl:"ssh_private_key"` WinRMUser *string `mapstructure:"winrm_username" cty:"winrm_username" hcl:"winrm_username"` WinRMPassword *string `mapstructure:"winrm_password" cty:"winrm_password" hcl:"winrm_password"` WinRMHost *string `mapstructure:"winrm_host" cty:"winrm_host" hcl:"winrm_host"` diff --git a/builder/docker/config.hcl2spec.go b/builder/docker/config.hcl2spec.go index 681cb63aa..9d26e56fa 100644 --- a/builder/docker/config.hcl2spec.go +++ b/builder/docker/config.hcl2spec.go @@ -23,10 +23,10 @@ type FlatConfig struct { SSHUsername *string `mapstructure:"ssh_username" cty:"ssh_username" hcl:"ssh_username"` SSHPassword *string `mapstructure:"ssh_password" cty:"ssh_password" hcl:"ssh_password"` SSHKeyPairName *string `mapstructure:"ssh_keypair_name" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` - SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` + SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" undocumented:"true" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` SSHCiphers []string `mapstructure:"ssh_ciphers" cty:"ssh_ciphers" hcl:"ssh_ciphers"` SSHClearAuthorizedKeys *bool `mapstructure:"ssh_clear_authorized_keys" cty:"ssh_clear_authorized_keys" hcl:"ssh_clear_authorized_keys"` - SSHPrivateKeyFile *string `mapstructure:"ssh_private_key_file" cty:"ssh_private_key_file" hcl:"ssh_private_key_file"` + SSHPrivateKeyFile *string `mapstructure:"ssh_private_key_file" undocumented:"true" cty:"ssh_private_key_file" hcl:"ssh_private_key_file"` SSHPty *bool `mapstructure:"ssh_pty" cty:"ssh_pty" hcl:"ssh_pty"` SSHTimeout *string `mapstructure:"ssh_timeout" cty:"ssh_timeout" hcl:"ssh_timeout"` SSHWaitTimeout *string `mapstructure:"ssh_wait_timeout" undocumented:"true" cty:"ssh_wait_timeout" hcl:"ssh_wait_timeout"` @@ -49,8 +49,8 @@ type FlatConfig struct { SSHReadWriteTimeout *string `mapstructure:"ssh_read_write_timeout" cty:"ssh_read_write_timeout" hcl:"ssh_read_write_timeout"` SSHRemoteTunnels []string `mapstructure:"ssh_remote_tunnels" cty:"ssh_remote_tunnels" hcl:"ssh_remote_tunnels"` SSHLocalTunnels []string `mapstructure:"ssh_local_tunnels" cty:"ssh_local_tunnels" hcl:"ssh_local_tunnels"` - SSHPublicKey []byte `mapstructure:"ssh_public_key" cty:"ssh_public_key" hcl:"ssh_public_key"` - SSHPrivateKey []byte `mapstructure:"ssh_private_key" cty:"ssh_private_key" hcl:"ssh_private_key"` + SSHPublicKey []byte `mapstructure:"ssh_public_key" undocumented:"true" cty:"ssh_public_key" hcl:"ssh_public_key"` + SSHPrivateKey []byte `mapstructure:"ssh_private_key" undocumented:"true" cty:"ssh_private_key" hcl:"ssh_private_key"` WinRMUser *string `mapstructure:"winrm_username" cty:"winrm_username" hcl:"winrm_username"` WinRMPassword *string `mapstructure:"winrm_password" cty:"winrm_password" hcl:"winrm_password"` WinRMHost *string `mapstructure:"winrm_host" cty:"winrm_host" hcl:"winrm_host"` diff --git a/builder/googlecompute/config.hcl2spec.go b/builder/googlecompute/config.hcl2spec.go index e8ea31cb2..ed515a034 100644 --- a/builder/googlecompute/config.hcl2spec.go +++ b/builder/googlecompute/config.hcl2spec.go @@ -23,10 +23,10 @@ type FlatConfig struct { SSHUsername *string `mapstructure:"ssh_username" cty:"ssh_username" hcl:"ssh_username"` SSHPassword *string `mapstructure:"ssh_password" cty:"ssh_password" hcl:"ssh_password"` SSHKeyPairName *string `mapstructure:"ssh_keypair_name" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` - SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` + SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" undocumented:"true" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` SSHCiphers []string `mapstructure:"ssh_ciphers" cty:"ssh_ciphers" hcl:"ssh_ciphers"` SSHClearAuthorizedKeys *bool `mapstructure:"ssh_clear_authorized_keys" cty:"ssh_clear_authorized_keys" hcl:"ssh_clear_authorized_keys"` - SSHPrivateKeyFile *string `mapstructure:"ssh_private_key_file" cty:"ssh_private_key_file" hcl:"ssh_private_key_file"` + SSHPrivateKeyFile *string `mapstructure:"ssh_private_key_file" undocumented:"true" cty:"ssh_private_key_file" hcl:"ssh_private_key_file"` SSHPty *bool `mapstructure:"ssh_pty" cty:"ssh_pty" hcl:"ssh_pty"` SSHTimeout *string `mapstructure:"ssh_timeout" cty:"ssh_timeout" hcl:"ssh_timeout"` SSHWaitTimeout *string `mapstructure:"ssh_wait_timeout" undocumented:"true" cty:"ssh_wait_timeout" hcl:"ssh_wait_timeout"` @@ -49,8 +49,8 @@ type FlatConfig struct { SSHReadWriteTimeout *string `mapstructure:"ssh_read_write_timeout" cty:"ssh_read_write_timeout" hcl:"ssh_read_write_timeout"` SSHRemoteTunnels []string `mapstructure:"ssh_remote_tunnels" cty:"ssh_remote_tunnels" hcl:"ssh_remote_tunnels"` SSHLocalTunnels []string `mapstructure:"ssh_local_tunnels" cty:"ssh_local_tunnels" hcl:"ssh_local_tunnels"` - SSHPublicKey []byte `mapstructure:"ssh_public_key" cty:"ssh_public_key" hcl:"ssh_public_key"` - SSHPrivateKey []byte `mapstructure:"ssh_private_key" cty:"ssh_private_key" hcl:"ssh_private_key"` + SSHPublicKey []byte `mapstructure:"ssh_public_key" undocumented:"true" cty:"ssh_public_key" hcl:"ssh_public_key"` + SSHPrivateKey []byte `mapstructure:"ssh_private_key" undocumented:"true" cty:"ssh_private_key" hcl:"ssh_private_key"` WinRMUser *string `mapstructure:"winrm_username" cty:"winrm_username" hcl:"winrm_username"` WinRMPassword *string `mapstructure:"winrm_password" cty:"winrm_password" hcl:"winrm_password"` WinRMHost *string `mapstructure:"winrm_host" cty:"winrm_host" hcl:"winrm_host"` diff --git a/builder/hcloud/config.hcl2spec.go b/builder/hcloud/config.hcl2spec.go index 4ba4898a1..d520c9f61 100644 --- a/builder/hcloud/config.hcl2spec.go +++ b/builder/hcloud/config.hcl2spec.go @@ -23,10 +23,10 @@ type FlatConfig struct { SSHUsername *string `mapstructure:"ssh_username" cty:"ssh_username" hcl:"ssh_username"` SSHPassword *string `mapstructure:"ssh_password" cty:"ssh_password" hcl:"ssh_password"` SSHKeyPairName *string `mapstructure:"ssh_keypair_name" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` - SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` + SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" undocumented:"true" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` SSHCiphers []string `mapstructure:"ssh_ciphers" cty:"ssh_ciphers" hcl:"ssh_ciphers"` SSHClearAuthorizedKeys *bool `mapstructure:"ssh_clear_authorized_keys" cty:"ssh_clear_authorized_keys" hcl:"ssh_clear_authorized_keys"` - SSHPrivateKeyFile *string `mapstructure:"ssh_private_key_file" cty:"ssh_private_key_file" hcl:"ssh_private_key_file"` + SSHPrivateKeyFile *string `mapstructure:"ssh_private_key_file" undocumented:"true" cty:"ssh_private_key_file" hcl:"ssh_private_key_file"` SSHPty *bool `mapstructure:"ssh_pty" cty:"ssh_pty" hcl:"ssh_pty"` SSHTimeout *string `mapstructure:"ssh_timeout" cty:"ssh_timeout" hcl:"ssh_timeout"` SSHWaitTimeout *string `mapstructure:"ssh_wait_timeout" undocumented:"true" cty:"ssh_wait_timeout" hcl:"ssh_wait_timeout"` @@ -49,8 +49,8 @@ type FlatConfig struct { SSHReadWriteTimeout *string `mapstructure:"ssh_read_write_timeout" cty:"ssh_read_write_timeout" hcl:"ssh_read_write_timeout"` SSHRemoteTunnels []string `mapstructure:"ssh_remote_tunnels" cty:"ssh_remote_tunnels" hcl:"ssh_remote_tunnels"` SSHLocalTunnels []string `mapstructure:"ssh_local_tunnels" cty:"ssh_local_tunnels" hcl:"ssh_local_tunnels"` - SSHPublicKey []byte `mapstructure:"ssh_public_key" cty:"ssh_public_key" hcl:"ssh_public_key"` - SSHPrivateKey []byte `mapstructure:"ssh_private_key" cty:"ssh_private_key" hcl:"ssh_private_key"` + SSHPublicKey []byte `mapstructure:"ssh_public_key" undocumented:"true" cty:"ssh_public_key" hcl:"ssh_public_key"` + SSHPrivateKey []byte `mapstructure:"ssh_private_key" undocumented:"true" cty:"ssh_private_key" hcl:"ssh_private_key"` WinRMUser *string `mapstructure:"winrm_username" cty:"winrm_username" hcl:"winrm_username"` WinRMPassword *string `mapstructure:"winrm_password" cty:"winrm_password" hcl:"winrm_password"` WinRMHost *string `mapstructure:"winrm_host" cty:"winrm_host" hcl:"winrm_host"` diff --git a/builder/hyperone/config.hcl2spec.go b/builder/hyperone/config.hcl2spec.go index 8f1ca2d6a..ef0085d45 100644 --- a/builder/hyperone/config.hcl2spec.go +++ b/builder/hyperone/config.hcl2spec.go @@ -24,10 +24,10 @@ type FlatConfig struct { SSHUsername *string `mapstructure:"ssh_username" cty:"ssh_username" hcl:"ssh_username"` SSHPassword *string `mapstructure:"ssh_password" cty:"ssh_password" hcl:"ssh_password"` SSHKeyPairName *string `mapstructure:"ssh_keypair_name" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` - SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` + SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" undocumented:"true" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` SSHCiphers []string `mapstructure:"ssh_ciphers" cty:"ssh_ciphers" hcl:"ssh_ciphers"` SSHClearAuthorizedKeys *bool `mapstructure:"ssh_clear_authorized_keys" cty:"ssh_clear_authorized_keys" hcl:"ssh_clear_authorized_keys"` - SSHPrivateKeyFile *string `mapstructure:"ssh_private_key_file" cty:"ssh_private_key_file" hcl:"ssh_private_key_file"` + SSHPrivateKeyFile *string `mapstructure:"ssh_private_key_file" undocumented:"true" cty:"ssh_private_key_file" hcl:"ssh_private_key_file"` SSHPty *bool `mapstructure:"ssh_pty" cty:"ssh_pty" hcl:"ssh_pty"` SSHTimeout *string `mapstructure:"ssh_timeout" cty:"ssh_timeout" hcl:"ssh_timeout"` SSHWaitTimeout *string `mapstructure:"ssh_wait_timeout" undocumented:"true" cty:"ssh_wait_timeout" hcl:"ssh_wait_timeout"` @@ -50,8 +50,8 @@ type FlatConfig struct { SSHReadWriteTimeout *string `mapstructure:"ssh_read_write_timeout" cty:"ssh_read_write_timeout" hcl:"ssh_read_write_timeout"` SSHRemoteTunnels []string `mapstructure:"ssh_remote_tunnels" cty:"ssh_remote_tunnels" hcl:"ssh_remote_tunnels"` SSHLocalTunnels []string `mapstructure:"ssh_local_tunnels" cty:"ssh_local_tunnels" hcl:"ssh_local_tunnels"` - SSHPublicKey []byte `mapstructure:"ssh_public_key" cty:"ssh_public_key" hcl:"ssh_public_key"` - SSHPrivateKey []byte `mapstructure:"ssh_private_key" cty:"ssh_private_key" hcl:"ssh_private_key"` + SSHPublicKey []byte `mapstructure:"ssh_public_key" undocumented:"true" cty:"ssh_public_key" hcl:"ssh_public_key"` + SSHPrivateKey []byte `mapstructure:"ssh_private_key" undocumented:"true" cty:"ssh_private_key" hcl:"ssh_private_key"` WinRMUser *string `mapstructure:"winrm_username" cty:"winrm_username" hcl:"winrm_username"` WinRMPassword *string `mapstructure:"winrm_password" cty:"winrm_password" hcl:"winrm_password"` WinRMHost *string `mapstructure:"winrm_host" cty:"winrm_host" hcl:"winrm_host"` diff --git a/builder/hyperv/iso/builder.hcl2spec.go b/builder/hyperv/iso/builder.hcl2spec.go index 30c09a4b4..c31441593 100644 --- a/builder/hyperv/iso/builder.hcl2spec.go +++ b/builder/hyperv/iso/builder.hcl2spec.go @@ -36,10 +36,10 @@ type FlatConfig struct { SSHUsername *string `mapstructure:"ssh_username" cty:"ssh_username" hcl:"ssh_username"` SSHPassword *string `mapstructure:"ssh_password" cty:"ssh_password" hcl:"ssh_password"` SSHKeyPairName *string `mapstructure:"ssh_keypair_name" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` - SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` + SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" undocumented:"true" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` SSHCiphers []string `mapstructure:"ssh_ciphers" cty:"ssh_ciphers" hcl:"ssh_ciphers"` SSHClearAuthorizedKeys *bool `mapstructure:"ssh_clear_authorized_keys" cty:"ssh_clear_authorized_keys" hcl:"ssh_clear_authorized_keys"` - SSHPrivateKeyFile *string `mapstructure:"ssh_private_key_file" cty:"ssh_private_key_file" hcl:"ssh_private_key_file"` + SSHPrivateKeyFile *string `mapstructure:"ssh_private_key_file" undocumented:"true" cty:"ssh_private_key_file" hcl:"ssh_private_key_file"` SSHPty *bool `mapstructure:"ssh_pty" cty:"ssh_pty" hcl:"ssh_pty"` SSHTimeout *string `mapstructure:"ssh_timeout" cty:"ssh_timeout" hcl:"ssh_timeout"` SSHWaitTimeout *string `mapstructure:"ssh_wait_timeout" undocumented:"true" cty:"ssh_wait_timeout" hcl:"ssh_wait_timeout"` @@ -62,8 +62,8 @@ type FlatConfig struct { SSHReadWriteTimeout *string `mapstructure:"ssh_read_write_timeout" cty:"ssh_read_write_timeout" hcl:"ssh_read_write_timeout"` SSHRemoteTunnels []string `mapstructure:"ssh_remote_tunnels" cty:"ssh_remote_tunnels" hcl:"ssh_remote_tunnels"` SSHLocalTunnels []string `mapstructure:"ssh_local_tunnels" cty:"ssh_local_tunnels" hcl:"ssh_local_tunnels"` - SSHPublicKey []byte `mapstructure:"ssh_public_key" cty:"ssh_public_key" hcl:"ssh_public_key"` - SSHPrivateKey []byte `mapstructure:"ssh_private_key" cty:"ssh_private_key" hcl:"ssh_private_key"` + SSHPublicKey []byte `mapstructure:"ssh_public_key" undocumented:"true" cty:"ssh_public_key" hcl:"ssh_public_key"` + SSHPrivateKey []byte `mapstructure:"ssh_private_key" undocumented:"true" cty:"ssh_private_key" hcl:"ssh_private_key"` WinRMUser *string `mapstructure:"winrm_username" cty:"winrm_username" hcl:"winrm_username"` WinRMPassword *string `mapstructure:"winrm_password" cty:"winrm_password" hcl:"winrm_password"` WinRMHost *string `mapstructure:"winrm_host" cty:"winrm_host" hcl:"winrm_host"` diff --git a/builder/hyperv/vmcx/builder.hcl2spec.go b/builder/hyperv/vmcx/builder.hcl2spec.go index 92cdb973b..555547ed4 100644 --- a/builder/hyperv/vmcx/builder.hcl2spec.go +++ b/builder/hyperv/vmcx/builder.hcl2spec.go @@ -36,10 +36,10 @@ type FlatConfig struct { SSHUsername *string `mapstructure:"ssh_username" cty:"ssh_username" hcl:"ssh_username"` SSHPassword *string `mapstructure:"ssh_password" cty:"ssh_password" hcl:"ssh_password"` SSHKeyPairName *string `mapstructure:"ssh_keypair_name" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` - SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` + SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" undocumented:"true" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` SSHCiphers []string `mapstructure:"ssh_ciphers" cty:"ssh_ciphers" hcl:"ssh_ciphers"` SSHClearAuthorizedKeys *bool `mapstructure:"ssh_clear_authorized_keys" cty:"ssh_clear_authorized_keys" hcl:"ssh_clear_authorized_keys"` - SSHPrivateKeyFile *string `mapstructure:"ssh_private_key_file" cty:"ssh_private_key_file" hcl:"ssh_private_key_file"` + SSHPrivateKeyFile *string `mapstructure:"ssh_private_key_file" undocumented:"true" cty:"ssh_private_key_file" hcl:"ssh_private_key_file"` SSHPty *bool `mapstructure:"ssh_pty" cty:"ssh_pty" hcl:"ssh_pty"` SSHTimeout *string `mapstructure:"ssh_timeout" cty:"ssh_timeout" hcl:"ssh_timeout"` SSHWaitTimeout *string `mapstructure:"ssh_wait_timeout" undocumented:"true" cty:"ssh_wait_timeout" hcl:"ssh_wait_timeout"` @@ -62,8 +62,8 @@ type FlatConfig struct { SSHReadWriteTimeout *string `mapstructure:"ssh_read_write_timeout" cty:"ssh_read_write_timeout" hcl:"ssh_read_write_timeout"` SSHRemoteTunnels []string `mapstructure:"ssh_remote_tunnels" cty:"ssh_remote_tunnels" hcl:"ssh_remote_tunnels"` SSHLocalTunnels []string `mapstructure:"ssh_local_tunnels" cty:"ssh_local_tunnels" hcl:"ssh_local_tunnels"` - SSHPublicKey []byte `mapstructure:"ssh_public_key" cty:"ssh_public_key" hcl:"ssh_public_key"` - SSHPrivateKey []byte `mapstructure:"ssh_private_key" cty:"ssh_private_key" hcl:"ssh_private_key"` + SSHPublicKey []byte `mapstructure:"ssh_public_key" undocumented:"true" cty:"ssh_public_key" hcl:"ssh_public_key"` + SSHPrivateKey []byte `mapstructure:"ssh_private_key" undocumented:"true" cty:"ssh_private_key" hcl:"ssh_private_key"` WinRMUser *string `mapstructure:"winrm_username" cty:"winrm_username" hcl:"winrm_username"` WinRMPassword *string `mapstructure:"winrm_password" cty:"winrm_password" hcl:"winrm_password"` WinRMHost *string `mapstructure:"winrm_host" cty:"winrm_host" hcl:"winrm_host"` diff --git a/builder/jdcloud/common.hcl2spec.go b/builder/jdcloud/common.hcl2spec.go index 6634d6f58..3503ff9a6 100644 --- a/builder/jdcloud/common.hcl2spec.go +++ b/builder/jdcloud/common.hcl2spec.go @@ -25,10 +25,10 @@ type FlatConfig struct { SSHUsername *string `mapstructure:"ssh_username" cty:"ssh_username" hcl:"ssh_username"` SSHPassword *string `mapstructure:"ssh_password" cty:"ssh_password" hcl:"ssh_password"` SSHKeyPairName *string `mapstructure:"ssh_keypair_name" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` - SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` + SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" undocumented:"true" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` SSHCiphers []string `mapstructure:"ssh_ciphers" cty:"ssh_ciphers" hcl:"ssh_ciphers"` SSHClearAuthorizedKeys *bool `mapstructure:"ssh_clear_authorized_keys" cty:"ssh_clear_authorized_keys" hcl:"ssh_clear_authorized_keys"` - SSHPrivateKeyFile *string `mapstructure:"ssh_private_key_file" cty:"ssh_private_key_file" hcl:"ssh_private_key_file"` + SSHPrivateKeyFile *string `mapstructure:"ssh_private_key_file" undocumented:"true" cty:"ssh_private_key_file" hcl:"ssh_private_key_file"` SSHPty *bool `mapstructure:"ssh_pty" cty:"ssh_pty" hcl:"ssh_pty"` SSHTimeout *string `mapstructure:"ssh_timeout" cty:"ssh_timeout" hcl:"ssh_timeout"` SSHWaitTimeout *string `mapstructure:"ssh_wait_timeout" undocumented:"true" cty:"ssh_wait_timeout" hcl:"ssh_wait_timeout"` @@ -51,8 +51,8 @@ type FlatConfig struct { SSHReadWriteTimeout *string `mapstructure:"ssh_read_write_timeout" cty:"ssh_read_write_timeout" hcl:"ssh_read_write_timeout"` SSHRemoteTunnels []string `mapstructure:"ssh_remote_tunnels" cty:"ssh_remote_tunnels" hcl:"ssh_remote_tunnels"` SSHLocalTunnels []string `mapstructure:"ssh_local_tunnels" cty:"ssh_local_tunnels" hcl:"ssh_local_tunnels"` - SSHPublicKey []byte `mapstructure:"ssh_public_key" cty:"ssh_public_key" hcl:"ssh_public_key"` - SSHPrivateKey []byte `mapstructure:"ssh_private_key" cty:"ssh_private_key" hcl:"ssh_private_key"` + SSHPublicKey []byte `mapstructure:"ssh_public_key" undocumented:"true" cty:"ssh_public_key" hcl:"ssh_public_key"` + SSHPrivateKey []byte `mapstructure:"ssh_private_key" undocumented:"true" cty:"ssh_private_key" hcl:"ssh_private_key"` WinRMUser *string `mapstructure:"winrm_username" cty:"winrm_username" hcl:"winrm_username"` WinRMPassword *string `mapstructure:"winrm_password" cty:"winrm_password" hcl:"winrm_password"` WinRMHost *string `mapstructure:"winrm_host" cty:"winrm_host" hcl:"winrm_host"` diff --git a/builder/linode/config.hcl2spec.go b/builder/linode/config.hcl2spec.go index 643bc6231..b5af47e68 100644 --- a/builder/linode/config.hcl2spec.go +++ b/builder/linode/config.hcl2spec.go @@ -23,10 +23,10 @@ type FlatConfig struct { SSHUsername *string `mapstructure:"ssh_username" cty:"ssh_username" hcl:"ssh_username"` SSHPassword *string `mapstructure:"ssh_password" cty:"ssh_password" hcl:"ssh_password"` SSHKeyPairName *string `mapstructure:"ssh_keypair_name" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` - SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` + SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" undocumented:"true" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` SSHCiphers []string `mapstructure:"ssh_ciphers" cty:"ssh_ciphers" hcl:"ssh_ciphers"` SSHClearAuthorizedKeys *bool `mapstructure:"ssh_clear_authorized_keys" cty:"ssh_clear_authorized_keys" hcl:"ssh_clear_authorized_keys"` - SSHPrivateKeyFile *string `mapstructure:"ssh_private_key_file" cty:"ssh_private_key_file" hcl:"ssh_private_key_file"` + SSHPrivateKeyFile *string `mapstructure:"ssh_private_key_file" undocumented:"true" cty:"ssh_private_key_file" hcl:"ssh_private_key_file"` SSHPty *bool `mapstructure:"ssh_pty" cty:"ssh_pty" hcl:"ssh_pty"` SSHTimeout *string `mapstructure:"ssh_timeout" cty:"ssh_timeout" hcl:"ssh_timeout"` SSHWaitTimeout *string `mapstructure:"ssh_wait_timeout" undocumented:"true" cty:"ssh_wait_timeout" hcl:"ssh_wait_timeout"` @@ -49,8 +49,8 @@ type FlatConfig struct { SSHReadWriteTimeout *string `mapstructure:"ssh_read_write_timeout" cty:"ssh_read_write_timeout" hcl:"ssh_read_write_timeout"` SSHRemoteTunnels []string `mapstructure:"ssh_remote_tunnels" cty:"ssh_remote_tunnels" hcl:"ssh_remote_tunnels"` SSHLocalTunnels []string `mapstructure:"ssh_local_tunnels" cty:"ssh_local_tunnels" hcl:"ssh_local_tunnels"` - SSHPublicKey []byte `mapstructure:"ssh_public_key" cty:"ssh_public_key" hcl:"ssh_public_key"` - SSHPrivateKey []byte `mapstructure:"ssh_private_key" cty:"ssh_private_key" hcl:"ssh_private_key"` + SSHPublicKey []byte `mapstructure:"ssh_public_key" undocumented:"true" cty:"ssh_public_key" hcl:"ssh_public_key"` + SSHPrivateKey []byte `mapstructure:"ssh_private_key" undocumented:"true" cty:"ssh_private_key" hcl:"ssh_private_key"` WinRMUser *string `mapstructure:"winrm_username" cty:"winrm_username" hcl:"winrm_username"` WinRMPassword *string `mapstructure:"winrm_password" cty:"winrm_password" hcl:"winrm_password"` WinRMHost *string `mapstructure:"winrm_host" cty:"winrm_host" hcl:"winrm_host"` diff --git a/builder/ncloud/config.hcl2spec.go b/builder/ncloud/config.hcl2spec.go index 871150791..7064234d3 100644 --- a/builder/ncloud/config.hcl2spec.go +++ b/builder/ncloud/config.hcl2spec.go @@ -35,10 +35,10 @@ type FlatConfig struct { SSHUsername *string `mapstructure:"ssh_username" cty:"ssh_username" hcl:"ssh_username"` SSHPassword *string `mapstructure:"ssh_password" cty:"ssh_password" hcl:"ssh_password"` SSHKeyPairName *string `mapstructure:"ssh_keypair_name" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` - SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` + SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" undocumented:"true" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` SSHCiphers []string `mapstructure:"ssh_ciphers" cty:"ssh_ciphers" hcl:"ssh_ciphers"` SSHClearAuthorizedKeys *bool `mapstructure:"ssh_clear_authorized_keys" cty:"ssh_clear_authorized_keys" hcl:"ssh_clear_authorized_keys"` - SSHPrivateKeyFile *string `mapstructure:"ssh_private_key_file" cty:"ssh_private_key_file" hcl:"ssh_private_key_file"` + SSHPrivateKeyFile *string `mapstructure:"ssh_private_key_file" undocumented:"true" cty:"ssh_private_key_file" hcl:"ssh_private_key_file"` SSHPty *bool `mapstructure:"ssh_pty" cty:"ssh_pty" hcl:"ssh_pty"` SSHTimeout *string `mapstructure:"ssh_timeout" cty:"ssh_timeout" hcl:"ssh_timeout"` SSHWaitTimeout *string `mapstructure:"ssh_wait_timeout" undocumented:"true" cty:"ssh_wait_timeout" hcl:"ssh_wait_timeout"` @@ -61,8 +61,8 @@ type FlatConfig struct { SSHReadWriteTimeout *string `mapstructure:"ssh_read_write_timeout" cty:"ssh_read_write_timeout" hcl:"ssh_read_write_timeout"` SSHRemoteTunnels []string `mapstructure:"ssh_remote_tunnels" cty:"ssh_remote_tunnels" hcl:"ssh_remote_tunnels"` SSHLocalTunnels []string `mapstructure:"ssh_local_tunnels" cty:"ssh_local_tunnels" hcl:"ssh_local_tunnels"` - SSHPublicKey []byte `mapstructure:"ssh_public_key" cty:"ssh_public_key" hcl:"ssh_public_key"` - SSHPrivateKey []byte `mapstructure:"ssh_private_key" cty:"ssh_private_key" hcl:"ssh_private_key"` + SSHPublicKey []byte `mapstructure:"ssh_public_key" undocumented:"true" cty:"ssh_public_key" hcl:"ssh_public_key"` + SSHPrivateKey []byte `mapstructure:"ssh_private_key" undocumented:"true" cty:"ssh_private_key" hcl:"ssh_private_key"` WinRMUser *string `mapstructure:"winrm_username" cty:"winrm_username" hcl:"winrm_username"` WinRMPassword *string `mapstructure:"winrm_password" cty:"winrm_password" hcl:"winrm_password"` WinRMHost *string `mapstructure:"winrm_host" cty:"winrm_host" hcl:"winrm_host"` diff --git a/builder/null/config.hcl2spec.go b/builder/null/config.hcl2spec.go index 3a23dce5c..44a8f7e45 100644 --- a/builder/null/config.hcl2spec.go +++ b/builder/null/config.hcl2spec.go @@ -23,10 +23,10 @@ type FlatConfig struct { SSHUsername *string `mapstructure:"ssh_username" cty:"ssh_username" hcl:"ssh_username"` SSHPassword *string `mapstructure:"ssh_password" cty:"ssh_password" hcl:"ssh_password"` SSHKeyPairName *string `mapstructure:"ssh_keypair_name" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` - SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` + SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" undocumented:"true" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` SSHCiphers []string `mapstructure:"ssh_ciphers" cty:"ssh_ciphers" hcl:"ssh_ciphers"` SSHClearAuthorizedKeys *bool `mapstructure:"ssh_clear_authorized_keys" cty:"ssh_clear_authorized_keys" hcl:"ssh_clear_authorized_keys"` - SSHPrivateKeyFile *string `mapstructure:"ssh_private_key_file" cty:"ssh_private_key_file" hcl:"ssh_private_key_file"` + SSHPrivateKeyFile *string `mapstructure:"ssh_private_key_file" undocumented:"true" cty:"ssh_private_key_file" hcl:"ssh_private_key_file"` SSHPty *bool `mapstructure:"ssh_pty" cty:"ssh_pty" hcl:"ssh_pty"` SSHTimeout *string `mapstructure:"ssh_timeout" cty:"ssh_timeout" hcl:"ssh_timeout"` SSHWaitTimeout *string `mapstructure:"ssh_wait_timeout" undocumented:"true" cty:"ssh_wait_timeout" hcl:"ssh_wait_timeout"` @@ -49,8 +49,8 @@ type FlatConfig struct { SSHReadWriteTimeout *string `mapstructure:"ssh_read_write_timeout" cty:"ssh_read_write_timeout" hcl:"ssh_read_write_timeout"` SSHRemoteTunnels []string `mapstructure:"ssh_remote_tunnels" cty:"ssh_remote_tunnels" hcl:"ssh_remote_tunnels"` SSHLocalTunnels []string `mapstructure:"ssh_local_tunnels" cty:"ssh_local_tunnels" hcl:"ssh_local_tunnels"` - SSHPublicKey []byte `mapstructure:"ssh_public_key" cty:"ssh_public_key" hcl:"ssh_public_key"` - SSHPrivateKey []byte `mapstructure:"ssh_private_key" cty:"ssh_private_key" hcl:"ssh_private_key"` + SSHPublicKey []byte `mapstructure:"ssh_public_key" undocumented:"true" cty:"ssh_public_key" hcl:"ssh_public_key"` + SSHPrivateKey []byte `mapstructure:"ssh_private_key" undocumented:"true" cty:"ssh_private_key" hcl:"ssh_private_key"` WinRMUser *string `mapstructure:"winrm_username" cty:"winrm_username" hcl:"winrm_username"` WinRMPassword *string `mapstructure:"winrm_password" cty:"winrm_password" hcl:"winrm_password"` WinRMHost *string `mapstructure:"winrm_host" cty:"winrm_host" hcl:"winrm_host"` diff --git a/builder/oneandone/config.hcl2spec.go b/builder/oneandone/config.hcl2spec.go index 35c18d193..64e703c0c 100644 --- a/builder/oneandone/config.hcl2spec.go +++ b/builder/oneandone/config.hcl2spec.go @@ -23,10 +23,10 @@ type FlatConfig struct { SSHUsername *string `mapstructure:"ssh_username" cty:"ssh_username" hcl:"ssh_username"` SSHPassword *string `mapstructure:"ssh_password" cty:"ssh_password" hcl:"ssh_password"` SSHKeyPairName *string `mapstructure:"ssh_keypair_name" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` - SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` + SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" undocumented:"true" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` SSHCiphers []string `mapstructure:"ssh_ciphers" cty:"ssh_ciphers" hcl:"ssh_ciphers"` SSHClearAuthorizedKeys *bool `mapstructure:"ssh_clear_authorized_keys" cty:"ssh_clear_authorized_keys" hcl:"ssh_clear_authorized_keys"` - SSHPrivateKeyFile *string `mapstructure:"ssh_private_key_file" cty:"ssh_private_key_file" hcl:"ssh_private_key_file"` + SSHPrivateKeyFile *string `mapstructure:"ssh_private_key_file" undocumented:"true" cty:"ssh_private_key_file" hcl:"ssh_private_key_file"` SSHPty *bool `mapstructure:"ssh_pty" cty:"ssh_pty" hcl:"ssh_pty"` SSHTimeout *string `mapstructure:"ssh_timeout" cty:"ssh_timeout" hcl:"ssh_timeout"` SSHWaitTimeout *string `mapstructure:"ssh_wait_timeout" undocumented:"true" cty:"ssh_wait_timeout" hcl:"ssh_wait_timeout"` @@ -49,8 +49,8 @@ type FlatConfig struct { SSHReadWriteTimeout *string `mapstructure:"ssh_read_write_timeout" cty:"ssh_read_write_timeout" hcl:"ssh_read_write_timeout"` SSHRemoteTunnels []string `mapstructure:"ssh_remote_tunnels" cty:"ssh_remote_tunnels" hcl:"ssh_remote_tunnels"` SSHLocalTunnels []string `mapstructure:"ssh_local_tunnels" cty:"ssh_local_tunnels" hcl:"ssh_local_tunnels"` - SSHPublicKey []byte `mapstructure:"ssh_public_key" cty:"ssh_public_key" hcl:"ssh_public_key"` - SSHPrivateKey []byte `mapstructure:"ssh_private_key" cty:"ssh_private_key" hcl:"ssh_private_key"` + SSHPublicKey []byte `mapstructure:"ssh_public_key" undocumented:"true" cty:"ssh_public_key" hcl:"ssh_public_key"` + SSHPrivateKey []byte `mapstructure:"ssh_private_key" undocumented:"true" cty:"ssh_private_key" hcl:"ssh_private_key"` WinRMUser *string `mapstructure:"winrm_username" cty:"winrm_username" hcl:"winrm_username"` WinRMPassword *string `mapstructure:"winrm_password" cty:"winrm_password" hcl:"winrm_password"` WinRMHost *string `mapstructure:"winrm_host" cty:"winrm_host" hcl:"winrm_host"` diff --git a/builder/openstack/builder.hcl2spec.go b/builder/openstack/builder.hcl2spec.go index 40b3f9ddb..4429efb4a 100644 --- a/builder/openstack/builder.hcl2spec.go +++ b/builder/openstack/builder.hcl2spec.go @@ -51,10 +51,10 @@ type FlatConfig struct { SSHUsername *string `mapstructure:"ssh_username" cty:"ssh_username" hcl:"ssh_username"` SSHPassword *string `mapstructure:"ssh_password" cty:"ssh_password" hcl:"ssh_password"` SSHKeyPairName *string `mapstructure:"ssh_keypair_name" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` - SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` + SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" undocumented:"true" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` SSHCiphers []string `mapstructure:"ssh_ciphers" cty:"ssh_ciphers" hcl:"ssh_ciphers"` SSHClearAuthorizedKeys *bool `mapstructure:"ssh_clear_authorized_keys" cty:"ssh_clear_authorized_keys" hcl:"ssh_clear_authorized_keys"` - SSHPrivateKeyFile *string `mapstructure:"ssh_private_key_file" cty:"ssh_private_key_file" hcl:"ssh_private_key_file"` + SSHPrivateKeyFile *string `mapstructure:"ssh_private_key_file" undocumented:"true" cty:"ssh_private_key_file" hcl:"ssh_private_key_file"` SSHPty *bool `mapstructure:"ssh_pty" cty:"ssh_pty" hcl:"ssh_pty"` SSHTimeout *string `mapstructure:"ssh_timeout" cty:"ssh_timeout" hcl:"ssh_timeout"` SSHWaitTimeout *string `mapstructure:"ssh_wait_timeout" undocumented:"true" cty:"ssh_wait_timeout" hcl:"ssh_wait_timeout"` @@ -77,8 +77,8 @@ type FlatConfig struct { SSHReadWriteTimeout *string `mapstructure:"ssh_read_write_timeout" cty:"ssh_read_write_timeout" hcl:"ssh_read_write_timeout"` SSHRemoteTunnels []string `mapstructure:"ssh_remote_tunnels" cty:"ssh_remote_tunnels" hcl:"ssh_remote_tunnels"` SSHLocalTunnels []string `mapstructure:"ssh_local_tunnels" cty:"ssh_local_tunnels" hcl:"ssh_local_tunnels"` - SSHPublicKey []byte `mapstructure:"ssh_public_key" cty:"ssh_public_key" hcl:"ssh_public_key"` - SSHPrivateKey []byte `mapstructure:"ssh_private_key" cty:"ssh_private_key" hcl:"ssh_private_key"` + SSHPublicKey []byte `mapstructure:"ssh_public_key" undocumented:"true" cty:"ssh_public_key" hcl:"ssh_public_key"` + SSHPrivateKey []byte `mapstructure:"ssh_private_key" undocumented:"true" cty:"ssh_private_key" hcl:"ssh_private_key"` WinRMUser *string `mapstructure:"winrm_username" cty:"winrm_username" hcl:"winrm_username"` WinRMPassword *string `mapstructure:"winrm_password" cty:"winrm_password" hcl:"winrm_password"` WinRMHost *string `mapstructure:"winrm_host" cty:"winrm_host" hcl:"winrm_host"` diff --git a/builder/oracle/classic/builder.hcl2spec.go b/builder/oracle/classic/builder.hcl2spec.go index 0acea7e02..ba0913a2e 100644 --- a/builder/oracle/classic/builder.hcl2spec.go +++ b/builder/oracle/classic/builder.hcl2spec.go @@ -30,10 +30,10 @@ type FlatConfig struct { SSHUsername *string `mapstructure:"ssh_username" cty:"ssh_username" hcl:"ssh_username"` SSHPassword *string `mapstructure:"ssh_password" cty:"ssh_password" hcl:"ssh_password"` SSHKeyPairName *string `mapstructure:"ssh_keypair_name" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` - SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` + SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" undocumented:"true" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` SSHCiphers []string `mapstructure:"ssh_ciphers" cty:"ssh_ciphers" hcl:"ssh_ciphers"` SSHClearAuthorizedKeys *bool `mapstructure:"ssh_clear_authorized_keys" cty:"ssh_clear_authorized_keys" hcl:"ssh_clear_authorized_keys"` - SSHPrivateKeyFile *string `mapstructure:"ssh_private_key_file" cty:"ssh_private_key_file" hcl:"ssh_private_key_file"` + SSHPrivateKeyFile *string `mapstructure:"ssh_private_key_file" undocumented:"true" cty:"ssh_private_key_file" hcl:"ssh_private_key_file"` SSHPty *bool `mapstructure:"ssh_pty" cty:"ssh_pty" hcl:"ssh_pty"` SSHTimeout *string `mapstructure:"ssh_timeout" cty:"ssh_timeout" hcl:"ssh_timeout"` SSHWaitTimeout *string `mapstructure:"ssh_wait_timeout" undocumented:"true" cty:"ssh_wait_timeout" hcl:"ssh_wait_timeout"` @@ -56,8 +56,8 @@ type FlatConfig struct { SSHReadWriteTimeout *string `mapstructure:"ssh_read_write_timeout" cty:"ssh_read_write_timeout" hcl:"ssh_read_write_timeout"` SSHRemoteTunnels []string `mapstructure:"ssh_remote_tunnels" cty:"ssh_remote_tunnels" hcl:"ssh_remote_tunnels"` SSHLocalTunnels []string `mapstructure:"ssh_local_tunnels" cty:"ssh_local_tunnels" hcl:"ssh_local_tunnels"` - SSHPublicKey []byte `mapstructure:"ssh_public_key" cty:"ssh_public_key" hcl:"ssh_public_key"` - SSHPrivateKey []byte `mapstructure:"ssh_private_key" cty:"ssh_private_key" hcl:"ssh_private_key"` + SSHPublicKey []byte `mapstructure:"ssh_public_key" undocumented:"true" cty:"ssh_public_key" hcl:"ssh_public_key"` + SSHPrivateKey []byte `mapstructure:"ssh_private_key" undocumented:"true" cty:"ssh_private_key" hcl:"ssh_private_key"` WinRMUser *string `mapstructure:"winrm_username" cty:"winrm_username" hcl:"winrm_username"` WinRMPassword *string `mapstructure:"winrm_password" cty:"winrm_password" hcl:"winrm_password"` WinRMHost *string `mapstructure:"winrm_host" cty:"winrm_host" hcl:"winrm_host"` diff --git a/builder/oracle/oci/config.hcl2spec.go b/builder/oracle/oci/config.hcl2spec.go index 99aedcd7c..078c39b12 100644 --- a/builder/oracle/oci/config.hcl2spec.go +++ b/builder/oracle/oci/config.hcl2spec.go @@ -23,10 +23,10 @@ type FlatConfig struct { SSHUsername *string `mapstructure:"ssh_username" cty:"ssh_username" hcl:"ssh_username"` SSHPassword *string `mapstructure:"ssh_password" cty:"ssh_password" hcl:"ssh_password"` SSHKeyPairName *string `mapstructure:"ssh_keypair_name" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` - SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` + SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" undocumented:"true" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` SSHCiphers []string `mapstructure:"ssh_ciphers" cty:"ssh_ciphers" hcl:"ssh_ciphers"` SSHClearAuthorizedKeys *bool `mapstructure:"ssh_clear_authorized_keys" cty:"ssh_clear_authorized_keys" hcl:"ssh_clear_authorized_keys"` - SSHPrivateKeyFile *string `mapstructure:"ssh_private_key_file" cty:"ssh_private_key_file" hcl:"ssh_private_key_file"` + SSHPrivateKeyFile *string `mapstructure:"ssh_private_key_file" undocumented:"true" cty:"ssh_private_key_file" hcl:"ssh_private_key_file"` SSHPty *bool `mapstructure:"ssh_pty" cty:"ssh_pty" hcl:"ssh_pty"` SSHTimeout *string `mapstructure:"ssh_timeout" cty:"ssh_timeout" hcl:"ssh_timeout"` SSHWaitTimeout *string `mapstructure:"ssh_wait_timeout" undocumented:"true" cty:"ssh_wait_timeout" hcl:"ssh_wait_timeout"` @@ -49,8 +49,8 @@ type FlatConfig struct { SSHReadWriteTimeout *string `mapstructure:"ssh_read_write_timeout" cty:"ssh_read_write_timeout" hcl:"ssh_read_write_timeout"` SSHRemoteTunnels []string `mapstructure:"ssh_remote_tunnels" cty:"ssh_remote_tunnels" hcl:"ssh_remote_tunnels"` SSHLocalTunnels []string `mapstructure:"ssh_local_tunnels" cty:"ssh_local_tunnels" hcl:"ssh_local_tunnels"` - SSHPublicKey []byte `mapstructure:"ssh_public_key" cty:"ssh_public_key" hcl:"ssh_public_key"` - SSHPrivateKey []byte `mapstructure:"ssh_private_key" cty:"ssh_private_key" hcl:"ssh_private_key"` + SSHPublicKey []byte `mapstructure:"ssh_public_key" undocumented:"true" cty:"ssh_public_key" hcl:"ssh_public_key"` + SSHPrivateKey []byte `mapstructure:"ssh_private_key" undocumented:"true" cty:"ssh_private_key" hcl:"ssh_private_key"` WinRMUser *string `mapstructure:"winrm_username" cty:"winrm_username" hcl:"winrm_username"` WinRMPassword *string `mapstructure:"winrm_password" cty:"winrm_password" hcl:"winrm_password"` WinRMHost *string `mapstructure:"winrm_host" cty:"winrm_host" hcl:"winrm_host"` diff --git a/builder/osc/bsu/builder.hcl2spec.go b/builder/osc/bsu/builder.hcl2spec.go index d4b1a7e14..845674fe2 100644 --- a/builder/osc/bsu/builder.hcl2spec.go +++ b/builder/osc/bsu/builder.hcl2spec.go @@ -78,7 +78,7 @@ type FlatConfig struct { SSHKeyPairName *string `mapstructure:"ssh_keypair_name" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` SSHCiphers []string `mapstructure:"ssh_ciphers" cty:"ssh_ciphers" hcl:"ssh_ciphers"` SSHClearAuthorizedKeys *bool `mapstructure:"ssh_clear_authorized_keys" cty:"ssh_clear_authorized_keys" hcl:"ssh_clear_authorized_keys"` - SSHPrivateKeyFile *string `mapstructure:"ssh_private_key_file" cty:"ssh_private_key_file" hcl:"ssh_private_key_file"` + SSHPrivateKeyFile *string `mapstructure:"ssh_private_key_file" undocumented:"true" cty:"ssh_private_key_file" hcl:"ssh_private_key_file"` SSHPty *bool `mapstructure:"ssh_pty" cty:"ssh_pty" hcl:"ssh_pty"` SSHTimeout *string `mapstructure:"ssh_timeout" cty:"ssh_timeout" hcl:"ssh_timeout"` SSHWaitTimeout *string `mapstructure:"ssh_wait_timeout" undocumented:"true" cty:"ssh_wait_timeout" hcl:"ssh_wait_timeout"` @@ -101,8 +101,8 @@ type FlatConfig struct { SSHReadWriteTimeout *string `mapstructure:"ssh_read_write_timeout" cty:"ssh_read_write_timeout" hcl:"ssh_read_write_timeout"` SSHRemoteTunnels []string `mapstructure:"ssh_remote_tunnels" cty:"ssh_remote_tunnels" hcl:"ssh_remote_tunnels"` SSHLocalTunnels []string `mapstructure:"ssh_local_tunnels" cty:"ssh_local_tunnels" hcl:"ssh_local_tunnels"` - SSHPublicKey []byte `mapstructure:"ssh_public_key" cty:"ssh_public_key" hcl:"ssh_public_key"` - SSHPrivateKey []byte `mapstructure:"ssh_private_key" cty:"ssh_private_key" hcl:"ssh_private_key"` + SSHPublicKey []byte `mapstructure:"ssh_public_key" undocumented:"true" cty:"ssh_public_key" hcl:"ssh_public_key"` + SSHPrivateKey []byte `mapstructure:"ssh_private_key" undocumented:"true" cty:"ssh_private_key" hcl:"ssh_private_key"` WinRMUser *string `mapstructure:"winrm_username" cty:"winrm_username" hcl:"winrm_username"` WinRMPassword *string `mapstructure:"winrm_password" cty:"winrm_password" hcl:"winrm_password"` WinRMHost *string `mapstructure:"winrm_host" cty:"winrm_host" hcl:"winrm_host"` diff --git a/builder/osc/bsusurrogate/builder.hcl2spec.go b/builder/osc/bsusurrogate/builder.hcl2spec.go index 3ae701d28..515920ee0 100644 --- a/builder/osc/bsusurrogate/builder.hcl2spec.go +++ b/builder/osc/bsusurrogate/builder.hcl2spec.go @@ -63,7 +63,7 @@ type FlatConfig struct { SSHKeyPairName *string `mapstructure:"ssh_keypair_name" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` SSHCiphers []string `mapstructure:"ssh_ciphers" cty:"ssh_ciphers" hcl:"ssh_ciphers"` SSHClearAuthorizedKeys *bool `mapstructure:"ssh_clear_authorized_keys" cty:"ssh_clear_authorized_keys" hcl:"ssh_clear_authorized_keys"` - SSHPrivateKeyFile *string `mapstructure:"ssh_private_key_file" cty:"ssh_private_key_file" hcl:"ssh_private_key_file"` + SSHPrivateKeyFile *string `mapstructure:"ssh_private_key_file" undocumented:"true" cty:"ssh_private_key_file" hcl:"ssh_private_key_file"` SSHPty *bool `mapstructure:"ssh_pty" cty:"ssh_pty" hcl:"ssh_pty"` SSHTimeout *string `mapstructure:"ssh_timeout" cty:"ssh_timeout" hcl:"ssh_timeout"` SSHWaitTimeout *string `mapstructure:"ssh_wait_timeout" undocumented:"true" cty:"ssh_wait_timeout" hcl:"ssh_wait_timeout"` @@ -86,8 +86,8 @@ type FlatConfig struct { SSHReadWriteTimeout *string `mapstructure:"ssh_read_write_timeout" cty:"ssh_read_write_timeout" hcl:"ssh_read_write_timeout"` SSHRemoteTunnels []string `mapstructure:"ssh_remote_tunnels" cty:"ssh_remote_tunnels" hcl:"ssh_remote_tunnels"` SSHLocalTunnels []string `mapstructure:"ssh_local_tunnels" cty:"ssh_local_tunnels" hcl:"ssh_local_tunnels"` - SSHPublicKey []byte `mapstructure:"ssh_public_key" cty:"ssh_public_key" hcl:"ssh_public_key"` - SSHPrivateKey []byte `mapstructure:"ssh_private_key" cty:"ssh_private_key" hcl:"ssh_private_key"` + SSHPublicKey []byte `mapstructure:"ssh_public_key" undocumented:"true" cty:"ssh_public_key" hcl:"ssh_public_key"` + SSHPrivateKey []byte `mapstructure:"ssh_private_key" undocumented:"true" cty:"ssh_private_key" hcl:"ssh_private_key"` WinRMUser *string `mapstructure:"winrm_username" cty:"winrm_username" hcl:"winrm_username"` WinRMPassword *string `mapstructure:"winrm_password" cty:"winrm_password" hcl:"winrm_password"` WinRMHost *string `mapstructure:"winrm_host" cty:"winrm_host" hcl:"winrm_host"` diff --git a/builder/osc/bsuvolume/builder.hcl2spec.go b/builder/osc/bsuvolume/builder.hcl2spec.go index 33835bab1..6107dfc3f 100644 --- a/builder/osc/bsuvolume/builder.hcl2spec.go +++ b/builder/osc/bsuvolume/builder.hcl2spec.go @@ -102,7 +102,7 @@ type FlatConfig struct { SSHKeyPairName *string `mapstructure:"ssh_keypair_name" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` SSHCiphers []string `mapstructure:"ssh_ciphers" cty:"ssh_ciphers" hcl:"ssh_ciphers"` SSHClearAuthorizedKeys *bool `mapstructure:"ssh_clear_authorized_keys" cty:"ssh_clear_authorized_keys" hcl:"ssh_clear_authorized_keys"` - SSHPrivateKeyFile *string `mapstructure:"ssh_private_key_file" cty:"ssh_private_key_file" hcl:"ssh_private_key_file"` + SSHPrivateKeyFile *string `mapstructure:"ssh_private_key_file" undocumented:"true" cty:"ssh_private_key_file" hcl:"ssh_private_key_file"` SSHPty *bool `mapstructure:"ssh_pty" cty:"ssh_pty" hcl:"ssh_pty"` SSHTimeout *string `mapstructure:"ssh_timeout" cty:"ssh_timeout" hcl:"ssh_timeout"` SSHWaitTimeout *string `mapstructure:"ssh_wait_timeout" undocumented:"true" cty:"ssh_wait_timeout" hcl:"ssh_wait_timeout"` @@ -125,8 +125,8 @@ type FlatConfig struct { SSHReadWriteTimeout *string `mapstructure:"ssh_read_write_timeout" cty:"ssh_read_write_timeout" hcl:"ssh_read_write_timeout"` SSHRemoteTunnels []string `mapstructure:"ssh_remote_tunnels" cty:"ssh_remote_tunnels" hcl:"ssh_remote_tunnels"` SSHLocalTunnels []string `mapstructure:"ssh_local_tunnels" cty:"ssh_local_tunnels" hcl:"ssh_local_tunnels"` - SSHPublicKey []byte `mapstructure:"ssh_public_key" cty:"ssh_public_key" hcl:"ssh_public_key"` - SSHPrivateKey []byte `mapstructure:"ssh_private_key" cty:"ssh_private_key" hcl:"ssh_private_key"` + SSHPublicKey []byte `mapstructure:"ssh_public_key" undocumented:"true" cty:"ssh_public_key" hcl:"ssh_public_key"` + SSHPrivateKey []byte `mapstructure:"ssh_private_key" undocumented:"true" cty:"ssh_private_key" hcl:"ssh_private_key"` WinRMUser *string `mapstructure:"winrm_username" cty:"winrm_username" hcl:"winrm_username"` WinRMPassword *string `mapstructure:"winrm_password" cty:"winrm_password" hcl:"winrm_password"` WinRMHost *string `mapstructure:"winrm_host" cty:"winrm_host" hcl:"winrm_host"` diff --git a/builder/parallels/iso/builder.hcl2spec.go b/builder/parallels/iso/builder.hcl2spec.go index 560b9d703..fb4ea20f3 100644 --- a/builder/parallels/iso/builder.hcl2spec.go +++ b/builder/parallels/iso/builder.hcl2spec.go @@ -48,10 +48,10 @@ type FlatConfig struct { SSHUsername *string `mapstructure:"ssh_username" cty:"ssh_username" hcl:"ssh_username"` SSHPassword *string `mapstructure:"ssh_password" cty:"ssh_password" hcl:"ssh_password"` SSHKeyPairName *string `mapstructure:"ssh_keypair_name" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` - SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` + SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" undocumented:"true" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` SSHCiphers []string `mapstructure:"ssh_ciphers" cty:"ssh_ciphers" hcl:"ssh_ciphers"` SSHClearAuthorizedKeys *bool `mapstructure:"ssh_clear_authorized_keys" cty:"ssh_clear_authorized_keys" hcl:"ssh_clear_authorized_keys"` - SSHPrivateKeyFile *string `mapstructure:"ssh_private_key_file" cty:"ssh_private_key_file" hcl:"ssh_private_key_file"` + SSHPrivateKeyFile *string `mapstructure:"ssh_private_key_file" undocumented:"true" cty:"ssh_private_key_file" hcl:"ssh_private_key_file"` SSHPty *bool `mapstructure:"ssh_pty" cty:"ssh_pty" hcl:"ssh_pty"` SSHTimeout *string `mapstructure:"ssh_timeout" cty:"ssh_timeout" hcl:"ssh_timeout"` SSHWaitTimeout *string `mapstructure:"ssh_wait_timeout" undocumented:"true" cty:"ssh_wait_timeout" hcl:"ssh_wait_timeout"` @@ -74,8 +74,8 @@ type FlatConfig struct { SSHReadWriteTimeout *string `mapstructure:"ssh_read_write_timeout" cty:"ssh_read_write_timeout" hcl:"ssh_read_write_timeout"` SSHRemoteTunnels []string `mapstructure:"ssh_remote_tunnels" cty:"ssh_remote_tunnels" hcl:"ssh_remote_tunnels"` SSHLocalTunnels []string `mapstructure:"ssh_local_tunnels" cty:"ssh_local_tunnels" hcl:"ssh_local_tunnels"` - SSHPublicKey []byte `mapstructure:"ssh_public_key" cty:"ssh_public_key" hcl:"ssh_public_key"` - SSHPrivateKey []byte `mapstructure:"ssh_private_key" cty:"ssh_private_key" hcl:"ssh_private_key"` + SSHPublicKey []byte `mapstructure:"ssh_public_key" undocumented:"true" cty:"ssh_public_key" hcl:"ssh_public_key"` + SSHPrivateKey []byte `mapstructure:"ssh_private_key" undocumented:"true" cty:"ssh_private_key" hcl:"ssh_private_key"` WinRMUser *string `mapstructure:"winrm_username" cty:"winrm_username" hcl:"winrm_username"` WinRMPassword *string `mapstructure:"winrm_password" cty:"winrm_password" hcl:"winrm_password"` WinRMHost *string `mapstructure:"winrm_host" cty:"winrm_host" hcl:"winrm_host"` diff --git a/builder/parallels/pvm/config.hcl2spec.go b/builder/parallels/pvm/config.hcl2spec.go index c5d2b7558..9e4c9375b 100644 --- a/builder/parallels/pvm/config.hcl2spec.go +++ b/builder/parallels/pvm/config.hcl2spec.go @@ -30,10 +30,10 @@ type FlatConfig struct { SSHUsername *string `mapstructure:"ssh_username" cty:"ssh_username" hcl:"ssh_username"` SSHPassword *string `mapstructure:"ssh_password" cty:"ssh_password" hcl:"ssh_password"` SSHKeyPairName *string `mapstructure:"ssh_keypair_name" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` - SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` + SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" undocumented:"true" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` SSHCiphers []string `mapstructure:"ssh_ciphers" cty:"ssh_ciphers" hcl:"ssh_ciphers"` SSHClearAuthorizedKeys *bool `mapstructure:"ssh_clear_authorized_keys" cty:"ssh_clear_authorized_keys" hcl:"ssh_clear_authorized_keys"` - SSHPrivateKeyFile *string `mapstructure:"ssh_private_key_file" cty:"ssh_private_key_file" hcl:"ssh_private_key_file"` + SSHPrivateKeyFile *string `mapstructure:"ssh_private_key_file" undocumented:"true" cty:"ssh_private_key_file" hcl:"ssh_private_key_file"` SSHPty *bool `mapstructure:"ssh_pty" cty:"ssh_pty" hcl:"ssh_pty"` SSHTimeout *string `mapstructure:"ssh_timeout" cty:"ssh_timeout" hcl:"ssh_timeout"` SSHWaitTimeout *string `mapstructure:"ssh_wait_timeout" undocumented:"true" cty:"ssh_wait_timeout" hcl:"ssh_wait_timeout"` @@ -56,8 +56,8 @@ type FlatConfig struct { SSHReadWriteTimeout *string `mapstructure:"ssh_read_write_timeout" cty:"ssh_read_write_timeout" hcl:"ssh_read_write_timeout"` SSHRemoteTunnels []string `mapstructure:"ssh_remote_tunnels" cty:"ssh_remote_tunnels" hcl:"ssh_remote_tunnels"` SSHLocalTunnels []string `mapstructure:"ssh_local_tunnels" cty:"ssh_local_tunnels" hcl:"ssh_local_tunnels"` - SSHPublicKey []byte `mapstructure:"ssh_public_key" cty:"ssh_public_key" hcl:"ssh_public_key"` - SSHPrivateKey []byte `mapstructure:"ssh_private_key" cty:"ssh_private_key" hcl:"ssh_private_key"` + SSHPublicKey []byte `mapstructure:"ssh_public_key" undocumented:"true" cty:"ssh_public_key" hcl:"ssh_public_key"` + SSHPrivateKey []byte `mapstructure:"ssh_private_key" undocumented:"true" cty:"ssh_private_key" hcl:"ssh_private_key"` WinRMUser *string `mapstructure:"winrm_username" cty:"winrm_username" hcl:"winrm_username"` WinRMPassword *string `mapstructure:"winrm_password" cty:"winrm_password" hcl:"winrm_password"` WinRMHost *string `mapstructure:"winrm_host" cty:"winrm_host" hcl:"winrm_host"` diff --git a/builder/profitbricks/config.hcl2spec.go b/builder/profitbricks/config.hcl2spec.go index 7c6f1d71e..ac2cf09f3 100644 --- a/builder/profitbricks/config.hcl2spec.go +++ b/builder/profitbricks/config.hcl2spec.go @@ -23,10 +23,10 @@ type FlatConfig struct { SSHUsername *string `mapstructure:"ssh_username" cty:"ssh_username" hcl:"ssh_username"` SSHPassword *string `mapstructure:"ssh_password" cty:"ssh_password" hcl:"ssh_password"` SSHKeyPairName *string `mapstructure:"ssh_keypair_name" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` - SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` + SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" undocumented:"true" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` SSHCiphers []string `mapstructure:"ssh_ciphers" cty:"ssh_ciphers" hcl:"ssh_ciphers"` SSHClearAuthorizedKeys *bool `mapstructure:"ssh_clear_authorized_keys" cty:"ssh_clear_authorized_keys" hcl:"ssh_clear_authorized_keys"` - SSHPrivateKeyFile *string `mapstructure:"ssh_private_key_file" cty:"ssh_private_key_file" hcl:"ssh_private_key_file"` + SSHPrivateKeyFile *string `mapstructure:"ssh_private_key_file" undocumented:"true" cty:"ssh_private_key_file" hcl:"ssh_private_key_file"` SSHPty *bool `mapstructure:"ssh_pty" cty:"ssh_pty" hcl:"ssh_pty"` SSHTimeout *string `mapstructure:"ssh_timeout" cty:"ssh_timeout" hcl:"ssh_timeout"` SSHWaitTimeout *string `mapstructure:"ssh_wait_timeout" undocumented:"true" cty:"ssh_wait_timeout" hcl:"ssh_wait_timeout"` @@ -49,8 +49,8 @@ type FlatConfig struct { SSHReadWriteTimeout *string `mapstructure:"ssh_read_write_timeout" cty:"ssh_read_write_timeout" hcl:"ssh_read_write_timeout"` SSHRemoteTunnels []string `mapstructure:"ssh_remote_tunnels" cty:"ssh_remote_tunnels" hcl:"ssh_remote_tunnels"` SSHLocalTunnels []string `mapstructure:"ssh_local_tunnels" cty:"ssh_local_tunnels" hcl:"ssh_local_tunnels"` - SSHPublicKey []byte `mapstructure:"ssh_public_key" cty:"ssh_public_key" hcl:"ssh_public_key"` - SSHPrivateKey []byte `mapstructure:"ssh_private_key" cty:"ssh_private_key" hcl:"ssh_private_key"` + SSHPublicKey []byte `mapstructure:"ssh_public_key" undocumented:"true" cty:"ssh_public_key" hcl:"ssh_public_key"` + SSHPrivateKey []byte `mapstructure:"ssh_private_key" undocumented:"true" cty:"ssh_private_key" hcl:"ssh_private_key"` WinRMUser *string `mapstructure:"winrm_username" cty:"winrm_username" hcl:"winrm_username"` WinRMPassword *string `mapstructure:"winrm_password" cty:"winrm_password" hcl:"winrm_password"` WinRMHost *string `mapstructure:"winrm_host" cty:"winrm_host" hcl:"winrm_host"` diff --git a/builder/proxmox/config.hcl2spec.go b/builder/proxmox/config.hcl2spec.go index 20b664910..944e4ecb0 100644 --- a/builder/proxmox/config.hcl2spec.go +++ b/builder/proxmox/config.hcl2spec.go @@ -36,10 +36,10 @@ type FlatConfig struct { SSHUsername *string `mapstructure:"ssh_username" cty:"ssh_username" hcl:"ssh_username"` SSHPassword *string `mapstructure:"ssh_password" cty:"ssh_password" hcl:"ssh_password"` SSHKeyPairName *string `mapstructure:"ssh_keypair_name" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` - SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` + SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" undocumented:"true" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` SSHCiphers []string `mapstructure:"ssh_ciphers" cty:"ssh_ciphers" hcl:"ssh_ciphers"` SSHClearAuthorizedKeys *bool `mapstructure:"ssh_clear_authorized_keys" cty:"ssh_clear_authorized_keys" hcl:"ssh_clear_authorized_keys"` - SSHPrivateKeyFile *string `mapstructure:"ssh_private_key_file" cty:"ssh_private_key_file" hcl:"ssh_private_key_file"` + SSHPrivateKeyFile *string `mapstructure:"ssh_private_key_file" undocumented:"true" cty:"ssh_private_key_file" hcl:"ssh_private_key_file"` SSHPty *bool `mapstructure:"ssh_pty" cty:"ssh_pty" hcl:"ssh_pty"` SSHTimeout *string `mapstructure:"ssh_timeout" cty:"ssh_timeout" hcl:"ssh_timeout"` SSHWaitTimeout *string `mapstructure:"ssh_wait_timeout" undocumented:"true" cty:"ssh_wait_timeout" hcl:"ssh_wait_timeout"` @@ -62,8 +62,8 @@ type FlatConfig struct { SSHReadWriteTimeout *string `mapstructure:"ssh_read_write_timeout" cty:"ssh_read_write_timeout" hcl:"ssh_read_write_timeout"` SSHRemoteTunnels []string `mapstructure:"ssh_remote_tunnels" cty:"ssh_remote_tunnels" hcl:"ssh_remote_tunnels"` SSHLocalTunnels []string `mapstructure:"ssh_local_tunnels" cty:"ssh_local_tunnels" hcl:"ssh_local_tunnels"` - SSHPublicKey []byte `mapstructure:"ssh_public_key" cty:"ssh_public_key" hcl:"ssh_public_key"` - SSHPrivateKey []byte `mapstructure:"ssh_private_key" cty:"ssh_private_key" hcl:"ssh_private_key"` + SSHPublicKey []byte `mapstructure:"ssh_public_key" undocumented:"true" cty:"ssh_public_key" hcl:"ssh_public_key"` + SSHPrivateKey []byte `mapstructure:"ssh_private_key" undocumented:"true" cty:"ssh_private_key" hcl:"ssh_private_key"` WinRMUser *string `mapstructure:"winrm_username" cty:"winrm_username" hcl:"winrm_username"` WinRMPassword *string `mapstructure:"winrm_password" cty:"winrm_password" hcl:"winrm_password"` WinRMHost *string `mapstructure:"winrm_host" cty:"winrm_host" hcl:"winrm_host"` diff --git a/builder/qemu/builder.hcl2spec.go b/builder/qemu/builder.hcl2spec.go index be4ddc7e9..40ffec016 100644 --- a/builder/qemu/builder.hcl2spec.go +++ b/builder/qemu/builder.hcl2spec.go @@ -39,10 +39,10 @@ type FlatConfig struct { SSHUsername *string `mapstructure:"ssh_username" cty:"ssh_username" hcl:"ssh_username"` SSHPassword *string `mapstructure:"ssh_password" cty:"ssh_password" hcl:"ssh_password"` SSHKeyPairName *string `mapstructure:"ssh_keypair_name" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` - SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` + SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" undocumented:"true" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` SSHCiphers []string `mapstructure:"ssh_ciphers" cty:"ssh_ciphers" hcl:"ssh_ciphers"` SSHClearAuthorizedKeys *bool `mapstructure:"ssh_clear_authorized_keys" cty:"ssh_clear_authorized_keys" hcl:"ssh_clear_authorized_keys"` - SSHPrivateKeyFile *string `mapstructure:"ssh_private_key_file" cty:"ssh_private_key_file" hcl:"ssh_private_key_file"` + SSHPrivateKeyFile *string `mapstructure:"ssh_private_key_file" undocumented:"true" cty:"ssh_private_key_file" hcl:"ssh_private_key_file"` SSHPty *bool `mapstructure:"ssh_pty" cty:"ssh_pty" hcl:"ssh_pty"` SSHTimeout *string `mapstructure:"ssh_timeout" cty:"ssh_timeout" hcl:"ssh_timeout"` SSHWaitTimeout *string `mapstructure:"ssh_wait_timeout" undocumented:"true" cty:"ssh_wait_timeout" hcl:"ssh_wait_timeout"` @@ -65,8 +65,8 @@ type FlatConfig struct { SSHReadWriteTimeout *string `mapstructure:"ssh_read_write_timeout" cty:"ssh_read_write_timeout" hcl:"ssh_read_write_timeout"` SSHRemoteTunnels []string `mapstructure:"ssh_remote_tunnels" cty:"ssh_remote_tunnels" hcl:"ssh_remote_tunnels"` SSHLocalTunnels []string `mapstructure:"ssh_local_tunnels" cty:"ssh_local_tunnels" hcl:"ssh_local_tunnels"` - SSHPublicKey []byte `mapstructure:"ssh_public_key" cty:"ssh_public_key" hcl:"ssh_public_key"` - SSHPrivateKey []byte `mapstructure:"ssh_private_key" cty:"ssh_private_key" hcl:"ssh_private_key"` + SSHPublicKey []byte `mapstructure:"ssh_public_key" undocumented:"true" cty:"ssh_public_key" hcl:"ssh_public_key"` + SSHPrivateKey []byte `mapstructure:"ssh_private_key" undocumented:"true" cty:"ssh_private_key" hcl:"ssh_private_key"` WinRMUser *string `mapstructure:"winrm_username" cty:"winrm_username" hcl:"winrm_username"` WinRMPassword *string `mapstructure:"winrm_password" cty:"winrm_password" hcl:"winrm_password"` WinRMHost *string `mapstructure:"winrm_host" cty:"winrm_host" hcl:"winrm_host"` diff --git a/builder/scaleway/config.hcl2spec.go b/builder/scaleway/config.hcl2spec.go index d1910e18e..10f9a8087 100644 --- a/builder/scaleway/config.hcl2spec.go +++ b/builder/scaleway/config.hcl2spec.go @@ -23,10 +23,10 @@ type FlatConfig struct { SSHUsername *string `mapstructure:"ssh_username" cty:"ssh_username" hcl:"ssh_username"` SSHPassword *string `mapstructure:"ssh_password" cty:"ssh_password" hcl:"ssh_password"` SSHKeyPairName *string `mapstructure:"ssh_keypair_name" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` - SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` + SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" undocumented:"true" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` SSHCiphers []string `mapstructure:"ssh_ciphers" cty:"ssh_ciphers" hcl:"ssh_ciphers"` SSHClearAuthorizedKeys *bool `mapstructure:"ssh_clear_authorized_keys" cty:"ssh_clear_authorized_keys" hcl:"ssh_clear_authorized_keys"` - SSHPrivateKeyFile *string `mapstructure:"ssh_private_key_file" cty:"ssh_private_key_file" hcl:"ssh_private_key_file"` + SSHPrivateKeyFile *string `mapstructure:"ssh_private_key_file" undocumented:"true" cty:"ssh_private_key_file" hcl:"ssh_private_key_file"` SSHPty *bool `mapstructure:"ssh_pty" cty:"ssh_pty" hcl:"ssh_pty"` SSHTimeout *string `mapstructure:"ssh_timeout" cty:"ssh_timeout" hcl:"ssh_timeout"` SSHWaitTimeout *string `mapstructure:"ssh_wait_timeout" undocumented:"true" cty:"ssh_wait_timeout" hcl:"ssh_wait_timeout"` @@ -49,8 +49,8 @@ type FlatConfig struct { SSHReadWriteTimeout *string `mapstructure:"ssh_read_write_timeout" cty:"ssh_read_write_timeout" hcl:"ssh_read_write_timeout"` SSHRemoteTunnels []string `mapstructure:"ssh_remote_tunnels" cty:"ssh_remote_tunnels" hcl:"ssh_remote_tunnels"` SSHLocalTunnels []string `mapstructure:"ssh_local_tunnels" cty:"ssh_local_tunnels" hcl:"ssh_local_tunnels"` - SSHPublicKey []byte `mapstructure:"ssh_public_key" cty:"ssh_public_key" hcl:"ssh_public_key"` - SSHPrivateKey []byte `mapstructure:"ssh_private_key" cty:"ssh_private_key" hcl:"ssh_private_key"` + SSHPublicKey []byte `mapstructure:"ssh_public_key" undocumented:"true" cty:"ssh_public_key" hcl:"ssh_public_key"` + SSHPrivateKey []byte `mapstructure:"ssh_private_key" undocumented:"true" cty:"ssh_private_key" hcl:"ssh_private_key"` WinRMUser *string `mapstructure:"winrm_username" cty:"winrm_username" hcl:"winrm_username"` WinRMPassword *string `mapstructure:"winrm_password" cty:"winrm_password" hcl:"winrm_password"` WinRMHost *string `mapstructure:"winrm_host" cty:"winrm_host" hcl:"winrm_host"` diff --git a/builder/tencentcloud/cvm/builder.hcl2spec.go b/builder/tencentcloud/cvm/builder.hcl2spec.go index c9876c34c..c472e3ad6 100644 --- a/builder/tencentcloud/cvm/builder.hcl2spec.go +++ b/builder/tencentcloud/cvm/builder.hcl2spec.go @@ -60,10 +60,10 @@ type FlatConfig struct { SSHUsername *string `mapstructure:"ssh_username" cty:"ssh_username" hcl:"ssh_username"` SSHPassword *string `mapstructure:"ssh_password" cty:"ssh_password" hcl:"ssh_password"` SSHKeyPairName *string `mapstructure:"ssh_keypair_name" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` - SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` + SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" undocumented:"true" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` SSHCiphers []string `mapstructure:"ssh_ciphers" cty:"ssh_ciphers" hcl:"ssh_ciphers"` SSHClearAuthorizedKeys *bool `mapstructure:"ssh_clear_authorized_keys" cty:"ssh_clear_authorized_keys" hcl:"ssh_clear_authorized_keys"` - SSHPrivateKeyFile *string `mapstructure:"ssh_private_key_file" cty:"ssh_private_key_file" hcl:"ssh_private_key_file"` + SSHPrivateKeyFile *string `mapstructure:"ssh_private_key_file" undocumented:"true" cty:"ssh_private_key_file" hcl:"ssh_private_key_file"` SSHPty *bool `mapstructure:"ssh_pty" cty:"ssh_pty" hcl:"ssh_pty"` SSHTimeout *string `mapstructure:"ssh_timeout" cty:"ssh_timeout" hcl:"ssh_timeout"` SSHWaitTimeout *string `mapstructure:"ssh_wait_timeout" undocumented:"true" cty:"ssh_wait_timeout" hcl:"ssh_wait_timeout"` @@ -86,8 +86,8 @@ type FlatConfig struct { SSHReadWriteTimeout *string `mapstructure:"ssh_read_write_timeout" cty:"ssh_read_write_timeout" hcl:"ssh_read_write_timeout"` SSHRemoteTunnels []string `mapstructure:"ssh_remote_tunnels" cty:"ssh_remote_tunnels" hcl:"ssh_remote_tunnels"` SSHLocalTunnels []string `mapstructure:"ssh_local_tunnels" cty:"ssh_local_tunnels" hcl:"ssh_local_tunnels"` - SSHPublicKey []byte `mapstructure:"ssh_public_key" cty:"ssh_public_key" hcl:"ssh_public_key"` - SSHPrivateKey []byte `mapstructure:"ssh_private_key" cty:"ssh_private_key" hcl:"ssh_private_key"` + SSHPublicKey []byte `mapstructure:"ssh_public_key" undocumented:"true" cty:"ssh_public_key" hcl:"ssh_public_key"` + SSHPrivateKey []byte `mapstructure:"ssh_private_key" undocumented:"true" cty:"ssh_private_key" hcl:"ssh_private_key"` WinRMUser *string `mapstructure:"winrm_username" cty:"winrm_username" hcl:"winrm_username"` WinRMPassword *string `mapstructure:"winrm_password" cty:"winrm_password" hcl:"winrm_password"` WinRMHost *string `mapstructure:"winrm_host" cty:"winrm_host" hcl:"winrm_host"` diff --git a/builder/triton/config.hcl2spec.go b/builder/triton/config.hcl2spec.go index c4aa1f983..2de450b7a 100644 --- a/builder/triton/config.hcl2spec.go +++ b/builder/triton/config.hcl2spec.go @@ -47,10 +47,10 @@ type FlatConfig struct { SSHUsername *string `mapstructure:"ssh_username" cty:"ssh_username" hcl:"ssh_username"` SSHPassword *string `mapstructure:"ssh_password" cty:"ssh_password" hcl:"ssh_password"` SSHKeyPairName *string `mapstructure:"ssh_keypair_name" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` - SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` + SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" undocumented:"true" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` SSHCiphers []string `mapstructure:"ssh_ciphers" cty:"ssh_ciphers" hcl:"ssh_ciphers"` SSHClearAuthorizedKeys *bool `mapstructure:"ssh_clear_authorized_keys" cty:"ssh_clear_authorized_keys" hcl:"ssh_clear_authorized_keys"` - SSHPrivateKeyFile *string `mapstructure:"ssh_private_key_file" cty:"ssh_private_key_file" hcl:"ssh_private_key_file"` + SSHPrivateKeyFile *string `mapstructure:"ssh_private_key_file" undocumented:"true" cty:"ssh_private_key_file" hcl:"ssh_private_key_file"` SSHPty *bool `mapstructure:"ssh_pty" cty:"ssh_pty" hcl:"ssh_pty"` SSHTimeout *string `mapstructure:"ssh_timeout" cty:"ssh_timeout" hcl:"ssh_timeout"` SSHWaitTimeout *string `mapstructure:"ssh_wait_timeout" undocumented:"true" cty:"ssh_wait_timeout" hcl:"ssh_wait_timeout"` @@ -73,8 +73,8 @@ type FlatConfig struct { SSHReadWriteTimeout *string `mapstructure:"ssh_read_write_timeout" cty:"ssh_read_write_timeout" hcl:"ssh_read_write_timeout"` SSHRemoteTunnels []string `mapstructure:"ssh_remote_tunnels" cty:"ssh_remote_tunnels" hcl:"ssh_remote_tunnels"` SSHLocalTunnels []string `mapstructure:"ssh_local_tunnels" cty:"ssh_local_tunnels" hcl:"ssh_local_tunnels"` - SSHPublicKey []byte `mapstructure:"ssh_public_key" cty:"ssh_public_key" hcl:"ssh_public_key"` - SSHPrivateKey []byte `mapstructure:"ssh_private_key" cty:"ssh_private_key" hcl:"ssh_private_key"` + SSHPublicKey []byte `mapstructure:"ssh_public_key" undocumented:"true" cty:"ssh_public_key" hcl:"ssh_public_key"` + SSHPrivateKey []byte `mapstructure:"ssh_private_key" undocumented:"true" cty:"ssh_private_key" hcl:"ssh_private_key"` WinRMUser *string `mapstructure:"winrm_username" cty:"winrm_username" hcl:"winrm_username"` WinRMPassword *string `mapstructure:"winrm_password" cty:"winrm_password" hcl:"winrm_password"` WinRMHost *string `mapstructure:"winrm_host" cty:"winrm_host" hcl:"winrm_host"` diff --git a/builder/ucloud/uhost/builder.hcl2spec.go b/builder/ucloud/uhost/builder.hcl2spec.go index 47ec36f2e..694d4abec 100644 --- a/builder/ucloud/uhost/builder.hcl2spec.go +++ b/builder/ucloud/uhost/builder.hcl2spec.go @@ -48,10 +48,10 @@ type FlatConfig struct { SSHUsername *string `mapstructure:"ssh_username" cty:"ssh_username" hcl:"ssh_username"` SSHPassword *string `mapstructure:"ssh_password" cty:"ssh_password" hcl:"ssh_password"` SSHKeyPairName *string `mapstructure:"ssh_keypair_name" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` - SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` + SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" undocumented:"true" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` SSHCiphers []string `mapstructure:"ssh_ciphers" cty:"ssh_ciphers" hcl:"ssh_ciphers"` SSHClearAuthorizedKeys *bool `mapstructure:"ssh_clear_authorized_keys" cty:"ssh_clear_authorized_keys" hcl:"ssh_clear_authorized_keys"` - SSHPrivateKeyFile *string `mapstructure:"ssh_private_key_file" cty:"ssh_private_key_file" hcl:"ssh_private_key_file"` + SSHPrivateKeyFile *string `mapstructure:"ssh_private_key_file" undocumented:"true" cty:"ssh_private_key_file" hcl:"ssh_private_key_file"` SSHPty *bool `mapstructure:"ssh_pty" cty:"ssh_pty" hcl:"ssh_pty"` SSHTimeout *string `mapstructure:"ssh_timeout" cty:"ssh_timeout" hcl:"ssh_timeout"` SSHWaitTimeout *string `mapstructure:"ssh_wait_timeout" undocumented:"true" cty:"ssh_wait_timeout" hcl:"ssh_wait_timeout"` @@ -74,8 +74,8 @@ type FlatConfig struct { SSHReadWriteTimeout *string `mapstructure:"ssh_read_write_timeout" cty:"ssh_read_write_timeout" hcl:"ssh_read_write_timeout"` SSHRemoteTunnels []string `mapstructure:"ssh_remote_tunnels" cty:"ssh_remote_tunnels" hcl:"ssh_remote_tunnels"` SSHLocalTunnels []string `mapstructure:"ssh_local_tunnels" cty:"ssh_local_tunnels" hcl:"ssh_local_tunnels"` - SSHPublicKey []byte `mapstructure:"ssh_public_key" cty:"ssh_public_key" hcl:"ssh_public_key"` - SSHPrivateKey []byte `mapstructure:"ssh_private_key" cty:"ssh_private_key" hcl:"ssh_private_key"` + SSHPublicKey []byte `mapstructure:"ssh_public_key" undocumented:"true" cty:"ssh_public_key" hcl:"ssh_public_key"` + SSHPrivateKey []byte `mapstructure:"ssh_private_key" undocumented:"true" cty:"ssh_private_key" hcl:"ssh_private_key"` WinRMUser *string `mapstructure:"winrm_username" cty:"winrm_username" hcl:"winrm_username"` WinRMPassword *string `mapstructure:"winrm_password" cty:"winrm_password" hcl:"winrm_password"` WinRMHost *string `mapstructure:"winrm_host" cty:"winrm_host" hcl:"winrm_host"` diff --git a/builder/vagrant/builder.hcl2spec.go b/builder/vagrant/builder.hcl2spec.go index bd80426a3..1bb889096 100644 --- a/builder/vagrant/builder.hcl2spec.go +++ b/builder/vagrant/builder.hcl2spec.go @@ -38,10 +38,10 @@ type FlatConfig struct { SSHUsername *string `mapstructure:"ssh_username" cty:"ssh_username" hcl:"ssh_username"` SSHPassword *string `mapstructure:"ssh_password" cty:"ssh_password" hcl:"ssh_password"` SSHKeyPairName *string `mapstructure:"ssh_keypair_name" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` - SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` + SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" undocumented:"true" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` SSHCiphers []string `mapstructure:"ssh_ciphers" cty:"ssh_ciphers" hcl:"ssh_ciphers"` SSHClearAuthorizedKeys *bool `mapstructure:"ssh_clear_authorized_keys" cty:"ssh_clear_authorized_keys" hcl:"ssh_clear_authorized_keys"` - SSHPrivateKeyFile *string `mapstructure:"ssh_private_key_file" cty:"ssh_private_key_file" hcl:"ssh_private_key_file"` + SSHPrivateKeyFile *string `mapstructure:"ssh_private_key_file" undocumented:"true" cty:"ssh_private_key_file" hcl:"ssh_private_key_file"` SSHPty *bool `mapstructure:"ssh_pty" cty:"ssh_pty" hcl:"ssh_pty"` SSHTimeout *string `mapstructure:"ssh_timeout" cty:"ssh_timeout" hcl:"ssh_timeout"` SSHWaitTimeout *string `mapstructure:"ssh_wait_timeout" undocumented:"true" cty:"ssh_wait_timeout" hcl:"ssh_wait_timeout"` @@ -64,8 +64,8 @@ type FlatConfig struct { SSHReadWriteTimeout *string `mapstructure:"ssh_read_write_timeout" cty:"ssh_read_write_timeout" hcl:"ssh_read_write_timeout"` SSHRemoteTunnels []string `mapstructure:"ssh_remote_tunnels" cty:"ssh_remote_tunnels" hcl:"ssh_remote_tunnels"` SSHLocalTunnels []string `mapstructure:"ssh_local_tunnels" cty:"ssh_local_tunnels" hcl:"ssh_local_tunnels"` - SSHPublicKey []byte `mapstructure:"ssh_public_key" cty:"ssh_public_key" hcl:"ssh_public_key"` - SSHPrivateKey []byte `mapstructure:"ssh_private_key" cty:"ssh_private_key" hcl:"ssh_private_key"` + SSHPublicKey []byte `mapstructure:"ssh_public_key" undocumented:"true" cty:"ssh_public_key" hcl:"ssh_public_key"` + SSHPrivateKey []byte `mapstructure:"ssh_private_key" undocumented:"true" cty:"ssh_private_key" hcl:"ssh_private_key"` WinRMUser *string `mapstructure:"winrm_username" cty:"winrm_username" hcl:"winrm_username"` WinRMPassword *string `mapstructure:"winrm_password" cty:"winrm_password" hcl:"winrm_password"` WinRMHost *string `mapstructure:"winrm_host" cty:"winrm_host" hcl:"winrm_host"` diff --git a/builder/virtualbox/iso/builder.hcl2spec.go b/builder/virtualbox/iso/builder.hcl2spec.go index 17d037c0b..25752cc13 100644 --- a/builder/virtualbox/iso/builder.hcl2spec.go +++ b/builder/virtualbox/iso/builder.hcl2spec.go @@ -51,10 +51,10 @@ type FlatConfig struct { SSHUsername *string `mapstructure:"ssh_username" cty:"ssh_username" hcl:"ssh_username"` SSHPassword *string `mapstructure:"ssh_password" cty:"ssh_password" hcl:"ssh_password"` SSHKeyPairName *string `mapstructure:"ssh_keypair_name" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` - SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` + SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" undocumented:"true" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` SSHCiphers []string `mapstructure:"ssh_ciphers" cty:"ssh_ciphers" hcl:"ssh_ciphers"` SSHClearAuthorizedKeys *bool `mapstructure:"ssh_clear_authorized_keys" cty:"ssh_clear_authorized_keys" hcl:"ssh_clear_authorized_keys"` - SSHPrivateKeyFile *string `mapstructure:"ssh_private_key_file" cty:"ssh_private_key_file" hcl:"ssh_private_key_file"` + SSHPrivateKeyFile *string `mapstructure:"ssh_private_key_file" undocumented:"true" cty:"ssh_private_key_file" hcl:"ssh_private_key_file"` SSHPty *bool `mapstructure:"ssh_pty" cty:"ssh_pty" hcl:"ssh_pty"` SSHTimeout *string `mapstructure:"ssh_timeout" cty:"ssh_timeout" hcl:"ssh_timeout"` SSHWaitTimeout *string `mapstructure:"ssh_wait_timeout" undocumented:"true" cty:"ssh_wait_timeout" hcl:"ssh_wait_timeout"` @@ -77,8 +77,8 @@ type FlatConfig struct { SSHReadWriteTimeout *string `mapstructure:"ssh_read_write_timeout" cty:"ssh_read_write_timeout" hcl:"ssh_read_write_timeout"` SSHRemoteTunnels []string `mapstructure:"ssh_remote_tunnels" cty:"ssh_remote_tunnels" hcl:"ssh_remote_tunnels"` SSHLocalTunnels []string `mapstructure:"ssh_local_tunnels" cty:"ssh_local_tunnels" hcl:"ssh_local_tunnels"` - SSHPublicKey []byte `mapstructure:"ssh_public_key" cty:"ssh_public_key" hcl:"ssh_public_key"` - SSHPrivateKey []byte `mapstructure:"ssh_private_key" cty:"ssh_private_key" hcl:"ssh_private_key"` + SSHPublicKey []byte `mapstructure:"ssh_public_key" undocumented:"true" cty:"ssh_public_key" hcl:"ssh_public_key"` + SSHPrivateKey []byte `mapstructure:"ssh_private_key" undocumented:"true" cty:"ssh_private_key" hcl:"ssh_private_key"` WinRMUser *string `mapstructure:"winrm_username" cty:"winrm_username" hcl:"winrm_username"` WinRMPassword *string `mapstructure:"winrm_password" cty:"winrm_password" hcl:"winrm_password"` WinRMHost *string `mapstructure:"winrm_host" cty:"winrm_host" hcl:"winrm_host"` diff --git a/builder/virtualbox/ovf/config.hcl2spec.go b/builder/virtualbox/ovf/config.hcl2spec.go index 7f5378568..2965e3b96 100644 --- a/builder/virtualbox/ovf/config.hcl2spec.go +++ b/builder/virtualbox/ovf/config.hcl2spec.go @@ -41,10 +41,10 @@ type FlatConfig struct { SSHUsername *string `mapstructure:"ssh_username" cty:"ssh_username" hcl:"ssh_username"` SSHPassword *string `mapstructure:"ssh_password" cty:"ssh_password" hcl:"ssh_password"` SSHKeyPairName *string `mapstructure:"ssh_keypair_name" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` - SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` + SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" undocumented:"true" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` SSHCiphers []string `mapstructure:"ssh_ciphers" cty:"ssh_ciphers" hcl:"ssh_ciphers"` SSHClearAuthorizedKeys *bool `mapstructure:"ssh_clear_authorized_keys" cty:"ssh_clear_authorized_keys" hcl:"ssh_clear_authorized_keys"` - SSHPrivateKeyFile *string `mapstructure:"ssh_private_key_file" cty:"ssh_private_key_file" hcl:"ssh_private_key_file"` + SSHPrivateKeyFile *string `mapstructure:"ssh_private_key_file" undocumented:"true" cty:"ssh_private_key_file" hcl:"ssh_private_key_file"` SSHPty *bool `mapstructure:"ssh_pty" cty:"ssh_pty" hcl:"ssh_pty"` SSHTimeout *string `mapstructure:"ssh_timeout" cty:"ssh_timeout" hcl:"ssh_timeout"` SSHWaitTimeout *string `mapstructure:"ssh_wait_timeout" undocumented:"true" cty:"ssh_wait_timeout" hcl:"ssh_wait_timeout"` @@ -67,8 +67,8 @@ type FlatConfig struct { SSHReadWriteTimeout *string `mapstructure:"ssh_read_write_timeout" cty:"ssh_read_write_timeout" hcl:"ssh_read_write_timeout"` SSHRemoteTunnels []string `mapstructure:"ssh_remote_tunnels" cty:"ssh_remote_tunnels" hcl:"ssh_remote_tunnels"` SSHLocalTunnels []string `mapstructure:"ssh_local_tunnels" cty:"ssh_local_tunnels" hcl:"ssh_local_tunnels"` - SSHPublicKey []byte `mapstructure:"ssh_public_key" cty:"ssh_public_key" hcl:"ssh_public_key"` - SSHPrivateKey []byte `mapstructure:"ssh_private_key" cty:"ssh_private_key" hcl:"ssh_private_key"` + SSHPublicKey []byte `mapstructure:"ssh_public_key" undocumented:"true" cty:"ssh_public_key" hcl:"ssh_public_key"` + SSHPrivateKey []byte `mapstructure:"ssh_private_key" undocumented:"true" cty:"ssh_private_key" hcl:"ssh_private_key"` WinRMUser *string `mapstructure:"winrm_username" cty:"winrm_username" hcl:"winrm_username"` WinRMPassword *string `mapstructure:"winrm_password" cty:"winrm_password" hcl:"winrm_password"` WinRMHost *string `mapstructure:"winrm_host" cty:"winrm_host" hcl:"winrm_host"` diff --git a/builder/virtualbox/vm/config.hcl2spec.go b/builder/virtualbox/vm/config.hcl2spec.go index 84622cfba..9a767261e 100644 --- a/builder/virtualbox/vm/config.hcl2spec.go +++ b/builder/virtualbox/vm/config.hcl2spec.go @@ -41,10 +41,10 @@ type FlatConfig struct { SSHUsername *string `mapstructure:"ssh_username" cty:"ssh_username" hcl:"ssh_username"` SSHPassword *string `mapstructure:"ssh_password" cty:"ssh_password" hcl:"ssh_password"` SSHKeyPairName *string `mapstructure:"ssh_keypair_name" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` - SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` + SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" undocumented:"true" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` SSHCiphers []string `mapstructure:"ssh_ciphers" cty:"ssh_ciphers" hcl:"ssh_ciphers"` SSHClearAuthorizedKeys *bool `mapstructure:"ssh_clear_authorized_keys" cty:"ssh_clear_authorized_keys" hcl:"ssh_clear_authorized_keys"` - SSHPrivateKeyFile *string `mapstructure:"ssh_private_key_file" cty:"ssh_private_key_file" hcl:"ssh_private_key_file"` + SSHPrivateKeyFile *string `mapstructure:"ssh_private_key_file" undocumented:"true" cty:"ssh_private_key_file" hcl:"ssh_private_key_file"` SSHPty *bool `mapstructure:"ssh_pty" cty:"ssh_pty" hcl:"ssh_pty"` SSHTimeout *string `mapstructure:"ssh_timeout" cty:"ssh_timeout" hcl:"ssh_timeout"` SSHWaitTimeout *string `mapstructure:"ssh_wait_timeout" undocumented:"true" cty:"ssh_wait_timeout" hcl:"ssh_wait_timeout"` @@ -67,8 +67,8 @@ type FlatConfig struct { SSHReadWriteTimeout *string `mapstructure:"ssh_read_write_timeout" cty:"ssh_read_write_timeout" hcl:"ssh_read_write_timeout"` SSHRemoteTunnels []string `mapstructure:"ssh_remote_tunnels" cty:"ssh_remote_tunnels" hcl:"ssh_remote_tunnels"` SSHLocalTunnels []string `mapstructure:"ssh_local_tunnels" cty:"ssh_local_tunnels" hcl:"ssh_local_tunnels"` - SSHPublicKey []byte `mapstructure:"ssh_public_key" cty:"ssh_public_key" hcl:"ssh_public_key"` - SSHPrivateKey []byte `mapstructure:"ssh_private_key" cty:"ssh_private_key" hcl:"ssh_private_key"` + SSHPublicKey []byte `mapstructure:"ssh_public_key" undocumented:"true" cty:"ssh_public_key" hcl:"ssh_public_key"` + SSHPrivateKey []byte `mapstructure:"ssh_private_key" undocumented:"true" cty:"ssh_private_key" hcl:"ssh_private_key"` WinRMUser *string `mapstructure:"winrm_username" cty:"winrm_username" hcl:"winrm_username"` WinRMPassword *string `mapstructure:"winrm_password" cty:"winrm_password" hcl:"winrm_password"` WinRMHost *string `mapstructure:"winrm_host" cty:"winrm_host" hcl:"winrm_host"` diff --git a/builder/vmware/iso/config.hcl2spec.go b/builder/vmware/iso/config.hcl2spec.go index 078c06927..2768d8866 100644 --- a/builder/vmware/iso/config.hcl2spec.go +++ b/builder/vmware/iso/config.hcl2spec.go @@ -69,10 +69,10 @@ type FlatConfig struct { SSHUsername *string `mapstructure:"ssh_username" cty:"ssh_username" hcl:"ssh_username"` SSHPassword *string `mapstructure:"ssh_password" cty:"ssh_password" hcl:"ssh_password"` SSHKeyPairName *string `mapstructure:"ssh_keypair_name" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` - SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` + SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" undocumented:"true" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` SSHCiphers []string `mapstructure:"ssh_ciphers" cty:"ssh_ciphers" hcl:"ssh_ciphers"` SSHClearAuthorizedKeys *bool `mapstructure:"ssh_clear_authorized_keys" cty:"ssh_clear_authorized_keys" hcl:"ssh_clear_authorized_keys"` - SSHPrivateKeyFile *string `mapstructure:"ssh_private_key_file" cty:"ssh_private_key_file" hcl:"ssh_private_key_file"` + SSHPrivateKeyFile *string `mapstructure:"ssh_private_key_file" undocumented:"true" cty:"ssh_private_key_file" hcl:"ssh_private_key_file"` SSHPty *bool `mapstructure:"ssh_pty" cty:"ssh_pty" hcl:"ssh_pty"` SSHTimeout *string `mapstructure:"ssh_timeout" cty:"ssh_timeout" hcl:"ssh_timeout"` SSHWaitTimeout *string `mapstructure:"ssh_wait_timeout" undocumented:"true" cty:"ssh_wait_timeout" hcl:"ssh_wait_timeout"` @@ -95,8 +95,8 @@ type FlatConfig struct { SSHReadWriteTimeout *string `mapstructure:"ssh_read_write_timeout" cty:"ssh_read_write_timeout" hcl:"ssh_read_write_timeout"` SSHRemoteTunnels []string `mapstructure:"ssh_remote_tunnels" cty:"ssh_remote_tunnels" hcl:"ssh_remote_tunnels"` SSHLocalTunnels []string `mapstructure:"ssh_local_tunnels" cty:"ssh_local_tunnels" hcl:"ssh_local_tunnels"` - SSHPublicKey []byte `mapstructure:"ssh_public_key" cty:"ssh_public_key" hcl:"ssh_public_key"` - SSHPrivateKey []byte `mapstructure:"ssh_private_key" cty:"ssh_private_key" hcl:"ssh_private_key"` + SSHPublicKey []byte `mapstructure:"ssh_public_key" undocumented:"true" cty:"ssh_public_key" hcl:"ssh_public_key"` + SSHPrivateKey []byte `mapstructure:"ssh_private_key" undocumented:"true" cty:"ssh_private_key" hcl:"ssh_private_key"` WinRMUser *string `mapstructure:"winrm_username" cty:"winrm_username" hcl:"winrm_username"` WinRMPassword *string `mapstructure:"winrm_password" cty:"winrm_password" hcl:"winrm_password"` WinRMHost *string `mapstructure:"winrm_host" cty:"winrm_host" hcl:"winrm_host"` diff --git a/builder/vmware/vmx/config.hcl2spec.go b/builder/vmware/vmx/config.hcl2spec.go index be74342f0..4282ef5b2 100644 --- a/builder/vmware/vmx/config.hcl2spec.go +++ b/builder/vmware/vmx/config.hcl2spec.go @@ -55,10 +55,10 @@ type FlatConfig struct { SSHUsername *string `mapstructure:"ssh_username" cty:"ssh_username" hcl:"ssh_username"` SSHPassword *string `mapstructure:"ssh_password" cty:"ssh_password" hcl:"ssh_password"` SSHKeyPairName *string `mapstructure:"ssh_keypair_name" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` - SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` + SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" undocumented:"true" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` SSHCiphers []string `mapstructure:"ssh_ciphers" cty:"ssh_ciphers" hcl:"ssh_ciphers"` SSHClearAuthorizedKeys *bool `mapstructure:"ssh_clear_authorized_keys" cty:"ssh_clear_authorized_keys" hcl:"ssh_clear_authorized_keys"` - SSHPrivateKeyFile *string `mapstructure:"ssh_private_key_file" cty:"ssh_private_key_file" hcl:"ssh_private_key_file"` + SSHPrivateKeyFile *string `mapstructure:"ssh_private_key_file" undocumented:"true" cty:"ssh_private_key_file" hcl:"ssh_private_key_file"` SSHPty *bool `mapstructure:"ssh_pty" cty:"ssh_pty" hcl:"ssh_pty"` SSHTimeout *string `mapstructure:"ssh_timeout" cty:"ssh_timeout" hcl:"ssh_timeout"` SSHWaitTimeout *string `mapstructure:"ssh_wait_timeout" undocumented:"true" cty:"ssh_wait_timeout" hcl:"ssh_wait_timeout"` @@ -81,8 +81,8 @@ type FlatConfig struct { SSHReadWriteTimeout *string `mapstructure:"ssh_read_write_timeout" cty:"ssh_read_write_timeout" hcl:"ssh_read_write_timeout"` SSHRemoteTunnels []string `mapstructure:"ssh_remote_tunnels" cty:"ssh_remote_tunnels" hcl:"ssh_remote_tunnels"` SSHLocalTunnels []string `mapstructure:"ssh_local_tunnels" cty:"ssh_local_tunnels" hcl:"ssh_local_tunnels"` - SSHPublicKey []byte `mapstructure:"ssh_public_key" cty:"ssh_public_key" hcl:"ssh_public_key"` - SSHPrivateKey []byte `mapstructure:"ssh_private_key" cty:"ssh_private_key" hcl:"ssh_private_key"` + SSHPublicKey []byte `mapstructure:"ssh_public_key" undocumented:"true" cty:"ssh_public_key" hcl:"ssh_public_key"` + SSHPrivateKey []byte `mapstructure:"ssh_private_key" undocumented:"true" cty:"ssh_private_key" hcl:"ssh_private_key"` WinRMUser *string `mapstructure:"winrm_username" cty:"winrm_username" hcl:"winrm_username"` WinRMPassword *string `mapstructure:"winrm_password" cty:"winrm_password" hcl:"winrm_password"` WinRMHost *string `mapstructure:"winrm_host" cty:"winrm_host" hcl:"winrm_host"` diff --git a/builder/vsphere/clone/config.hcl2spec.go b/builder/vsphere/clone/config.hcl2spec.go index 1decc7cd9..e636c6b95 100644 --- a/builder/vsphere/clone/config.hcl2spec.go +++ b/builder/vsphere/clone/config.hcl2spec.go @@ -69,10 +69,10 @@ type FlatConfig struct { SSHUsername *string `mapstructure:"ssh_username" cty:"ssh_username" hcl:"ssh_username"` SSHPassword *string `mapstructure:"ssh_password" cty:"ssh_password" hcl:"ssh_password"` SSHKeyPairName *string `mapstructure:"ssh_keypair_name" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` - SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` + SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" undocumented:"true" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` SSHCiphers []string `mapstructure:"ssh_ciphers" cty:"ssh_ciphers" hcl:"ssh_ciphers"` SSHClearAuthorizedKeys *bool `mapstructure:"ssh_clear_authorized_keys" cty:"ssh_clear_authorized_keys" hcl:"ssh_clear_authorized_keys"` - SSHPrivateKeyFile *string `mapstructure:"ssh_private_key_file" cty:"ssh_private_key_file" hcl:"ssh_private_key_file"` + SSHPrivateKeyFile *string `mapstructure:"ssh_private_key_file" undocumented:"true" cty:"ssh_private_key_file" hcl:"ssh_private_key_file"` SSHPty *bool `mapstructure:"ssh_pty" cty:"ssh_pty" hcl:"ssh_pty"` SSHTimeout *string `mapstructure:"ssh_timeout" cty:"ssh_timeout" hcl:"ssh_timeout"` SSHWaitTimeout *string `mapstructure:"ssh_wait_timeout" undocumented:"true" cty:"ssh_wait_timeout" hcl:"ssh_wait_timeout"` @@ -95,8 +95,8 @@ type FlatConfig struct { SSHReadWriteTimeout *string `mapstructure:"ssh_read_write_timeout" cty:"ssh_read_write_timeout" hcl:"ssh_read_write_timeout"` SSHRemoteTunnels []string `mapstructure:"ssh_remote_tunnels" cty:"ssh_remote_tunnels" hcl:"ssh_remote_tunnels"` SSHLocalTunnels []string `mapstructure:"ssh_local_tunnels" cty:"ssh_local_tunnels" hcl:"ssh_local_tunnels"` - SSHPublicKey []byte `mapstructure:"ssh_public_key" cty:"ssh_public_key" hcl:"ssh_public_key"` - SSHPrivateKey []byte `mapstructure:"ssh_private_key" cty:"ssh_private_key" hcl:"ssh_private_key"` + SSHPublicKey []byte `mapstructure:"ssh_public_key" undocumented:"true" cty:"ssh_public_key" hcl:"ssh_public_key"` + SSHPrivateKey []byte `mapstructure:"ssh_private_key" undocumented:"true" cty:"ssh_private_key" hcl:"ssh_private_key"` WinRMUser *string `mapstructure:"winrm_username" cty:"winrm_username" hcl:"winrm_username"` WinRMPassword *string `mapstructure:"winrm_password" cty:"winrm_password" hcl:"winrm_password"` WinRMHost *string `mapstructure:"winrm_host" cty:"winrm_host" hcl:"winrm_host"` diff --git a/builder/vsphere/iso/config.hcl2spec.go b/builder/vsphere/iso/config.hcl2spec.go index 091e7d872..ae0059398 100644 --- a/builder/vsphere/iso/config.hcl2spec.go +++ b/builder/vsphere/iso/config.hcl2spec.go @@ -83,10 +83,10 @@ type FlatConfig struct { SSHUsername *string `mapstructure:"ssh_username" cty:"ssh_username" hcl:"ssh_username"` SSHPassword *string `mapstructure:"ssh_password" cty:"ssh_password" hcl:"ssh_password"` SSHKeyPairName *string `mapstructure:"ssh_keypair_name" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` - SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` + SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" undocumented:"true" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` SSHCiphers []string `mapstructure:"ssh_ciphers" cty:"ssh_ciphers" hcl:"ssh_ciphers"` SSHClearAuthorizedKeys *bool `mapstructure:"ssh_clear_authorized_keys" cty:"ssh_clear_authorized_keys" hcl:"ssh_clear_authorized_keys"` - SSHPrivateKeyFile *string `mapstructure:"ssh_private_key_file" cty:"ssh_private_key_file" hcl:"ssh_private_key_file"` + SSHPrivateKeyFile *string `mapstructure:"ssh_private_key_file" undocumented:"true" cty:"ssh_private_key_file" hcl:"ssh_private_key_file"` SSHPty *bool `mapstructure:"ssh_pty" cty:"ssh_pty" hcl:"ssh_pty"` SSHTimeout *string `mapstructure:"ssh_timeout" cty:"ssh_timeout" hcl:"ssh_timeout"` SSHWaitTimeout *string `mapstructure:"ssh_wait_timeout" undocumented:"true" cty:"ssh_wait_timeout" hcl:"ssh_wait_timeout"` @@ -109,8 +109,8 @@ type FlatConfig struct { SSHReadWriteTimeout *string `mapstructure:"ssh_read_write_timeout" cty:"ssh_read_write_timeout" hcl:"ssh_read_write_timeout"` SSHRemoteTunnels []string `mapstructure:"ssh_remote_tunnels" cty:"ssh_remote_tunnels" hcl:"ssh_remote_tunnels"` SSHLocalTunnels []string `mapstructure:"ssh_local_tunnels" cty:"ssh_local_tunnels" hcl:"ssh_local_tunnels"` - SSHPublicKey []byte `mapstructure:"ssh_public_key" cty:"ssh_public_key" hcl:"ssh_public_key"` - SSHPrivateKey []byte `mapstructure:"ssh_private_key" cty:"ssh_private_key" hcl:"ssh_private_key"` + SSHPublicKey []byte `mapstructure:"ssh_public_key" undocumented:"true" cty:"ssh_public_key" hcl:"ssh_public_key"` + SSHPrivateKey []byte `mapstructure:"ssh_private_key" undocumented:"true" cty:"ssh_private_key" hcl:"ssh_private_key"` WinRMUser *string `mapstructure:"winrm_username" cty:"winrm_username" hcl:"winrm_username"` WinRMPassword *string `mapstructure:"winrm_password" cty:"winrm_password" hcl:"winrm_password"` WinRMHost *string `mapstructure:"winrm_host" cty:"winrm_host" hcl:"winrm_host"` diff --git a/builder/yandex/config.hcl2spec.go b/builder/yandex/config.hcl2spec.go index 4e2c4bccb..299b558a7 100644 --- a/builder/yandex/config.hcl2spec.go +++ b/builder/yandex/config.hcl2spec.go @@ -23,10 +23,10 @@ type FlatConfig struct { SSHUsername *string `mapstructure:"ssh_username" cty:"ssh_username" hcl:"ssh_username"` SSHPassword *string `mapstructure:"ssh_password" cty:"ssh_password" hcl:"ssh_password"` SSHKeyPairName *string `mapstructure:"ssh_keypair_name" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` - SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` + SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" undocumented:"true" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` SSHCiphers []string `mapstructure:"ssh_ciphers" cty:"ssh_ciphers" hcl:"ssh_ciphers"` SSHClearAuthorizedKeys *bool `mapstructure:"ssh_clear_authorized_keys" cty:"ssh_clear_authorized_keys" hcl:"ssh_clear_authorized_keys"` - SSHPrivateKeyFile *string `mapstructure:"ssh_private_key_file" cty:"ssh_private_key_file" hcl:"ssh_private_key_file"` + SSHPrivateKeyFile *string `mapstructure:"ssh_private_key_file" undocumented:"true" cty:"ssh_private_key_file" hcl:"ssh_private_key_file"` SSHPty *bool `mapstructure:"ssh_pty" cty:"ssh_pty" hcl:"ssh_pty"` SSHTimeout *string `mapstructure:"ssh_timeout" cty:"ssh_timeout" hcl:"ssh_timeout"` SSHWaitTimeout *string `mapstructure:"ssh_wait_timeout" undocumented:"true" cty:"ssh_wait_timeout" hcl:"ssh_wait_timeout"` @@ -49,8 +49,8 @@ type FlatConfig struct { SSHReadWriteTimeout *string `mapstructure:"ssh_read_write_timeout" cty:"ssh_read_write_timeout" hcl:"ssh_read_write_timeout"` SSHRemoteTunnels []string `mapstructure:"ssh_remote_tunnels" cty:"ssh_remote_tunnels" hcl:"ssh_remote_tunnels"` SSHLocalTunnels []string `mapstructure:"ssh_local_tunnels" cty:"ssh_local_tunnels" hcl:"ssh_local_tunnels"` - SSHPublicKey []byte `mapstructure:"ssh_public_key" cty:"ssh_public_key" hcl:"ssh_public_key"` - SSHPrivateKey []byte `mapstructure:"ssh_private_key" cty:"ssh_private_key" hcl:"ssh_private_key"` + SSHPublicKey []byte `mapstructure:"ssh_public_key" undocumented:"true" cty:"ssh_public_key" hcl:"ssh_public_key"` + SSHPrivateKey []byte `mapstructure:"ssh_private_key" undocumented:"true" cty:"ssh_private_key" hcl:"ssh_private_key"` WinRMUser *string `mapstructure:"winrm_username" cty:"winrm_username" hcl:"winrm_username"` WinRMPassword *string `mapstructure:"winrm_password" cty:"winrm_password" hcl:"winrm_password"` WinRMHost *string `mapstructure:"winrm_host" cty:"winrm_host" hcl:"winrm_host"` diff --git a/helper/communicator/config.go b/helper/communicator/config.go index 4ce3a23d4..28d52e400 100644 --- a/helper/communicator/config.go +++ b/helper/communicator/config.go @@ -87,7 +87,7 @@ type SSH struct { // The name of the temporary key pair to generate. By default, Packer // generates a name that looks like `packer_`, where <UUID> is // a 36 character unique identifier. - SSHTemporaryKeyPairName string `mapstructure:"temporary_key_pair_name"` + SSHTemporaryKeyPairName string `mapstructure:"temporary_key_pair_name" undocumented:"true"` // This overrides the value of ciphers supported by default by golang. // The default value is [ // "aes128-gcm@openssh.com", @@ -110,7 +110,7 @@ type SSH struct { // Path to a PEM encoded private key file to use to authenticate with SSH. // The `~` can be used in path and will be expanded to the home directory // of current user. - SSHPrivateKeyFile string `mapstructure:"ssh_private_key_file"` + SSHPrivateKeyFile string `mapstructure:"ssh_private_key_file" undocumented:"true"` // If `true`, a PTY will be requested for the SSH connection. This defaults // to `false`. SSHPty bool `mapstructure:"ssh_pty"` @@ -175,8 +175,8 @@ type SSH struct { SSHLocalTunnels []string `mapstructure:"ssh_local_tunnels"` // SSH Internals - SSHPublicKey []byte `mapstructure:"ssh_public_key"` - SSHPrivateKey []byte `mapstructure:"ssh_private_key"` + SSHPublicKey []byte `mapstructure:"ssh_public_key" undocumented:"true"` + SSHPrivateKey []byte `mapstructure:"ssh_private_key" undocumented:"true"` } type WinRM struct { diff --git a/helper/communicator/config.hcl2spec.go b/helper/communicator/config.hcl2spec.go index a717916d8..d7c0de1fd 100644 --- a/helper/communicator/config.hcl2spec.go +++ b/helper/communicator/config.hcl2spec.go @@ -16,10 +16,10 @@ type FlatConfig struct { SSHUsername *string `mapstructure:"ssh_username" cty:"ssh_username" hcl:"ssh_username"` SSHPassword *string `mapstructure:"ssh_password" cty:"ssh_password" hcl:"ssh_password"` SSHKeyPairName *string `mapstructure:"ssh_keypair_name" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` - SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` + SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" undocumented:"true" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` SSHCiphers []string `mapstructure:"ssh_ciphers" cty:"ssh_ciphers" hcl:"ssh_ciphers"` SSHClearAuthorizedKeys *bool `mapstructure:"ssh_clear_authorized_keys" cty:"ssh_clear_authorized_keys" hcl:"ssh_clear_authorized_keys"` - SSHPrivateKeyFile *string `mapstructure:"ssh_private_key_file" cty:"ssh_private_key_file" hcl:"ssh_private_key_file"` + SSHPrivateKeyFile *string `mapstructure:"ssh_private_key_file" undocumented:"true" cty:"ssh_private_key_file" hcl:"ssh_private_key_file"` SSHPty *bool `mapstructure:"ssh_pty" cty:"ssh_pty" hcl:"ssh_pty"` SSHTimeout *string `mapstructure:"ssh_timeout" cty:"ssh_timeout" hcl:"ssh_timeout"` SSHWaitTimeout *string `mapstructure:"ssh_wait_timeout" undocumented:"true" cty:"ssh_wait_timeout" hcl:"ssh_wait_timeout"` @@ -42,8 +42,8 @@ type FlatConfig struct { SSHReadWriteTimeout *string `mapstructure:"ssh_read_write_timeout" cty:"ssh_read_write_timeout" hcl:"ssh_read_write_timeout"` SSHRemoteTunnels []string `mapstructure:"ssh_remote_tunnels" cty:"ssh_remote_tunnels" hcl:"ssh_remote_tunnels"` SSHLocalTunnels []string `mapstructure:"ssh_local_tunnels" cty:"ssh_local_tunnels" hcl:"ssh_local_tunnels"` - SSHPublicKey []byte `mapstructure:"ssh_public_key" cty:"ssh_public_key" hcl:"ssh_public_key"` - SSHPrivateKey []byte `mapstructure:"ssh_private_key" cty:"ssh_private_key" hcl:"ssh_private_key"` + SSHPublicKey []byte `mapstructure:"ssh_public_key" undocumented:"true" cty:"ssh_public_key" hcl:"ssh_public_key"` + SSHPrivateKey []byte `mapstructure:"ssh_private_key" undocumented:"true" cty:"ssh_private_key" hcl:"ssh_private_key"` WinRMUser *string `mapstructure:"winrm_username" cty:"winrm_username" hcl:"winrm_username"` WinRMPassword *string `mapstructure:"winrm_password" cty:"winrm_password" hcl:"winrm_password"` WinRMHost *string `mapstructure:"winrm_host" cty:"winrm_host" hcl:"winrm_host"` @@ -123,10 +123,10 @@ type FlatSSH struct { SSHUsername *string `mapstructure:"ssh_username" cty:"ssh_username" hcl:"ssh_username"` SSHPassword *string `mapstructure:"ssh_password" cty:"ssh_password" hcl:"ssh_password"` SSHKeyPairName *string `mapstructure:"ssh_keypair_name" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` - SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` + SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" undocumented:"true" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` SSHCiphers []string `mapstructure:"ssh_ciphers" cty:"ssh_ciphers" hcl:"ssh_ciphers"` SSHClearAuthorizedKeys *bool `mapstructure:"ssh_clear_authorized_keys" cty:"ssh_clear_authorized_keys" hcl:"ssh_clear_authorized_keys"` - SSHPrivateKeyFile *string `mapstructure:"ssh_private_key_file" cty:"ssh_private_key_file" hcl:"ssh_private_key_file"` + SSHPrivateKeyFile *string `mapstructure:"ssh_private_key_file" undocumented:"true" cty:"ssh_private_key_file" hcl:"ssh_private_key_file"` SSHPty *bool `mapstructure:"ssh_pty" cty:"ssh_pty" hcl:"ssh_pty"` SSHTimeout *string `mapstructure:"ssh_timeout" cty:"ssh_timeout" hcl:"ssh_timeout"` SSHWaitTimeout *string `mapstructure:"ssh_wait_timeout" undocumented:"true" cty:"ssh_wait_timeout" hcl:"ssh_wait_timeout"` @@ -149,8 +149,8 @@ type FlatSSH struct { SSHReadWriteTimeout *string `mapstructure:"ssh_read_write_timeout" cty:"ssh_read_write_timeout" hcl:"ssh_read_write_timeout"` SSHRemoteTunnels []string `mapstructure:"ssh_remote_tunnels" cty:"ssh_remote_tunnels" hcl:"ssh_remote_tunnels"` SSHLocalTunnels []string `mapstructure:"ssh_local_tunnels" cty:"ssh_local_tunnels" hcl:"ssh_local_tunnels"` - SSHPublicKey []byte `mapstructure:"ssh_public_key" cty:"ssh_public_key" hcl:"ssh_public_key"` - SSHPrivateKey []byte `mapstructure:"ssh_private_key" cty:"ssh_private_key" hcl:"ssh_private_key"` + SSHPublicKey []byte `mapstructure:"ssh_public_key" undocumented:"true" cty:"ssh_public_key" hcl:"ssh_public_key"` + SSHPrivateKey []byte `mapstructure:"ssh_private_key" undocumented:"true" cty:"ssh_private_key" hcl:"ssh_private_key"` } // FlatMapstructure returns a new FlatSSH. diff --git a/post-processor/alicloud-import/post-processor.hcl2spec.go b/post-processor/alicloud-import/post-processor.hcl2spec.go index a6ffeb81b..625d21bed 100644 --- a/post-processor/alicloud-import/post-processor.hcl2spec.go +++ b/post-processor/alicloud-import/post-processor.hcl2spec.go @@ -70,10 +70,10 @@ type FlatConfig struct { SSHUsername *string `mapstructure:"ssh_username" cty:"ssh_username" hcl:"ssh_username"` SSHPassword *string `mapstructure:"ssh_password" cty:"ssh_password" hcl:"ssh_password"` SSHKeyPairName *string `mapstructure:"ssh_keypair_name" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` - SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` + SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" undocumented:"true" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` SSHCiphers []string `mapstructure:"ssh_ciphers" cty:"ssh_ciphers" hcl:"ssh_ciphers"` SSHClearAuthorizedKeys *bool `mapstructure:"ssh_clear_authorized_keys" cty:"ssh_clear_authorized_keys" hcl:"ssh_clear_authorized_keys"` - SSHPrivateKeyFile *string `mapstructure:"ssh_private_key_file" cty:"ssh_private_key_file" hcl:"ssh_private_key_file"` + SSHPrivateKeyFile *string `mapstructure:"ssh_private_key_file" undocumented:"true" cty:"ssh_private_key_file" hcl:"ssh_private_key_file"` SSHPty *bool `mapstructure:"ssh_pty" cty:"ssh_pty" hcl:"ssh_pty"` SSHTimeout *string `mapstructure:"ssh_timeout" cty:"ssh_timeout" hcl:"ssh_timeout"` SSHWaitTimeout *string `mapstructure:"ssh_wait_timeout" undocumented:"true" cty:"ssh_wait_timeout" hcl:"ssh_wait_timeout"` @@ -96,8 +96,8 @@ type FlatConfig struct { SSHReadWriteTimeout *string `mapstructure:"ssh_read_write_timeout" cty:"ssh_read_write_timeout" hcl:"ssh_read_write_timeout"` SSHRemoteTunnels []string `mapstructure:"ssh_remote_tunnels" cty:"ssh_remote_tunnels" hcl:"ssh_remote_tunnels"` SSHLocalTunnels []string `mapstructure:"ssh_local_tunnels" cty:"ssh_local_tunnels" hcl:"ssh_local_tunnels"` - SSHPublicKey []byte `mapstructure:"ssh_public_key" cty:"ssh_public_key" hcl:"ssh_public_key"` - SSHPrivateKey []byte `mapstructure:"ssh_private_key" cty:"ssh_private_key" hcl:"ssh_private_key"` + SSHPublicKey []byte `mapstructure:"ssh_public_key" undocumented:"true" cty:"ssh_public_key" hcl:"ssh_public_key"` + SSHPrivateKey []byte `mapstructure:"ssh_private_key" undocumented:"true" cty:"ssh_private_key" hcl:"ssh_private_key"` WinRMUser *string `mapstructure:"winrm_username" cty:"winrm_username" hcl:"winrm_username"` WinRMPassword *string `mapstructure:"winrm_password" cty:"winrm_password" hcl:"winrm_password"` WinRMHost *string `mapstructure:"winrm_host" cty:"winrm_host" hcl:"winrm_host"` diff --git a/website/pages/docs/builders/amazon/ebs.mdx b/website/pages/docs/builders/amazon/ebs.mdx index e0db95037..57ac2126a 100644 --- a/website/pages/docs/builders/amazon/ebs.mdx +++ b/website/pages/docs/builders/amazon/ebs.mdx @@ -101,6 +101,8 @@ Block devices can be nested in the @include 'helper/communicator/SSH-not-required.mdx' +@include 'helper/communicator/SSH-Key-Pair-not-required.mdx' + ## Basic Example Here is a basic example. You will need to provide access keys, and may need to diff --git a/website/pages/docs/builders/amazon/ebssurrogate.mdx b/website/pages/docs/builders/amazon/ebssurrogate.mdx index 529db51e0..1fe903e4d 100644 --- a/website/pages/docs/builders/amazon/ebssurrogate.mdx +++ b/website/pages/docs/builders/amazon/ebssurrogate.mdx @@ -100,6 +100,8 @@ Block devices can be nested in the @include 'helper/communicator/SSH-not-required.mdx' +@include 'helper/communicator/SSH-Key-Pair-not-required.mdx' + ## Basic Example diff --git a/website/pages/docs/builders/amazon/ebsvolume.mdx b/website/pages/docs/builders/amazon/ebsvolume.mdx index 4e25e3dcf..3708a5c9c 100644 --- a/website/pages/docs/builders/amazon/ebsvolume.mdx +++ b/website/pages/docs/builders/amazon/ebsvolume.mdx @@ -104,6 +104,8 @@ Block devices can be nested in the @include 'helper/communicator/SSH-not-required.mdx' +@include 'helper/communicator/SSH-Key-Pair-not-required.mdx' + ## Basic Example diff --git a/website/pages/docs/builders/amazon/instance.mdx b/website/pages/docs/builders/amazon/instance.mdx index 9abf80da1..5aa4ba7ad 100644 --- a/website/pages/docs/builders/amazon/instance.mdx +++ b/website/pages/docs/builders/amazon/instance.mdx @@ -117,6 +117,8 @@ Block devices can be nested in the @include 'helper/communicator/SSH-not-required.mdx' +@include 'helper/communicator/SSH-Key-Pair-not-required.mdx' + ## Basic Example Here is a basic example. It is completely valid except for the access keys: diff --git a/website/pages/docs/builders/openstack.mdx b/website/pages/docs/builders/openstack.mdx index dbb3df428..5a6f57ab2 100644 --- a/website/pages/docs/builders/openstack.mdx +++ b/website/pages/docs/builders/openstack.mdx @@ -79,6 +79,8 @@ builder. @include 'helper/communicator/SSH-not-required.mdx' +@include 'helper/communicator/SSH-Key-Pair-not-required.mdx' + @include 'helper/communicator/SSHInterface-not-required.mdx' ## Basic Example: DevStack diff --git a/website/pages/docs/builders/virtualbox/iso.mdx b/website/pages/docs/builders/virtualbox/iso.mdx index 9e27f169e..a2bbf9e44 100644 --- a/website/pages/docs/builders/virtualbox/iso.mdx +++ b/website/pages/docs/builders/virtualbox/iso.mdx @@ -172,6 +172,8 @@ necessary for this build to succeed and can be found further down the page. @include 'helper/communicator/SSH-not-required.mdx' +@include 'helper/communicator/SSH-Key-Pair-not-required.mdx' + #### Optional WinRM fields: @include 'helper/communicator/WinRM-not-required.mdx' diff --git a/website/pages/docs/builders/virtualbox/ovf.mdx b/website/pages/docs/builders/virtualbox/ovf.mdx index ba0d8a353..57b874c91 100644 --- a/website/pages/docs/builders/virtualbox/ovf.mdx +++ b/website/pages/docs/builders/virtualbox/ovf.mdx @@ -159,6 +159,8 @@ necessary for this build to succeed and can be found further down the page. @include 'helper/communicator/SSH-not-required.mdx' +@include 'helper/communicator/SSH-Key-Pair-not-required.mdx' + #### Optional WinRM fields: @include 'helper/communicator/WinRM-not-required.mdx' diff --git a/website/pages/docs/builders/virtualbox/vm.mdx b/website/pages/docs/builders/virtualbox/vm.mdx index 12ac15401..464f04dd7 100644 --- a/website/pages/docs/builders/virtualbox/vm.mdx +++ b/website/pages/docs/builders/virtualbox/vm.mdx @@ -182,6 +182,8 @@ builder. @include 'helper/communicator/SSH-not-required.mdx' +@include 'helper/communicator/SSH-Key-Pair-not-required.mdx' + #### Optional WinRM fields: @include 'helper/communicator/WinRM-not-required.mdx' diff --git a/website/pages/partials/helper/communicator/SSH-Key-Pair-not-required.mdx b/website/pages/partials/helper/communicator/SSH-Key-Pair-not-required.mdx new file mode 100644 index 000000000..59e688a51 --- /dev/null +++ b/website/pages/partials/helper/communicator/SSH-Key-Pair-not-required.mdx @@ -0,0 +1,8 @@ + +- `temporary_key_pair_name` (string) - The name of the temporary key pair to generate. By default, Packer + generates a name that looks like `packer_`, where <UUID> is + a 36 character unique identifier. + +- `ssh_private_key_file` (string) - Path to a PEM encoded private key file to use to authenticate with SSH. + The `~` can be used in path and will be expanded to the home directory + of current user. diff --git a/website/pages/partials/helper/communicator/SSH-not-required.mdx b/website/pages/partials/helper/communicator/SSH-not-required.mdx index 3f9779828..76391ab84 100644 --- a/website/pages/partials/helper/communicator/SSH-not-required.mdx +++ b/website/pages/partials/helper/communicator/SSH-not-required.mdx @@ -17,10 +17,6 @@ [`ssh_agent_auth`](#ssh_agent_auth) must be specified when [`ssh_keypair_name`](#ssh_keypair_name) is utilized. -- `temporary_key_pair_name` (string) - The name of the temporary key pair to generate. By default, Packer - generates a name that looks like `packer_`, where <UUID> is - a 36 character unique identifier. - - `ssh_ciphers` ([]string) - This overrides the value of ciphers supported by default by golang. The default value is [ "aes128-gcm@openssh.com", @@ -40,10 +36,6 @@ (unless the user has set the `-debug` flag). Defaults to "false"; currently only works on guests with `sed` installed. -- `ssh_private_key_file` (string) - Path to a PEM encoded private key file to use to authenticate with SSH. - The `~` can be used in path and will be expanded to the home directory - of current user. - - `ssh_pty` (bool) - If `true`, a PTY will be requested for the SSH connection. This defaults to `false`. @@ -99,7 +91,4 @@ Example: `5m`. Disabled by default. - `ssh_remote_tunnels` ([]string) - -- `ssh_local_tunnels` ([]string) - -- `ssh_public_key` ([]byte) - SSH Internals - -- `ssh_private_key` ([]byte) - SSH Private Key \ No newline at end of file +- `ssh_local_tunnels` ([]string) - \ No newline at end of file From 8ea64c5b35ac673ae437b8218c5e0b9c7e233949 Mon Sep 17 00:00:00 2001 From: Moss Date: Wed, 1 Jul 2020 17:06:09 +0200 Subject: [PATCH 02/38] undocument ssh_keypair_name and ssh_agent_auth --- builder/alicloud/ecs/builder.hcl2spec.go | 4 ++-- builder/amazon/ebs/builder.hcl2spec.go | 4 ++-- builder/amazon/ebssurrogate/builder.hcl2spec.go | 4 ++-- builder/amazon/ebsvolume/builder.hcl2spec.go | 4 ++-- builder/amazon/instance/builder.hcl2spec.go | 4 ++-- builder/azure/arm/config.hcl2spec.go | 4 ++-- builder/azure/dtl/config.hcl2spec.go | 4 ++-- builder/cloudstack/config.hcl2spec.go | 4 ++-- builder/digitalocean/config.hcl2spec.go | 4 ++-- builder/docker/config.hcl2spec.go | 4 ++-- builder/googlecompute/config.hcl2spec.go | 4 ++-- builder/hcloud/config.hcl2spec.go | 4 ++-- builder/hyperone/config.hcl2spec.go | 4 ++-- builder/hyperv/iso/builder.hcl2spec.go | 4 ++-- builder/hyperv/vmcx/builder.hcl2spec.go | 4 ++-- builder/jdcloud/common.hcl2spec.go | 4 ++-- builder/linode/config.hcl2spec.go | 4 ++-- builder/ncloud/config.hcl2spec.go | 4 ++-- builder/null/config.hcl2spec.go | 4 ++-- builder/oneandone/config.hcl2spec.go | 4 ++-- builder/openstack/builder.hcl2spec.go | 4 ++-- builder/oracle/classic/builder.hcl2spec.go | 4 ++-- builder/oracle/oci/config.hcl2spec.go | 4 ++-- builder/osc/bsu/builder.hcl2spec.go | 4 ++-- builder/osc/bsusurrogate/builder.hcl2spec.go | 4 ++-- builder/osc/bsuvolume/builder.hcl2spec.go | 4 ++-- builder/parallels/iso/builder.hcl2spec.go | 4 ++-- builder/parallels/pvm/config.hcl2spec.go | 4 ++-- builder/profitbricks/config.hcl2spec.go | 4 ++-- builder/proxmox/config.hcl2spec.go | 4 ++-- builder/qemu/builder.hcl2spec.go | 4 ++-- builder/scaleway/config.hcl2spec.go | 4 ++-- builder/tencentcloud/cvm/builder.hcl2spec.go | 4 ++-- builder/triton/config.hcl2spec.go | 4 ++-- builder/ucloud/uhost/builder.hcl2spec.go | 4 ++-- builder/vagrant/builder.hcl2spec.go | 4 ++-- builder/virtualbox/iso/builder.hcl2spec.go | 4 ++-- builder/virtualbox/ovf/config.hcl2spec.go | 4 ++-- builder/virtualbox/vm/config.hcl2spec.go | 4 ++-- builder/vmware/iso/config.hcl2spec.go | 4 ++-- builder/vmware/vmx/config.hcl2spec.go | 4 ++-- builder/vsphere/clone/config.hcl2spec.go | 4 ++-- builder/vsphere/iso/config.hcl2spec.go | 4 ++-- builder/yandex/config.hcl2spec.go | 4 ++-- helper/communicator/config.go | 4 ++-- helper/communicator/config.hcl2spec.go | 8 ++++---- .../alicloud-import/post-processor.hcl2spec.go | 4 ++-- .../communicator/SSH-Key-Pair-not-required.mdx | 15 +++++++++++++++ .../helper/communicator/SSH-not-required.mdx | 15 --------------- 49 files changed, 111 insertions(+), 111 deletions(-) diff --git a/builder/alicloud/ecs/builder.hcl2spec.go b/builder/alicloud/ecs/builder.hcl2spec.go index bead44c15..1c99e16a3 100644 --- a/builder/alicloud/ecs/builder.hcl2spec.go +++ b/builder/alicloud/ecs/builder.hcl2spec.go @@ -105,7 +105,7 @@ type FlatConfig struct { SSHPort *int `mapstructure:"ssh_port" cty:"ssh_port" hcl:"ssh_port"` SSHUsername *string `mapstructure:"ssh_username" cty:"ssh_username" hcl:"ssh_username"` SSHPassword *string `mapstructure:"ssh_password" cty:"ssh_password" hcl:"ssh_password"` - SSHKeyPairName *string `mapstructure:"ssh_keypair_name" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` + SSHKeyPairName *string `mapstructure:"ssh_keypair_name" undocumented:"true" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" undocumented:"true" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` SSHCiphers []string `mapstructure:"ssh_ciphers" cty:"ssh_ciphers" hcl:"ssh_ciphers"` SSHClearAuthorizedKeys *bool `mapstructure:"ssh_clear_authorized_keys" cty:"ssh_clear_authorized_keys" hcl:"ssh_clear_authorized_keys"` @@ -113,7 +113,7 @@ type FlatConfig struct { SSHPty *bool `mapstructure:"ssh_pty" cty:"ssh_pty" hcl:"ssh_pty"` SSHTimeout *string `mapstructure:"ssh_timeout" cty:"ssh_timeout" hcl:"ssh_timeout"` SSHWaitTimeout *string `mapstructure:"ssh_wait_timeout" undocumented:"true" cty:"ssh_wait_timeout" hcl:"ssh_wait_timeout"` - SSHAgentAuth *bool `mapstructure:"ssh_agent_auth" cty:"ssh_agent_auth" hcl:"ssh_agent_auth"` + SSHAgentAuth *bool `mapstructure:"ssh_agent_auth" undocumented:"true" cty:"ssh_agent_auth" hcl:"ssh_agent_auth"` SSHDisableAgentForwarding *bool `mapstructure:"ssh_disable_agent_forwarding" cty:"ssh_disable_agent_forwarding" hcl:"ssh_disable_agent_forwarding"` SSHHandshakeAttempts *int `mapstructure:"ssh_handshake_attempts" cty:"ssh_handshake_attempts" hcl:"ssh_handshake_attempts"` SSHBastionHost *string `mapstructure:"ssh_bastion_host" cty:"ssh_bastion_host" hcl:"ssh_bastion_host"` diff --git a/builder/amazon/ebs/builder.hcl2spec.go b/builder/amazon/ebs/builder.hcl2spec.go index 04100036e..95ed7eb87 100644 --- a/builder/amazon/ebs/builder.hcl2spec.go +++ b/builder/amazon/ebs/builder.hcl2spec.go @@ -90,14 +90,14 @@ type FlatConfig struct { SSHPort *int `mapstructure:"ssh_port" cty:"ssh_port" hcl:"ssh_port"` SSHUsername *string `mapstructure:"ssh_username" cty:"ssh_username" hcl:"ssh_username"` SSHPassword *string `mapstructure:"ssh_password" cty:"ssh_password" hcl:"ssh_password"` - SSHKeyPairName *string `mapstructure:"ssh_keypair_name" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` + SSHKeyPairName *string `mapstructure:"ssh_keypair_name" undocumented:"true" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` SSHCiphers []string `mapstructure:"ssh_ciphers" cty:"ssh_ciphers" hcl:"ssh_ciphers"` SSHClearAuthorizedKeys *bool `mapstructure:"ssh_clear_authorized_keys" cty:"ssh_clear_authorized_keys" hcl:"ssh_clear_authorized_keys"` SSHPrivateKeyFile *string `mapstructure:"ssh_private_key_file" undocumented:"true" cty:"ssh_private_key_file" hcl:"ssh_private_key_file"` SSHPty *bool `mapstructure:"ssh_pty" cty:"ssh_pty" hcl:"ssh_pty"` SSHTimeout *string `mapstructure:"ssh_timeout" cty:"ssh_timeout" hcl:"ssh_timeout"` SSHWaitTimeout *string `mapstructure:"ssh_wait_timeout" undocumented:"true" cty:"ssh_wait_timeout" hcl:"ssh_wait_timeout"` - SSHAgentAuth *bool `mapstructure:"ssh_agent_auth" cty:"ssh_agent_auth" hcl:"ssh_agent_auth"` + SSHAgentAuth *bool `mapstructure:"ssh_agent_auth" undocumented:"true" cty:"ssh_agent_auth" hcl:"ssh_agent_auth"` SSHDisableAgentForwarding *bool `mapstructure:"ssh_disable_agent_forwarding" cty:"ssh_disable_agent_forwarding" hcl:"ssh_disable_agent_forwarding"` SSHHandshakeAttempts *int `mapstructure:"ssh_handshake_attempts" cty:"ssh_handshake_attempts" hcl:"ssh_handshake_attempts"` SSHBastionHost *string `mapstructure:"ssh_bastion_host" cty:"ssh_bastion_host" hcl:"ssh_bastion_host"` diff --git a/builder/amazon/ebssurrogate/builder.hcl2spec.go b/builder/amazon/ebssurrogate/builder.hcl2spec.go index 343c63262..ca62db2f8 100644 --- a/builder/amazon/ebssurrogate/builder.hcl2spec.go +++ b/builder/amazon/ebssurrogate/builder.hcl2spec.go @@ -112,14 +112,14 @@ type FlatConfig struct { SSHPort *int `mapstructure:"ssh_port" cty:"ssh_port" hcl:"ssh_port"` SSHUsername *string `mapstructure:"ssh_username" cty:"ssh_username" hcl:"ssh_username"` SSHPassword *string `mapstructure:"ssh_password" cty:"ssh_password" hcl:"ssh_password"` - SSHKeyPairName *string `mapstructure:"ssh_keypair_name" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` + SSHKeyPairName *string `mapstructure:"ssh_keypair_name" undocumented:"true" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` SSHCiphers []string `mapstructure:"ssh_ciphers" cty:"ssh_ciphers" hcl:"ssh_ciphers"` SSHClearAuthorizedKeys *bool `mapstructure:"ssh_clear_authorized_keys" cty:"ssh_clear_authorized_keys" hcl:"ssh_clear_authorized_keys"` SSHPrivateKeyFile *string `mapstructure:"ssh_private_key_file" undocumented:"true" cty:"ssh_private_key_file" hcl:"ssh_private_key_file"` SSHPty *bool `mapstructure:"ssh_pty" cty:"ssh_pty" hcl:"ssh_pty"` SSHTimeout *string `mapstructure:"ssh_timeout" cty:"ssh_timeout" hcl:"ssh_timeout"` SSHWaitTimeout *string `mapstructure:"ssh_wait_timeout" undocumented:"true" cty:"ssh_wait_timeout" hcl:"ssh_wait_timeout"` - SSHAgentAuth *bool `mapstructure:"ssh_agent_auth" cty:"ssh_agent_auth" hcl:"ssh_agent_auth"` + SSHAgentAuth *bool `mapstructure:"ssh_agent_auth" undocumented:"true" cty:"ssh_agent_auth" hcl:"ssh_agent_auth"` SSHDisableAgentForwarding *bool `mapstructure:"ssh_disable_agent_forwarding" cty:"ssh_disable_agent_forwarding" hcl:"ssh_disable_agent_forwarding"` SSHHandshakeAttempts *int `mapstructure:"ssh_handshake_attempts" cty:"ssh_handshake_attempts" hcl:"ssh_handshake_attempts"` SSHBastionHost *string `mapstructure:"ssh_bastion_host" cty:"ssh_bastion_host" hcl:"ssh_bastion_host"` diff --git a/builder/amazon/ebsvolume/builder.hcl2spec.go b/builder/amazon/ebsvolume/builder.hcl2spec.go index ebfabf7d7..d4b57f9f4 100644 --- a/builder/amazon/ebsvolume/builder.hcl2spec.go +++ b/builder/amazon/ebsvolume/builder.hcl2spec.go @@ -114,14 +114,14 @@ type FlatConfig struct { SSHPort *int `mapstructure:"ssh_port" cty:"ssh_port" hcl:"ssh_port"` SSHUsername *string `mapstructure:"ssh_username" cty:"ssh_username" hcl:"ssh_username"` SSHPassword *string `mapstructure:"ssh_password" cty:"ssh_password" hcl:"ssh_password"` - SSHKeyPairName *string `mapstructure:"ssh_keypair_name" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` + SSHKeyPairName *string `mapstructure:"ssh_keypair_name" undocumented:"true" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` SSHCiphers []string `mapstructure:"ssh_ciphers" cty:"ssh_ciphers" hcl:"ssh_ciphers"` SSHClearAuthorizedKeys *bool `mapstructure:"ssh_clear_authorized_keys" cty:"ssh_clear_authorized_keys" hcl:"ssh_clear_authorized_keys"` SSHPrivateKeyFile *string `mapstructure:"ssh_private_key_file" undocumented:"true" cty:"ssh_private_key_file" hcl:"ssh_private_key_file"` SSHPty *bool `mapstructure:"ssh_pty" cty:"ssh_pty" hcl:"ssh_pty"` SSHTimeout *string `mapstructure:"ssh_timeout" cty:"ssh_timeout" hcl:"ssh_timeout"` SSHWaitTimeout *string `mapstructure:"ssh_wait_timeout" undocumented:"true" cty:"ssh_wait_timeout" hcl:"ssh_wait_timeout"` - SSHAgentAuth *bool `mapstructure:"ssh_agent_auth" cty:"ssh_agent_auth" hcl:"ssh_agent_auth"` + SSHAgentAuth *bool `mapstructure:"ssh_agent_auth" undocumented:"true" cty:"ssh_agent_auth" hcl:"ssh_agent_auth"` SSHDisableAgentForwarding *bool `mapstructure:"ssh_disable_agent_forwarding" cty:"ssh_disable_agent_forwarding" hcl:"ssh_disable_agent_forwarding"` SSHHandshakeAttempts *int `mapstructure:"ssh_handshake_attempts" cty:"ssh_handshake_attempts" hcl:"ssh_handshake_attempts"` SSHBastionHost *string `mapstructure:"ssh_bastion_host" cty:"ssh_bastion_host" hcl:"ssh_bastion_host"` diff --git a/builder/amazon/instance/builder.hcl2spec.go b/builder/amazon/instance/builder.hcl2spec.go index c558efc17..7c7f9f891 100644 --- a/builder/amazon/instance/builder.hcl2spec.go +++ b/builder/amazon/instance/builder.hcl2spec.go @@ -90,14 +90,14 @@ type FlatConfig struct { SSHPort *int `mapstructure:"ssh_port" cty:"ssh_port" hcl:"ssh_port"` SSHUsername *string `mapstructure:"ssh_username" cty:"ssh_username" hcl:"ssh_username"` SSHPassword *string `mapstructure:"ssh_password" cty:"ssh_password" hcl:"ssh_password"` - SSHKeyPairName *string `mapstructure:"ssh_keypair_name" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` + SSHKeyPairName *string `mapstructure:"ssh_keypair_name" undocumented:"true" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` SSHCiphers []string `mapstructure:"ssh_ciphers" cty:"ssh_ciphers" hcl:"ssh_ciphers"` SSHClearAuthorizedKeys *bool `mapstructure:"ssh_clear_authorized_keys" cty:"ssh_clear_authorized_keys" hcl:"ssh_clear_authorized_keys"` SSHPrivateKeyFile *string `mapstructure:"ssh_private_key_file" undocumented:"true" cty:"ssh_private_key_file" hcl:"ssh_private_key_file"` SSHPty *bool `mapstructure:"ssh_pty" cty:"ssh_pty" hcl:"ssh_pty"` SSHTimeout *string `mapstructure:"ssh_timeout" cty:"ssh_timeout" hcl:"ssh_timeout"` SSHWaitTimeout *string `mapstructure:"ssh_wait_timeout" undocumented:"true" cty:"ssh_wait_timeout" hcl:"ssh_wait_timeout"` - SSHAgentAuth *bool `mapstructure:"ssh_agent_auth" cty:"ssh_agent_auth" hcl:"ssh_agent_auth"` + SSHAgentAuth *bool `mapstructure:"ssh_agent_auth" undocumented:"true" cty:"ssh_agent_auth" hcl:"ssh_agent_auth"` SSHDisableAgentForwarding *bool `mapstructure:"ssh_disable_agent_forwarding" cty:"ssh_disable_agent_forwarding" hcl:"ssh_disable_agent_forwarding"` SSHHandshakeAttempts *int `mapstructure:"ssh_handshake_attempts" cty:"ssh_handshake_attempts" hcl:"ssh_handshake_attempts"` SSHBastionHost *string `mapstructure:"ssh_bastion_host" cty:"ssh_bastion_host" hcl:"ssh_bastion_host"` diff --git a/builder/azure/arm/config.hcl2spec.go b/builder/azure/arm/config.hcl2spec.go index c828ab151..b7dfbcd2f 100644 --- a/builder/azure/arm/config.hcl2spec.go +++ b/builder/azure/arm/config.hcl2spec.go @@ -78,7 +78,7 @@ type FlatConfig struct { SSHPort *int `mapstructure:"ssh_port" cty:"ssh_port" hcl:"ssh_port"` SSHUsername *string `mapstructure:"ssh_username" cty:"ssh_username" hcl:"ssh_username"` SSHPassword *string `mapstructure:"ssh_password" cty:"ssh_password" hcl:"ssh_password"` - SSHKeyPairName *string `mapstructure:"ssh_keypair_name" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` + SSHKeyPairName *string `mapstructure:"ssh_keypair_name" undocumented:"true" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" undocumented:"true" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` SSHCiphers []string `mapstructure:"ssh_ciphers" cty:"ssh_ciphers" hcl:"ssh_ciphers"` SSHClearAuthorizedKeys *bool `mapstructure:"ssh_clear_authorized_keys" cty:"ssh_clear_authorized_keys" hcl:"ssh_clear_authorized_keys"` @@ -86,7 +86,7 @@ type FlatConfig struct { SSHPty *bool `mapstructure:"ssh_pty" cty:"ssh_pty" hcl:"ssh_pty"` SSHTimeout *string `mapstructure:"ssh_timeout" cty:"ssh_timeout" hcl:"ssh_timeout"` SSHWaitTimeout *string `mapstructure:"ssh_wait_timeout" undocumented:"true" cty:"ssh_wait_timeout" hcl:"ssh_wait_timeout"` - SSHAgentAuth *bool `mapstructure:"ssh_agent_auth" cty:"ssh_agent_auth" hcl:"ssh_agent_auth"` + SSHAgentAuth *bool `mapstructure:"ssh_agent_auth" undocumented:"true" cty:"ssh_agent_auth" hcl:"ssh_agent_auth"` SSHDisableAgentForwarding *bool `mapstructure:"ssh_disable_agent_forwarding" cty:"ssh_disable_agent_forwarding" hcl:"ssh_disable_agent_forwarding"` SSHHandshakeAttempts *int `mapstructure:"ssh_handshake_attempts" cty:"ssh_handshake_attempts" hcl:"ssh_handshake_attempts"` SSHBastionHost *string `mapstructure:"ssh_bastion_host" cty:"ssh_bastion_host" hcl:"ssh_bastion_host"` diff --git a/builder/azure/dtl/config.hcl2spec.go b/builder/azure/dtl/config.hcl2spec.go index 24f870942..ca51e5459 100644 --- a/builder/azure/dtl/config.hcl2spec.go +++ b/builder/azure/dtl/config.hcl2spec.go @@ -91,7 +91,7 @@ type FlatConfig struct { SSHPort *int `mapstructure:"ssh_port" cty:"ssh_port" hcl:"ssh_port"` SSHUsername *string `mapstructure:"ssh_username" cty:"ssh_username" hcl:"ssh_username"` SSHPassword *string `mapstructure:"ssh_password" cty:"ssh_password" hcl:"ssh_password"` - SSHKeyPairName *string `mapstructure:"ssh_keypair_name" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` + SSHKeyPairName *string `mapstructure:"ssh_keypair_name" undocumented:"true" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" undocumented:"true" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` SSHCiphers []string `mapstructure:"ssh_ciphers" cty:"ssh_ciphers" hcl:"ssh_ciphers"` SSHClearAuthorizedKeys *bool `mapstructure:"ssh_clear_authorized_keys" cty:"ssh_clear_authorized_keys" hcl:"ssh_clear_authorized_keys"` @@ -99,7 +99,7 @@ type FlatConfig struct { SSHPty *bool `mapstructure:"ssh_pty" cty:"ssh_pty" hcl:"ssh_pty"` SSHTimeout *string `mapstructure:"ssh_timeout" cty:"ssh_timeout" hcl:"ssh_timeout"` SSHWaitTimeout *string `mapstructure:"ssh_wait_timeout" undocumented:"true" cty:"ssh_wait_timeout" hcl:"ssh_wait_timeout"` - SSHAgentAuth *bool `mapstructure:"ssh_agent_auth" cty:"ssh_agent_auth" hcl:"ssh_agent_auth"` + SSHAgentAuth *bool `mapstructure:"ssh_agent_auth" undocumented:"true" cty:"ssh_agent_auth" hcl:"ssh_agent_auth"` SSHDisableAgentForwarding *bool `mapstructure:"ssh_disable_agent_forwarding" cty:"ssh_disable_agent_forwarding" hcl:"ssh_disable_agent_forwarding"` SSHHandshakeAttempts *int `mapstructure:"ssh_handshake_attempts" cty:"ssh_handshake_attempts" hcl:"ssh_handshake_attempts"` SSHBastionHost *string `mapstructure:"ssh_bastion_host" cty:"ssh_bastion_host" hcl:"ssh_bastion_host"` diff --git a/builder/cloudstack/config.hcl2spec.go b/builder/cloudstack/config.hcl2spec.go index 613dca946..f6b4d5313 100644 --- a/builder/cloudstack/config.hcl2spec.go +++ b/builder/cloudstack/config.hcl2spec.go @@ -26,7 +26,7 @@ type FlatConfig struct { SSHPort *int `mapstructure:"ssh_port" cty:"ssh_port" hcl:"ssh_port"` SSHUsername *string `mapstructure:"ssh_username" cty:"ssh_username" hcl:"ssh_username"` SSHPassword *string `mapstructure:"ssh_password" cty:"ssh_password" hcl:"ssh_password"` - SSHKeyPairName *string `mapstructure:"ssh_keypair_name" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` + SSHKeyPairName *string `mapstructure:"ssh_keypair_name" undocumented:"true" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" undocumented:"true" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` SSHCiphers []string `mapstructure:"ssh_ciphers" cty:"ssh_ciphers" hcl:"ssh_ciphers"` SSHClearAuthorizedKeys *bool `mapstructure:"ssh_clear_authorized_keys" cty:"ssh_clear_authorized_keys" hcl:"ssh_clear_authorized_keys"` @@ -34,7 +34,7 @@ type FlatConfig struct { SSHPty *bool `mapstructure:"ssh_pty" cty:"ssh_pty" hcl:"ssh_pty"` SSHTimeout *string `mapstructure:"ssh_timeout" cty:"ssh_timeout" hcl:"ssh_timeout"` SSHWaitTimeout *string `mapstructure:"ssh_wait_timeout" undocumented:"true" cty:"ssh_wait_timeout" hcl:"ssh_wait_timeout"` - SSHAgentAuth *bool `mapstructure:"ssh_agent_auth" cty:"ssh_agent_auth" hcl:"ssh_agent_auth"` + SSHAgentAuth *bool `mapstructure:"ssh_agent_auth" undocumented:"true" cty:"ssh_agent_auth" hcl:"ssh_agent_auth"` SSHDisableAgentForwarding *bool `mapstructure:"ssh_disable_agent_forwarding" cty:"ssh_disable_agent_forwarding" hcl:"ssh_disable_agent_forwarding"` SSHHandshakeAttempts *int `mapstructure:"ssh_handshake_attempts" cty:"ssh_handshake_attempts" hcl:"ssh_handshake_attempts"` SSHBastionHost *string `mapstructure:"ssh_bastion_host" cty:"ssh_bastion_host" hcl:"ssh_bastion_host"` diff --git a/builder/digitalocean/config.hcl2spec.go b/builder/digitalocean/config.hcl2spec.go index 03e1be044..750e63b8a 100644 --- a/builder/digitalocean/config.hcl2spec.go +++ b/builder/digitalocean/config.hcl2spec.go @@ -22,7 +22,7 @@ type FlatConfig struct { SSHPort *int `mapstructure:"ssh_port" cty:"ssh_port" hcl:"ssh_port"` SSHUsername *string `mapstructure:"ssh_username" cty:"ssh_username" hcl:"ssh_username"` SSHPassword *string `mapstructure:"ssh_password" cty:"ssh_password" hcl:"ssh_password"` - SSHKeyPairName *string `mapstructure:"ssh_keypair_name" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` + SSHKeyPairName *string `mapstructure:"ssh_keypair_name" undocumented:"true" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" undocumented:"true" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` SSHCiphers []string `mapstructure:"ssh_ciphers" cty:"ssh_ciphers" hcl:"ssh_ciphers"` SSHClearAuthorizedKeys *bool `mapstructure:"ssh_clear_authorized_keys" cty:"ssh_clear_authorized_keys" hcl:"ssh_clear_authorized_keys"` @@ -30,7 +30,7 @@ type FlatConfig struct { SSHPty *bool `mapstructure:"ssh_pty" cty:"ssh_pty" hcl:"ssh_pty"` SSHTimeout *string `mapstructure:"ssh_timeout" cty:"ssh_timeout" hcl:"ssh_timeout"` SSHWaitTimeout *string `mapstructure:"ssh_wait_timeout" undocumented:"true" cty:"ssh_wait_timeout" hcl:"ssh_wait_timeout"` - SSHAgentAuth *bool `mapstructure:"ssh_agent_auth" cty:"ssh_agent_auth" hcl:"ssh_agent_auth"` + SSHAgentAuth *bool `mapstructure:"ssh_agent_auth" undocumented:"true" cty:"ssh_agent_auth" hcl:"ssh_agent_auth"` SSHDisableAgentForwarding *bool `mapstructure:"ssh_disable_agent_forwarding" cty:"ssh_disable_agent_forwarding" hcl:"ssh_disable_agent_forwarding"` SSHHandshakeAttempts *int `mapstructure:"ssh_handshake_attempts" cty:"ssh_handshake_attempts" hcl:"ssh_handshake_attempts"` SSHBastionHost *string `mapstructure:"ssh_bastion_host" cty:"ssh_bastion_host" hcl:"ssh_bastion_host"` diff --git a/builder/docker/config.hcl2spec.go b/builder/docker/config.hcl2spec.go index 9d26e56fa..3f81426f2 100644 --- a/builder/docker/config.hcl2spec.go +++ b/builder/docker/config.hcl2spec.go @@ -22,7 +22,7 @@ type FlatConfig struct { SSHPort *int `mapstructure:"ssh_port" cty:"ssh_port" hcl:"ssh_port"` SSHUsername *string `mapstructure:"ssh_username" cty:"ssh_username" hcl:"ssh_username"` SSHPassword *string `mapstructure:"ssh_password" cty:"ssh_password" hcl:"ssh_password"` - SSHKeyPairName *string `mapstructure:"ssh_keypair_name" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` + SSHKeyPairName *string `mapstructure:"ssh_keypair_name" undocumented:"true" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" undocumented:"true" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` SSHCiphers []string `mapstructure:"ssh_ciphers" cty:"ssh_ciphers" hcl:"ssh_ciphers"` SSHClearAuthorizedKeys *bool `mapstructure:"ssh_clear_authorized_keys" cty:"ssh_clear_authorized_keys" hcl:"ssh_clear_authorized_keys"` @@ -30,7 +30,7 @@ type FlatConfig struct { SSHPty *bool `mapstructure:"ssh_pty" cty:"ssh_pty" hcl:"ssh_pty"` SSHTimeout *string `mapstructure:"ssh_timeout" cty:"ssh_timeout" hcl:"ssh_timeout"` SSHWaitTimeout *string `mapstructure:"ssh_wait_timeout" undocumented:"true" cty:"ssh_wait_timeout" hcl:"ssh_wait_timeout"` - SSHAgentAuth *bool `mapstructure:"ssh_agent_auth" cty:"ssh_agent_auth" hcl:"ssh_agent_auth"` + SSHAgentAuth *bool `mapstructure:"ssh_agent_auth" undocumented:"true" cty:"ssh_agent_auth" hcl:"ssh_agent_auth"` SSHDisableAgentForwarding *bool `mapstructure:"ssh_disable_agent_forwarding" cty:"ssh_disable_agent_forwarding" hcl:"ssh_disable_agent_forwarding"` SSHHandshakeAttempts *int `mapstructure:"ssh_handshake_attempts" cty:"ssh_handshake_attempts" hcl:"ssh_handshake_attempts"` SSHBastionHost *string `mapstructure:"ssh_bastion_host" cty:"ssh_bastion_host" hcl:"ssh_bastion_host"` diff --git a/builder/googlecompute/config.hcl2spec.go b/builder/googlecompute/config.hcl2spec.go index ed515a034..c3138cf42 100644 --- a/builder/googlecompute/config.hcl2spec.go +++ b/builder/googlecompute/config.hcl2spec.go @@ -22,7 +22,7 @@ type FlatConfig struct { SSHPort *int `mapstructure:"ssh_port" cty:"ssh_port" hcl:"ssh_port"` SSHUsername *string `mapstructure:"ssh_username" cty:"ssh_username" hcl:"ssh_username"` SSHPassword *string `mapstructure:"ssh_password" cty:"ssh_password" hcl:"ssh_password"` - SSHKeyPairName *string `mapstructure:"ssh_keypair_name" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` + SSHKeyPairName *string `mapstructure:"ssh_keypair_name" undocumented:"true" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" undocumented:"true" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` SSHCiphers []string `mapstructure:"ssh_ciphers" cty:"ssh_ciphers" hcl:"ssh_ciphers"` SSHClearAuthorizedKeys *bool `mapstructure:"ssh_clear_authorized_keys" cty:"ssh_clear_authorized_keys" hcl:"ssh_clear_authorized_keys"` @@ -30,7 +30,7 @@ type FlatConfig struct { SSHPty *bool `mapstructure:"ssh_pty" cty:"ssh_pty" hcl:"ssh_pty"` SSHTimeout *string `mapstructure:"ssh_timeout" cty:"ssh_timeout" hcl:"ssh_timeout"` SSHWaitTimeout *string `mapstructure:"ssh_wait_timeout" undocumented:"true" cty:"ssh_wait_timeout" hcl:"ssh_wait_timeout"` - SSHAgentAuth *bool `mapstructure:"ssh_agent_auth" cty:"ssh_agent_auth" hcl:"ssh_agent_auth"` + SSHAgentAuth *bool `mapstructure:"ssh_agent_auth" undocumented:"true" cty:"ssh_agent_auth" hcl:"ssh_agent_auth"` SSHDisableAgentForwarding *bool `mapstructure:"ssh_disable_agent_forwarding" cty:"ssh_disable_agent_forwarding" hcl:"ssh_disable_agent_forwarding"` SSHHandshakeAttempts *int `mapstructure:"ssh_handshake_attempts" cty:"ssh_handshake_attempts" hcl:"ssh_handshake_attempts"` SSHBastionHost *string `mapstructure:"ssh_bastion_host" cty:"ssh_bastion_host" hcl:"ssh_bastion_host"` diff --git a/builder/hcloud/config.hcl2spec.go b/builder/hcloud/config.hcl2spec.go index d520c9f61..5c11070db 100644 --- a/builder/hcloud/config.hcl2spec.go +++ b/builder/hcloud/config.hcl2spec.go @@ -22,7 +22,7 @@ type FlatConfig struct { SSHPort *int `mapstructure:"ssh_port" cty:"ssh_port" hcl:"ssh_port"` SSHUsername *string `mapstructure:"ssh_username" cty:"ssh_username" hcl:"ssh_username"` SSHPassword *string `mapstructure:"ssh_password" cty:"ssh_password" hcl:"ssh_password"` - SSHKeyPairName *string `mapstructure:"ssh_keypair_name" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` + SSHKeyPairName *string `mapstructure:"ssh_keypair_name" undocumented:"true" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" undocumented:"true" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` SSHCiphers []string `mapstructure:"ssh_ciphers" cty:"ssh_ciphers" hcl:"ssh_ciphers"` SSHClearAuthorizedKeys *bool `mapstructure:"ssh_clear_authorized_keys" cty:"ssh_clear_authorized_keys" hcl:"ssh_clear_authorized_keys"` @@ -30,7 +30,7 @@ type FlatConfig struct { SSHPty *bool `mapstructure:"ssh_pty" cty:"ssh_pty" hcl:"ssh_pty"` SSHTimeout *string `mapstructure:"ssh_timeout" cty:"ssh_timeout" hcl:"ssh_timeout"` SSHWaitTimeout *string `mapstructure:"ssh_wait_timeout" undocumented:"true" cty:"ssh_wait_timeout" hcl:"ssh_wait_timeout"` - SSHAgentAuth *bool `mapstructure:"ssh_agent_auth" cty:"ssh_agent_auth" hcl:"ssh_agent_auth"` + SSHAgentAuth *bool `mapstructure:"ssh_agent_auth" undocumented:"true" cty:"ssh_agent_auth" hcl:"ssh_agent_auth"` SSHDisableAgentForwarding *bool `mapstructure:"ssh_disable_agent_forwarding" cty:"ssh_disable_agent_forwarding" hcl:"ssh_disable_agent_forwarding"` SSHHandshakeAttempts *int `mapstructure:"ssh_handshake_attempts" cty:"ssh_handshake_attempts" hcl:"ssh_handshake_attempts"` SSHBastionHost *string `mapstructure:"ssh_bastion_host" cty:"ssh_bastion_host" hcl:"ssh_bastion_host"` diff --git a/builder/hyperone/config.hcl2spec.go b/builder/hyperone/config.hcl2spec.go index ef0085d45..578de5631 100644 --- a/builder/hyperone/config.hcl2spec.go +++ b/builder/hyperone/config.hcl2spec.go @@ -23,7 +23,7 @@ type FlatConfig struct { SSHPort *int `mapstructure:"ssh_port" cty:"ssh_port" hcl:"ssh_port"` SSHUsername *string `mapstructure:"ssh_username" cty:"ssh_username" hcl:"ssh_username"` SSHPassword *string `mapstructure:"ssh_password" cty:"ssh_password" hcl:"ssh_password"` - SSHKeyPairName *string `mapstructure:"ssh_keypair_name" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` + SSHKeyPairName *string `mapstructure:"ssh_keypair_name" undocumented:"true" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" undocumented:"true" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` SSHCiphers []string `mapstructure:"ssh_ciphers" cty:"ssh_ciphers" hcl:"ssh_ciphers"` SSHClearAuthorizedKeys *bool `mapstructure:"ssh_clear_authorized_keys" cty:"ssh_clear_authorized_keys" hcl:"ssh_clear_authorized_keys"` @@ -31,7 +31,7 @@ type FlatConfig struct { SSHPty *bool `mapstructure:"ssh_pty" cty:"ssh_pty" hcl:"ssh_pty"` SSHTimeout *string `mapstructure:"ssh_timeout" cty:"ssh_timeout" hcl:"ssh_timeout"` SSHWaitTimeout *string `mapstructure:"ssh_wait_timeout" undocumented:"true" cty:"ssh_wait_timeout" hcl:"ssh_wait_timeout"` - SSHAgentAuth *bool `mapstructure:"ssh_agent_auth" cty:"ssh_agent_auth" hcl:"ssh_agent_auth"` + SSHAgentAuth *bool `mapstructure:"ssh_agent_auth" undocumented:"true" cty:"ssh_agent_auth" hcl:"ssh_agent_auth"` SSHDisableAgentForwarding *bool `mapstructure:"ssh_disable_agent_forwarding" cty:"ssh_disable_agent_forwarding" hcl:"ssh_disable_agent_forwarding"` SSHHandshakeAttempts *int `mapstructure:"ssh_handshake_attempts" cty:"ssh_handshake_attempts" hcl:"ssh_handshake_attempts"` SSHBastionHost *string `mapstructure:"ssh_bastion_host" cty:"ssh_bastion_host" hcl:"ssh_bastion_host"` diff --git a/builder/hyperv/iso/builder.hcl2spec.go b/builder/hyperv/iso/builder.hcl2spec.go index c31441593..25d258890 100644 --- a/builder/hyperv/iso/builder.hcl2spec.go +++ b/builder/hyperv/iso/builder.hcl2spec.go @@ -35,7 +35,7 @@ type FlatConfig struct { SSHPort *int `mapstructure:"ssh_port" cty:"ssh_port" hcl:"ssh_port"` SSHUsername *string `mapstructure:"ssh_username" cty:"ssh_username" hcl:"ssh_username"` SSHPassword *string `mapstructure:"ssh_password" cty:"ssh_password" hcl:"ssh_password"` - SSHKeyPairName *string `mapstructure:"ssh_keypair_name" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` + SSHKeyPairName *string `mapstructure:"ssh_keypair_name" undocumented:"true" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" undocumented:"true" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` SSHCiphers []string `mapstructure:"ssh_ciphers" cty:"ssh_ciphers" hcl:"ssh_ciphers"` SSHClearAuthorizedKeys *bool `mapstructure:"ssh_clear_authorized_keys" cty:"ssh_clear_authorized_keys" hcl:"ssh_clear_authorized_keys"` @@ -43,7 +43,7 @@ type FlatConfig struct { SSHPty *bool `mapstructure:"ssh_pty" cty:"ssh_pty" hcl:"ssh_pty"` SSHTimeout *string `mapstructure:"ssh_timeout" cty:"ssh_timeout" hcl:"ssh_timeout"` SSHWaitTimeout *string `mapstructure:"ssh_wait_timeout" undocumented:"true" cty:"ssh_wait_timeout" hcl:"ssh_wait_timeout"` - SSHAgentAuth *bool `mapstructure:"ssh_agent_auth" cty:"ssh_agent_auth" hcl:"ssh_agent_auth"` + SSHAgentAuth *bool `mapstructure:"ssh_agent_auth" undocumented:"true" cty:"ssh_agent_auth" hcl:"ssh_agent_auth"` SSHDisableAgentForwarding *bool `mapstructure:"ssh_disable_agent_forwarding" cty:"ssh_disable_agent_forwarding" hcl:"ssh_disable_agent_forwarding"` SSHHandshakeAttempts *int `mapstructure:"ssh_handshake_attempts" cty:"ssh_handshake_attempts" hcl:"ssh_handshake_attempts"` SSHBastionHost *string `mapstructure:"ssh_bastion_host" cty:"ssh_bastion_host" hcl:"ssh_bastion_host"` diff --git a/builder/hyperv/vmcx/builder.hcl2spec.go b/builder/hyperv/vmcx/builder.hcl2spec.go index 555547ed4..a20815353 100644 --- a/builder/hyperv/vmcx/builder.hcl2spec.go +++ b/builder/hyperv/vmcx/builder.hcl2spec.go @@ -35,7 +35,7 @@ type FlatConfig struct { SSHPort *int `mapstructure:"ssh_port" cty:"ssh_port" hcl:"ssh_port"` SSHUsername *string `mapstructure:"ssh_username" cty:"ssh_username" hcl:"ssh_username"` SSHPassword *string `mapstructure:"ssh_password" cty:"ssh_password" hcl:"ssh_password"` - SSHKeyPairName *string `mapstructure:"ssh_keypair_name" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` + SSHKeyPairName *string `mapstructure:"ssh_keypair_name" undocumented:"true" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" undocumented:"true" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` SSHCiphers []string `mapstructure:"ssh_ciphers" cty:"ssh_ciphers" hcl:"ssh_ciphers"` SSHClearAuthorizedKeys *bool `mapstructure:"ssh_clear_authorized_keys" cty:"ssh_clear_authorized_keys" hcl:"ssh_clear_authorized_keys"` @@ -43,7 +43,7 @@ type FlatConfig struct { SSHPty *bool `mapstructure:"ssh_pty" cty:"ssh_pty" hcl:"ssh_pty"` SSHTimeout *string `mapstructure:"ssh_timeout" cty:"ssh_timeout" hcl:"ssh_timeout"` SSHWaitTimeout *string `mapstructure:"ssh_wait_timeout" undocumented:"true" cty:"ssh_wait_timeout" hcl:"ssh_wait_timeout"` - SSHAgentAuth *bool `mapstructure:"ssh_agent_auth" cty:"ssh_agent_auth" hcl:"ssh_agent_auth"` + SSHAgentAuth *bool `mapstructure:"ssh_agent_auth" undocumented:"true" cty:"ssh_agent_auth" hcl:"ssh_agent_auth"` SSHDisableAgentForwarding *bool `mapstructure:"ssh_disable_agent_forwarding" cty:"ssh_disable_agent_forwarding" hcl:"ssh_disable_agent_forwarding"` SSHHandshakeAttempts *int `mapstructure:"ssh_handshake_attempts" cty:"ssh_handshake_attempts" hcl:"ssh_handshake_attempts"` SSHBastionHost *string `mapstructure:"ssh_bastion_host" cty:"ssh_bastion_host" hcl:"ssh_bastion_host"` diff --git a/builder/jdcloud/common.hcl2spec.go b/builder/jdcloud/common.hcl2spec.go index 3503ff9a6..2a1433676 100644 --- a/builder/jdcloud/common.hcl2spec.go +++ b/builder/jdcloud/common.hcl2spec.go @@ -24,7 +24,7 @@ type FlatConfig struct { SSHPort *int `mapstructure:"ssh_port" cty:"ssh_port" hcl:"ssh_port"` SSHUsername *string `mapstructure:"ssh_username" cty:"ssh_username" hcl:"ssh_username"` SSHPassword *string `mapstructure:"ssh_password" cty:"ssh_password" hcl:"ssh_password"` - SSHKeyPairName *string `mapstructure:"ssh_keypair_name" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` + SSHKeyPairName *string `mapstructure:"ssh_keypair_name" undocumented:"true" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" undocumented:"true" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` SSHCiphers []string `mapstructure:"ssh_ciphers" cty:"ssh_ciphers" hcl:"ssh_ciphers"` SSHClearAuthorizedKeys *bool `mapstructure:"ssh_clear_authorized_keys" cty:"ssh_clear_authorized_keys" hcl:"ssh_clear_authorized_keys"` @@ -32,7 +32,7 @@ type FlatConfig struct { SSHPty *bool `mapstructure:"ssh_pty" cty:"ssh_pty" hcl:"ssh_pty"` SSHTimeout *string `mapstructure:"ssh_timeout" cty:"ssh_timeout" hcl:"ssh_timeout"` SSHWaitTimeout *string `mapstructure:"ssh_wait_timeout" undocumented:"true" cty:"ssh_wait_timeout" hcl:"ssh_wait_timeout"` - SSHAgentAuth *bool `mapstructure:"ssh_agent_auth" cty:"ssh_agent_auth" hcl:"ssh_agent_auth"` + SSHAgentAuth *bool `mapstructure:"ssh_agent_auth" undocumented:"true" cty:"ssh_agent_auth" hcl:"ssh_agent_auth"` SSHDisableAgentForwarding *bool `mapstructure:"ssh_disable_agent_forwarding" cty:"ssh_disable_agent_forwarding" hcl:"ssh_disable_agent_forwarding"` SSHHandshakeAttempts *int `mapstructure:"ssh_handshake_attempts" cty:"ssh_handshake_attempts" hcl:"ssh_handshake_attempts"` SSHBastionHost *string `mapstructure:"ssh_bastion_host" cty:"ssh_bastion_host" hcl:"ssh_bastion_host"` diff --git a/builder/linode/config.hcl2spec.go b/builder/linode/config.hcl2spec.go index b5af47e68..9f8e00eda 100644 --- a/builder/linode/config.hcl2spec.go +++ b/builder/linode/config.hcl2spec.go @@ -22,7 +22,7 @@ type FlatConfig struct { SSHPort *int `mapstructure:"ssh_port" cty:"ssh_port" hcl:"ssh_port"` SSHUsername *string `mapstructure:"ssh_username" cty:"ssh_username" hcl:"ssh_username"` SSHPassword *string `mapstructure:"ssh_password" cty:"ssh_password" hcl:"ssh_password"` - SSHKeyPairName *string `mapstructure:"ssh_keypair_name" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` + SSHKeyPairName *string `mapstructure:"ssh_keypair_name" undocumented:"true" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" undocumented:"true" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` SSHCiphers []string `mapstructure:"ssh_ciphers" cty:"ssh_ciphers" hcl:"ssh_ciphers"` SSHClearAuthorizedKeys *bool `mapstructure:"ssh_clear_authorized_keys" cty:"ssh_clear_authorized_keys" hcl:"ssh_clear_authorized_keys"` @@ -30,7 +30,7 @@ type FlatConfig struct { SSHPty *bool `mapstructure:"ssh_pty" cty:"ssh_pty" hcl:"ssh_pty"` SSHTimeout *string `mapstructure:"ssh_timeout" cty:"ssh_timeout" hcl:"ssh_timeout"` SSHWaitTimeout *string `mapstructure:"ssh_wait_timeout" undocumented:"true" cty:"ssh_wait_timeout" hcl:"ssh_wait_timeout"` - SSHAgentAuth *bool `mapstructure:"ssh_agent_auth" cty:"ssh_agent_auth" hcl:"ssh_agent_auth"` + SSHAgentAuth *bool `mapstructure:"ssh_agent_auth" undocumented:"true" cty:"ssh_agent_auth" hcl:"ssh_agent_auth"` SSHDisableAgentForwarding *bool `mapstructure:"ssh_disable_agent_forwarding" cty:"ssh_disable_agent_forwarding" hcl:"ssh_disable_agent_forwarding"` SSHHandshakeAttempts *int `mapstructure:"ssh_handshake_attempts" cty:"ssh_handshake_attempts" hcl:"ssh_handshake_attempts"` SSHBastionHost *string `mapstructure:"ssh_bastion_host" cty:"ssh_bastion_host" hcl:"ssh_bastion_host"` diff --git a/builder/ncloud/config.hcl2spec.go b/builder/ncloud/config.hcl2spec.go index 7064234d3..9fdb79d46 100644 --- a/builder/ncloud/config.hcl2spec.go +++ b/builder/ncloud/config.hcl2spec.go @@ -34,7 +34,7 @@ type FlatConfig struct { SSHPort *int `mapstructure:"ssh_port" cty:"ssh_port" hcl:"ssh_port"` SSHUsername *string `mapstructure:"ssh_username" cty:"ssh_username" hcl:"ssh_username"` SSHPassword *string `mapstructure:"ssh_password" cty:"ssh_password" hcl:"ssh_password"` - SSHKeyPairName *string `mapstructure:"ssh_keypair_name" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` + SSHKeyPairName *string `mapstructure:"ssh_keypair_name" undocumented:"true" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" undocumented:"true" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` SSHCiphers []string `mapstructure:"ssh_ciphers" cty:"ssh_ciphers" hcl:"ssh_ciphers"` SSHClearAuthorizedKeys *bool `mapstructure:"ssh_clear_authorized_keys" cty:"ssh_clear_authorized_keys" hcl:"ssh_clear_authorized_keys"` @@ -42,7 +42,7 @@ type FlatConfig struct { SSHPty *bool `mapstructure:"ssh_pty" cty:"ssh_pty" hcl:"ssh_pty"` SSHTimeout *string `mapstructure:"ssh_timeout" cty:"ssh_timeout" hcl:"ssh_timeout"` SSHWaitTimeout *string `mapstructure:"ssh_wait_timeout" undocumented:"true" cty:"ssh_wait_timeout" hcl:"ssh_wait_timeout"` - SSHAgentAuth *bool `mapstructure:"ssh_agent_auth" cty:"ssh_agent_auth" hcl:"ssh_agent_auth"` + SSHAgentAuth *bool `mapstructure:"ssh_agent_auth" undocumented:"true" cty:"ssh_agent_auth" hcl:"ssh_agent_auth"` SSHDisableAgentForwarding *bool `mapstructure:"ssh_disable_agent_forwarding" cty:"ssh_disable_agent_forwarding" hcl:"ssh_disable_agent_forwarding"` SSHHandshakeAttempts *int `mapstructure:"ssh_handshake_attempts" cty:"ssh_handshake_attempts" hcl:"ssh_handshake_attempts"` SSHBastionHost *string `mapstructure:"ssh_bastion_host" cty:"ssh_bastion_host" hcl:"ssh_bastion_host"` diff --git a/builder/null/config.hcl2spec.go b/builder/null/config.hcl2spec.go index 44a8f7e45..9a4efa365 100644 --- a/builder/null/config.hcl2spec.go +++ b/builder/null/config.hcl2spec.go @@ -22,7 +22,7 @@ type FlatConfig struct { SSHPort *int `mapstructure:"ssh_port" cty:"ssh_port" hcl:"ssh_port"` SSHUsername *string `mapstructure:"ssh_username" cty:"ssh_username" hcl:"ssh_username"` SSHPassword *string `mapstructure:"ssh_password" cty:"ssh_password" hcl:"ssh_password"` - SSHKeyPairName *string `mapstructure:"ssh_keypair_name" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` + SSHKeyPairName *string `mapstructure:"ssh_keypair_name" undocumented:"true" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" undocumented:"true" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` SSHCiphers []string `mapstructure:"ssh_ciphers" cty:"ssh_ciphers" hcl:"ssh_ciphers"` SSHClearAuthorizedKeys *bool `mapstructure:"ssh_clear_authorized_keys" cty:"ssh_clear_authorized_keys" hcl:"ssh_clear_authorized_keys"` @@ -30,7 +30,7 @@ type FlatConfig struct { SSHPty *bool `mapstructure:"ssh_pty" cty:"ssh_pty" hcl:"ssh_pty"` SSHTimeout *string `mapstructure:"ssh_timeout" cty:"ssh_timeout" hcl:"ssh_timeout"` SSHWaitTimeout *string `mapstructure:"ssh_wait_timeout" undocumented:"true" cty:"ssh_wait_timeout" hcl:"ssh_wait_timeout"` - SSHAgentAuth *bool `mapstructure:"ssh_agent_auth" cty:"ssh_agent_auth" hcl:"ssh_agent_auth"` + SSHAgentAuth *bool `mapstructure:"ssh_agent_auth" undocumented:"true" cty:"ssh_agent_auth" hcl:"ssh_agent_auth"` SSHDisableAgentForwarding *bool `mapstructure:"ssh_disable_agent_forwarding" cty:"ssh_disable_agent_forwarding" hcl:"ssh_disable_agent_forwarding"` SSHHandshakeAttempts *int `mapstructure:"ssh_handshake_attempts" cty:"ssh_handshake_attempts" hcl:"ssh_handshake_attempts"` SSHBastionHost *string `mapstructure:"ssh_bastion_host" cty:"ssh_bastion_host" hcl:"ssh_bastion_host"` diff --git a/builder/oneandone/config.hcl2spec.go b/builder/oneandone/config.hcl2spec.go index 64e703c0c..19a56f1a0 100644 --- a/builder/oneandone/config.hcl2spec.go +++ b/builder/oneandone/config.hcl2spec.go @@ -22,7 +22,7 @@ type FlatConfig struct { SSHPort *int `mapstructure:"ssh_port" cty:"ssh_port" hcl:"ssh_port"` SSHUsername *string `mapstructure:"ssh_username" cty:"ssh_username" hcl:"ssh_username"` SSHPassword *string `mapstructure:"ssh_password" cty:"ssh_password" hcl:"ssh_password"` - SSHKeyPairName *string `mapstructure:"ssh_keypair_name" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` + SSHKeyPairName *string `mapstructure:"ssh_keypair_name" undocumented:"true" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" undocumented:"true" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` SSHCiphers []string `mapstructure:"ssh_ciphers" cty:"ssh_ciphers" hcl:"ssh_ciphers"` SSHClearAuthorizedKeys *bool `mapstructure:"ssh_clear_authorized_keys" cty:"ssh_clear_authorized_keys" hcl:"ssh_clear_authorized_keys"` @@ -30,7 +30,7 @@ type FlatConfig struct { SSHPty *bool `mapstructure:"ssh_pty" cty:"ssh_pty" hcl:"ssh_pty"` SSHTimeout *string `mapstructure:"ssh_timeout" cty:"ssh_timeout" hcl:"ssh_timeout"` SSHWaitTimeout *string `mapstructure:"ssh_wait_timeout" undocumented:"true" cty:"ssh_wait_timeout" hcl:"ssh_wait_timeout"` - SSHAgentAuth *bool `mapstructure:"ssh_agent_auth" cty:"ssh_agent_auth" hcl:"ssh_agent_auth"` + SSHAgentAuth *bool `mapstructure:"ssh_agent_auth" undocumented:"true" cty:"ssh_agent_auth" hcl:"ssh_agent_auth"` SSHDisableAgentForwarding *bool `mapstructure:"ssh_disable_agent_forwarding" cty:"ssh_disable_agent_forwarding" hcl:"ssh_disable_agent_forwarding"` SSHHandshakeAttempts *int `mapstructure:"ssh_handshake_attempts" cty:"ssh_handshake_attempts" hcl:"ssh_handshake_attempts"` SSHBastionHost *string `mapstructure:"ssh_bastion_host" cty:"ssh_bastion_host" hcl:"ssh_bastion_host"` diff --git a/builder/openstack/builder.hcl2spec.go b/builder/openstack/builder.hcl2spec.go index 4429efb4a..600fd1767 100644 --- a/builder/openstack/builder.hcl2spec.go +++ b/builder/openstack/builder.hcl2spec.go @@ -50,7 +50,7 @@ type FlatConfig struct { SSHPort *int `mapstructure:"ssh_port" cty:"ssh_port" hcl:"ssh_port"` SSHUsername *string `mapstructure:"ssh_username" cty:"ssh_username" hcl:"ssh_username"` SSHPassword *string `mapstructure:"ssh_password" cty:"ssh_password" hcl:"ssh_password"` - SSHKeyPairName *string `mapstructure:"ssh_keypair_name" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` + SSHKeyPairName *string `mapstructure:"ssh_keypair_name" undocumented:"true" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" undocumented:"true" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` SSHCiphers []string `mapstructure:"ssh_ciphers" cty:"ssh_ciphers" hcl:"ssh_ciphers"` SSHClearAuthorizedKeys *bool `mapstructure:"ssh_clear_authorized_keys" cty:"ssh_clear_authorized_keys" hcl:"ssh_clear_authorized_keys"` @@ -58,7 +58,7 @@ type FlatConfig struct { SSHPty *bool `mapstructure:"ssh_pty" cty:"ssh_pty" hcl:"ssh_pty"` SSHTimeout *string `mapstructure:"ssh_timeout" cty:"ssh_timeout" hcl:"ssh_timeout"` SSHWaitTimeout *string `mapstructure:"ssh_wait_timeout" undocumented:"true" cty:"ssh_wait_timeout" hcl:"ssh_wait_timeout"` - SSHAgentAuth *bool `mapstructure:"ssh_agent_auth" cty:"ssh_agent_auth" hcl:"ssh_agent_auth"` + SSHAgentAuth *bool `mapstructure:"ssh_agent_auth" undocumented:"true" cty:"ssh_agent_auth" hcl:"ssh_agent_auth"` SSHDisableAgentForwarding *bool `mapstructure:"ssh_disable_agent_forwarding" cty:"ssh_disable_agent_forwarding" hcl:"ssh_disable_agent_forwarding"` SSHHandshakeAttempts *int `mapstructure:"ssh_handshake_attempts" cty:"ssh_handshake_attempts" hcl:"ssh_handshake_attempts"` SSHBastionHost *string `mapstructure:"ssh_bastion_host" cty:"ssh_bastion_host" hcl:"ssh_bastion_host"` diff --git a/builder/oracle/classic/builder.hcl2spec.go b/builder/oracle/classic/builder.hcl2spec.go index ba0913a2e..f06da1d11 100644 --- a/builder/oracle/classic/builder.hcl2spec.go +++ b/builder/oracle/classic/builder.hcl2spec.go @@ -29,7 +29,7 @@ type FlatConfig struct { SSHPort *int `mapstructure:"ssh_port" cty:"ssh_port" hcl:"ssh_port"` SSHUsername *string `mapstructure:"ssh_username" cty:"ssh_username" hcl:"ssh_username"` SSHPassword *string `mapstructure:"ssh_password" cty:"ssh_password" hcl:"ssh_password"` - SSHKeyPairName *string `mapstructure:"ssh_keypair_name" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` + SSHKeyPairName *string `mapstructure:"ssh_keypair_name" undocumented:"true" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" undocumented:"true" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` SSHCiphers []string `mapstructure:"ssh_ciphers" cty:"ssh_ciphers" hcl:"ssh_ciphers"` SSHClearAuthorizedKeys *bool `mapstructure:"ssh_clear_authorized_keys" cty:"ssh_clear_authorized_keys" hcl:"ssh_clear_authorized_keys"` @@ -37,7 +37,7 @@ type FlatConfig struct { SSHPty *bool `mapstructure:"ssh_pty" cty:"ssh_pty" hcl:"ssh_pty"` SSHTimeout *string `mapstructure:"ssh_timeout" cty:"ssh_timeout" hcl:"ssh_timeout"` SSHWaitTimeout *string `mapstructure:"ssh_wait_timeout" undocumented:"true" cty:"ssh_wait_timeout" hcl:"ssh_wait_timeout"` - SSHAgentAuth *bool `mapstructure:"ssh_agent_auth" cty:"ssh_agent_auth" hcl:"ssh_agent_auth"` + SSHAgentAuth *bool `mapstructure:"ssh_agent_auth" undocumented:"true" cty:"ssh_agent_auth" hcl:"ssh_agent_auth"` SSHDisableAgentForwarding *bool `mapstructure:"ssh_disable_agent_forwarding" cty:"ssh_disable_agent_forwarding" hcl:"ssh_disable_agent_forwarding"` SSHHandshakeAttempts *int `mapstructure:"ssh_handshake_attempts" cty:"ssh_handshake_attempts" hcl:"ssh_handshake_attempts"` SSHBastionHost *string `mapstructure:"ssh_bastion_host" cty:"ssh_bastion_host" hcl:"ssh_bastion_host"` diff --git a/builder/oracle/oci/config.hcl2spec.go b/builder/oracle/oci/config.hcl2spec.go index 078c39b12..61b23ddd6 100644 --- a/builder/oracle/oci/config.hcl2spec.go +++ b/builder/oracle/oci/config.hcl2spec.go @@ -22,7 +22,7 @@ type FlatConfig struct { SSHPort *int `mapstructure:"ssh_port" cty:"ssh_port" hcl:"ssh_port"` SSHUsername *string `mapstructure:"ssh_username" cty:"ssh_username" hcl:"ssh_username"` SSHPassword *string `mapstructure:"ssh_password" cty:"ssh_password" hcl:"ssh_password"` - SSHKeyPairName *string `mapstructure:"ssh_keypair_name" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` + SSHKeyPairName *string `mapstructure:"ssh_keypair_name" undocumented:"true" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" undocumented:"true" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` SSHCiphers []string `mapstructure:"ssh_ciphers" cty:"ssh_ciphers" hcl:"ssh_ciphers"` SSHClearAuthorizedKeys *bool `mapstructure:"ssh_clear_authorized_keys" cty:"ssh_clear_authorized_keys" hcl:"ssh_clear_authorized_keys"` @@ -30,7 +30,7 @@ type FlatConfig struct { SSHPty *bool `mapstructure:"ssh_pty" cty:"ssh_pty" hcl:"ssh_pty"` SSHTimeout *string `mapstructure:"ssh_timeout" cty:"ssh_timeout" hcl:"ssh_timeout"` SSHWaitTimeout *string `mapstructure:"ssh_wait_timeout" undocumented:"true" cty:"ssh_wait_timeout" hcl:"ssh_wait_timeout"` - SSHAgentAuth *bool `mapstructure:"ssh_agent_auth" cty:"ssh_agent_auth" hcl:"ssh_agent_auth"` + SSHAgentAuth *bool `mapstructure:"ssh_agent_auth" undocumented:"true" cty:"ssh_agent_auth" hcl:"ssh_agent_auth"` SSHDisableAgentForwarding *bool `mapstructure:"ssh_disable_agent_forwarding" cty:"ssh_disable_agent_forwarding" hcl:"ssh_disable_agent_forwarding"` SSHHandshakeAttempts *int `mapstructure:"ssh_handshake_attempts" cty:"ssh_handshake_attempts" hcl:"ssh_handshake_attempts"` SSHBastionHost *string `mapstructure:"ssh_bastion_host" cty:"ssh_bastion_host" hcl:"ssh_bastion_host"` diff --git a/builder/osc/bsu/builder.hcl2spec.go b/builder/osc/bsu/builder.hcl2spec.go index 845674fe2..896a0a7e4 100644 --- a/builder/osc/bsu/builder.hcl2spec.go +++ b/builder/osc/bsu/builder.hcl2spec.go @@ -75,14 +75,14 @@ type FlatConfig struct { SSHPort *int `mapstructure:"ssh_port" cty:"ssh_port" hcl:"ssh_port"` SSHUsername *string `mapstructure:"ssh_username" cty:"ssh_username" hcl:"ssh_username"` SSHPassword *string `mapstructure:"ssh_password" cty:"ssh_password" hcl:"ssh_password"` - SSHKeyPairName *string `mapstructure:"ssh_keypair_name" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` + SSHKeyPairName *string `mapstructure:"ssh_keypair_name" undocumented:"true" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` SSHCiphers []string `mapstructure:"ssh_ciphers" cty:"ssh_ciphers" hcl:"ssh_ciphers"` SSHClearAuthorizedKeys *bool `mapstructure:"ssh_clear_authorized_keys" cty:"ssh_clear_authorized_keys" hcl:"ssh_clear_authorized_keys"` SSHPrivateKeyFile *string `mapstructure:"ssh_private_key_file" undocumented:"true" cty:"ssh_private_key_file" hcl:"ssh_private_key_file"` SSHPty *bool `mapstructure:"ssh_pty" cty:"ssh_pty" hcl:"ssh_pty"` SSHTimeout *string `mapstructure:"ssh_timeout" cty:"ssh_timeout" hcl:"ssh_timeout"` SSHWaitTimeout *string `mapstructure:"ssh_wait_timeout" undocumented:"true" cty:"ssh_wait_timeout" hcl:"ssh_wait_timeout"` - SSHAgentAuth *bool `mapstructure:"ssh_agent_auth" cty:"ssh_agent_auth" hcl:"ssh_agent_auth"` + SSHAgentAuth *bool `mapstructure:"ssh_agent_auth" undocumented:"true" cty:"ssh_agent_auth" hcl:"ssh_agent_auth"` SSHDisableAgentForwarding *bool `mapstructure:"ssh_disable_agent_forwarding" cty:"ssh_disable_agent_forwarding" hcl:"ssh_disable_agent_forwarding"` SSHHandshakeAttempts *int `mapstructure:"ssh_handshake_attempts" cty:"ssh_handshake_attempts" hcl:"ssh_handshake_attempts"` SSHBastionHost *string `mapstructure:"ssh_bastion_host" cty:"ssh_bastion_host" hcl:"ssh_bastion_host"` diff --git a/builder/osc/bsusurrogate/builder.hcl2spec.go b/builder/osc/bsusurrogate/builder.hcl2spec.go index 515920ee0..3f9fdf4e9 100644 --- a/builder/osc/bsusurrogate/builder.hcl2spec.go +++ b/builder/osc/bsusurrogate/builder.hcl2spec.go @@ -60,14 +60,14 @@ type FlatConfig struct { SSHPort *int `mapstructure:"ssh_port" cty:"ssh_port" hcl:"ssh_port"` SSHUsername *string `mapstructure:"ssh_username" cty:"ssh_username" hcl:"ssh_username"` SSHPassword *string `mapstructure:"ssh_password" cty:"ssh_password" hcl:"ssh_password"` - SSHKeyPairName *string `mapstructure:"ssh_keypair_name" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` + SSHKeyPairName *string `mapstructure:"ssh_keypair_name" undocumented:"true" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` SSHCiphers []string `mapstructure:"ssh_ciphers" cty:"ssh_ciphers" hcl:"ssh_ciphers"` SSHClearAuthorizedKeys *bool `mapstructure:"ssh_clear_authorized_keys" cty:"ssh_clear_authorized_keys" hcl:"ssh_clear_authorized_keys"` SSHPrivateKeyFile *string `mapstructure:"ssh_private_key_file" undocumented:"true" cty:"ssh_private_key_file" hcl:"ssh_private_key_file"` SSHPty *bool `mapstructure:"ssh_pty" cty:"ssh_pty" hcl:"ssh_pty"` SSHTimeout *string `mapstructure:"ssh_timeout" cty:"ssh_timeout" hcl:"ssh_timeout"` SSHWaitTimeout *string `mapstructure:"ssh_wait_timeout" undocumented:"true" cty:"ssh_wait_timeout" hcl:"ssh_wait_timeout"` - SSHAgentAuth *bool `mapstructure:"ssh_agent_auth" cty:"ssh_agent_auth" hcl:"ssh_agent_auth"` + SSHAgentAuth *bool `mapstructure:"ssh_agent_auth" undocumented:"true" cty:"ssh_agent_auth" hcl:"ssh_agent_auth"` SSHDisableAgentForwarding *bool `mapstructure:"ssh_disable_agent_forwarding" cty:"ssh_disable_agent_forwarding" hcl:"ssh_disable_agent_forwarding"` SSHHandshakeAttempts *int `mapstructure:"ssh_handshake_attempts" cty:"ssh_handshake_attempts" hcl:"ssh_handshake_attempts"` SSHBastionHost *string `mapstructure:"ssh_bastion_host" cty:"ssh_bastion_host" hcl:"ssh_bastion_host"` diff --git a/builder/osc/bsuvolume/builder.hcl2spec.go b/builder/osc/bsuvolume/builder.hcl2spec.go index 6107dfc3f..2dc47d52e 100644 --- a/builder/osc/bsuvolume/builder.hcl2spec.go +++ b/builder/osc/bsuvolume/builder.hcl2spec.go @@ -99,14 +99,14 @@ type FlatConfig struct { SSHPort *int `mapstructure:"ssh_port" cty:"ssh_port" hcl:"ssh_port"` SSHUsername *string `mapstructure:"ssh_username" cty:"ssh_username" hcl:"ssh_username"` SSHPassword *string `mapstructure:"ssh_password" cty:"ssh_password" hcl:"ssh_password"` - SSHKeyPairName *string `mapstructure:"ssh_keypair_name" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` + SSHKeyPairName *string `mapstructure:"ssh_keypair_name" undocumented:"true" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` SSHCiphers []string `mapstructure:"ssh_ciphers" cty:"ssh_ciphers" hcl:"ssh_ciphers"` SSHClearAuthorizedKeys *bool `mapstructure:"ssh_clear_authorized_keys" cty:"ssh_clear_authorized_keys" hcl:"ssh_clear_authorized_keys"` SSHPrivateKeyFile *string `mapstructure:"ssh_private_key_file" undocumented:"true" cty:"ssh_private_key_file" hcl:"ssh_private_key_file"` SSHPty *bool `mapstructure:"ssh_pty" cty:"ssh_pty" hcl:"ssh_pty"` SSHTimeout *string `mapstructure:"ssh_timeout" cty:"ssh_timeout" hcl:"ssh_timeout"` SSHWaitTimeout *string `mapstructure:"ssh_wait_timeout" undocumented:"true" cty:"ssh_wait_timeout" hcl:"ssh_wait_timeout"` - SSHAgentAuth *bool `mapstructure:"ssh_agent_auth" cty:"ssh_agent_auth" hcl:"ssh_agent_auth"` + SSHAgentAuth *bool `mapstructure:"ssh_agent_auth" undocumented:"true" cty:"ssh_agent_auth" hcl:"ssh_agent_auth"` SSHDisableAgentForwarding *bool `mapstructure:"ssh_disable_agent_forwarding" cty:"ssh_disable_agent_forwarding" hcl:"ssh_disable_agent_forwarding"` SSHHandshakeAttempts *int `mapstructure:"ssh_handshake_attempts" cty:"ssh_handshake_attempts" hcl:"ssh_handshake_attempts"` SSHBastionHost *string `mapstructure:"ssh_bastion_host" cty:"ssh_bastion_host" hcl:"ssh_bastion_host"` diff --git a/builder/parallels/iso/builder.hcl2spec.go b/builder/parallels/iso/builder.hcl2spec.go index fb4ea20f3..d67094538 100644 --- a/builder/parallels/iso/builder.hcl2spec.go +++ b/builder/parallels/iso/builder.hcl2spec.go @@ -47,7 +47,7 @@ type FlatConfig struct { SSHPort *int `mapstructure:"ssh_port" cty:"ssh_port" hcl:"ssh_port"` SSHUsername *string `mapstructure:"ssh_username" cty:"ssh_username" hcl:"ssh_username"` SSHPassword *string `mapstructure:"ssh_password" cty:"ssh_password" hcl:"ssh_password"` - SSHKeyPairName *string `mapstructure:"ssh_keypair_name" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` + SSHKeyPairName *string `mapstructure:"ssh_keypair_name" undocumented:"true" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" undocumented:"true" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` SSHCiphers []string `mapstructure:"ssh_ciphers" cty:"ssh_ciphers" hcl:"ssh_ciphers"` SSHClearAuthorizedKeys *bool `mapstructure:"ssh_clear_authorized_keys" cty:"ssh_clear_authorized_keys" hcl:"ssh_clear_authorized_keys"` @@ -55,7 +55,7 @@ type FlatConfig struct { SSHPty *bool `mapstructure:"ssh_pty" cty:"ssh_pty" hcl:"ssh_pty"` SSHTimeout *string `mapstructure:"ssh_timeout" cty:"ssh_timeout" hcl:"ssh_timeout"` SSHWaitTimeout *string `mapstructure:"ssh_wait_timeout" undocumented:"true" cty:"ssh_wait_timeout" hcl:"ssh_wait_timeout"` - SSHAgentAuth *bool `mapstructure:"ssh_agent_auth" cty:"ssh_agent_auth" hcl:"ssh_agent_auth"` + SSHAgentAuth *bool `mapstructure:"ssh_agent_auth" undocumented:"true" cty:"ssh_agent_auth" hcl:"ssh_agent_auth"` SSHDisableAgentForwarding *bool `mapstructure:"ssh_disable_agent_forwarding" cty:"ssh_disable_agent_forwarding" hcl:"ssh_disable_agent_forwarding"` SSHHandshakeAttempts *int `mapstructure:"ssh_handshake_attempts" cty:"ssh_handshake_attempts" hcl:"ssh_handshake_attempts"` SSHBastionHost *string `mapstructure:"ssh_bastion_host" cty:"ssh_bastion_host" hcl:"ssh_bastion_host"` diff --git a/builder/parallels/pvm/config.hcl2spec.go b/builder/parallels/pvm/config.hcl2spec.go index 9e4c9375b..b600f6813 100644 --- a/builder/parallels/pvm/config.hcl2spec.go +++ b/builder/parallels/pvm/config.hcl2spec.go @@ -29,7 +29,7 @@ type FlatConfig struct { SSHPort *int `mapstructure:"ssh_port" cty:"ssh_port" hcl:"ssh_port"` SSHUsername *string `mapstructure:"ssh_username" cty:"ssh_username" hcl:"ssh_username"` SSHPassword *string `mapstructure:"ssh_password" cty:"ssh_password" hcl:"ssh_password"` - SSHKeyPairName *string `mapstructure:"ssh_keypair_name" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` + SSHKeyPairName *string `mapstructure:"ssh_keypair_name" undocumented:"true" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" undocumented:"true" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` SSHCiphers []string `mapstructure:"ssh_ciphers" cty:"ssh_ciphers" hcl:"ssh_ciphers"` SSHClearAuthorizedKeys *bool `mapstructure:"ssh_clear_authorized_keys" cty:"ssh_clear_authorized_keys" hcl:"ssh_clear_authorized_keys"` @@ -37,7 +37,7 @@ type FlatConfig struct { SSHPty *bool `mapstructure:"ssh_pty" cty:"ssh_pty" hcl:"ssh_pty"` SSHTimeout *string `mapstructure:"ssh_timeout" cty:"ssh_timeout" hcl:"ssh_timeout"` SSHWaitTimeout *string `mapstructure:"ssh_wait_timeout" undocumented:"true" cty:"ssh_wait_timeout" hcl:"ssh_wait_timeout"` - SSHAgentAuth *bool `mapstructure:"ssh_agent_auth" cty:"ssh_agent_auth" hcl:"ssh_agent_auth"` + SSHAgentAuth *bool `mapstructure:"ssh_agent_auth" undocumented:"true" cty:"ssh_agent_auth" hcl:"ssh_agent_auth"` SSHDisableAgentForwarding *bool `mapstructure:"ssh_disable_agent_forwarding" cty:"ssh_disable_agent_forwarding" hcl:"ssh_disable_agent_forwarding"` SSHHandshakeAttempts *int `mapstructure:"ssh_handshake_attempts" cty:"ssh_handshake_attempts" hcl:"ssh_handshake_attempts"` SSHBastionHost *string `mapstructure:"ssh_bastion_host" cty:"ssh_bastion_host" hcl:"ssh_bastion_host"` diff --git a/builder/profitbricks/config.hcl2spec.go b/builder/profitbricks/config.hcl2spec.go index ac2cf09f3..ed8ade53e 100644 --- a/builder/profitbricks/config.hcl2spec.go +++ b/builder/profitbricks/config.hcl2spec.go @@ -22,7 +22,7 @@ type FlatConfig struct { SSHPort *int `mapstructure:"ssh_port" cty:"ssh_port" hcl:"ssh_port"` SSHUsername *string `mapstructure:"ssh_username" cty:"ssh_username" hcl:"ssh_username"` SSHPassword *string `mapstructure:"ssh_password" cty:"ssh_password" hcl:"ssh_password"` - SSHKeyPairName *string `mapstructure:"ssh_keypair_name" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` + SSHKeyPairName *string `mapstructure:"ssh_keypair_name" undocumented:"true" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" undocumented:"true" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` SSHCiphers []string `mapstructure:"ssh_ciphers" cty:"ssh_ciphers" hcl:"ssh_ciphers"` SSHClearAuthorizedKeys *bool `mapstructure:"ssh_clear_authorized_keys" cty:"ssh_clear_authorized_keys" hcl:"ssh_clear_authorized_keys"` @@ -30,7 +30,7 @@ type FlatConfig struct { SSHPty *bool `mapstructure:"ssh_pty" cty:"ssh_pty" hcl:"ssh_pty"` SSHTimeout *string `mapstructure:"ssh_timeout" cty:"ssh_timeout" hcl:"ssh_timeout"` SSHWaitTimeout *string `mapstructure:"ssh_wait_timeout" undocumented:"true" cty:"ssh_wait_timeout" hcl:"ssh_wait_timeout"` - SSHAgentAuth *bool `mapstructure:"ssh_agent_auth" cty:"ssh_agent_auth" hcl:"ssh_agent_auth"` + SSHAgentAuth *bool `mapstructure:"ssh_agent_auth" undocumented:"true" cty:"ssh_agent_auth" hcl:"ssh_agent_auth"` SSHDisableAgentForwarding *bool `mapstructure:"ssh_disable_agent_forwarding" cty:"ssh_disable_agent_forwarding" hcl:"ssh_disable_agent_forwarding"` SSHHandshakeAttempts *int `mapstructure:"ssh_handshake_attempts" cty:"ssh_handshake_attempts" hcl:"ssh_handshake_attempts"` SSHBastionHost *string `mapstructure:"ssh_bastion_host" cty:"ssh_bastion_host" hcl:"ssh_bastion_host"` diff --git a/builder/proxmox/config.hcl2spec.go b/builder/proxmox/config.hcl2spec.go index 944e4ecb0..66885051e 100644 --- a/builder/proxmox/config.hcl2spec.go +++ b/builder/proxmox/config.hcl2spec.go @@ -35,7 +35,7 @@ type FlatConfig struct { SSHPort *int `mapstructure:"ssh_port" cty:"ssh_port" hcl:"ssh_port"` SSHUsername *string `mapstructure:"ssh_username" cty:"ssh_username" hcl:"ssh_username"` SSHPassword *string `mapstructure:"ssh_password" cty:"ssh_password" hcl:"ssh_password"` - SSHKeyPairName *string `mapstructure:"ssh_keypair_name" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` + SSHKeyPairName *string `mapstructure:"ssh_keypair_name" undocumented:"true" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" undocumented:"true" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` SSHCiphers []string `mapstructure:"ssh_ciphers" cty:"ssh_ciphers" hcl:"ssh_ciphers"` SSHClearAuthorizedKeys *bool `mapstructure:"ssh_clear_authorized_keys" cty:"ssh_clear_authorized_keys" hcl:"ssh_clear_authorized_keys"` @@ -43,7 +43,7 @@ type FlatConfig struct { SSHPty *bool `mapstructure:"ssh_pty" cty:"ssh_pty" hcl:"ssh_pty"` SSHTimeout *string `mapstructure:"ssh_timeout" cty:"ssh_timeout" hcl:"ssh_timeout"` SSHWaitTimeout *string `mapstructure:"ssh_wait_timeout" undocumented:"true" cty:"ssh_wait_timeout" hcl:"ssh_wait_timeout"` - SSHAgentAuth *bool `mapstructure:"ssh_agent_auth" cty:"ssh_agent_auth" hcl:"ssh_agent_auth"` + SSHAgentAuth *bool `mapstructure:"ssh_agent_auth" undocumented:"true" cty:"ssh_agent_auth" hcl:"ssh_agent_auth"` SSHDisableAgentForwarding *bool `mapstructure:"ssh_disable_agent_forwarding" cty:"ssh_disable_agent_forwarding" hcl:"ssh_disable_agent_forwarding"` SSHHandshakeAttempts *int `mapstructure:"ssh_handshake_attempts" cty:"ssh_handshake_attempts" hcl:"ssh_handshake_attempts"` SSHBastionHost *string `mapstructure:"ssh_bastion_host" cty:"ssh_bastion_host" hcl:"ssh_bastion_host"` diff --git a/builder/qemu/builder.hcl2spec.go b/builder/qemu/builder.hcl2spec.go index 40ffec016..bab410d57 100644 --- a/builder/qemu/builder.hcl2spec.go +++ b/builder/qemu/builder.hcl2spec.go @@ -38,7 +38,7 @@ type FlatConfig struct { SSHPort *int `mapstructure:"ssh_port" cty:"ssh_port" hcl:"ssh_port"` SSHUsername *string `mapstructure:"ssh_username" cty:"ssh_username" hcl:"ssh_username"` SSHPassword *string `mapstructure:"ssh_password" cty:"ssh_password" hcl:"ssh_password"` - SSHKeyPairName *string `mapstructure:"ssh_keypair_name" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` + SSHKeyPairName *string `mapstructure:"ssh_keypair_name" undocumented:"true" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" undocumented:"true" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` SSHCiphers []string `mapstructure:"ssh_ciphers" cty:"ssh_ciphers" hcl:"ssh_ciphers"` SSHClearAuthorizedKeys *bool `mapstructure:"ssh_clear_authorized_keys" cty:"ssh_clear_authorized_keys" hcl:"ssh_clear_authorized_keys"` @@ -46,7 +46,7 @@ type FlatConfig struct { SSHPty *bool `mapstructure:"ssh_pty" cty:"ssh_pty" hcl:"ssh_pty"` SSHTimeout *string `mapstructure:"ssh_timeout" cty:"ssh_timeout" hcl:"ssh_timeout"` SSHWaitTimeout *string `mapstructure:"ssh_wait_timeout" undocumented:"true" cty:"ssh_wait_timeout" hcl:"ssh_wait_timeout"` - SSHAgentAuth *bool `mapstructure:"ssh_agent_auth" cty:"ssh_agent_auth" hcl:"ssh_agent_auth"` + SSHAgentAuth *bool `mapstructure:"ssh_agent_auth" undocumented:"true" cty:"ssh_agent_auth" hcl:"ssh_agent_auth"` SSHDisableAgentForwarding *bool `mapstructure:"ssh_disable_agent_forwarding" cty:"ssh_disable_agent_forwarding" hcl:"ssh_disable_agent_forwarding"` SSHHandshakeAttempts *int `mapstructure:"ssh_handshake_attempts" cty:"ssh_handshake_attempts" hcl:"ssh_handshake_attempts"` SSHBastionHost *string `mapstructure:"ssh_bastion_host" cty:"ssh_bastion_host" hcl:"ssh_bastion_host"` diff --git a/builder/scaleway/config.hcl2spec.go b/builder/scaleway/config.hcl2spec.go index 10f9a8087..f89181a4a 100644 --- a/builder/scaleway/config.hcl2spec.go +++ b/builder/scaleway/config.hcl2spec.go @@ -22,7 +22,7 @@ type FlatConfig struct { SSHPort *int `mapstructure:"ssh_port" cty:"ssh_port" hcl:"ssh_port"` SSHUsername *string `mapstructure:"ssh_username" cty:"ssh_username" hcl:"ssh_username"` SSHPassword *string `mapstructure:"ssh_password" cty:"ssh_password" hcl:"ssh_password"` - SSHKeyPairName *string `mapstructure:"ssh_keypair_name" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` + SSHKeyPairName *string `mapstructure:"ssh_keypair_name" undocumented:"true" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" undocumented:"true" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` SSHCiphers []string `mapstructure:"ssh_ciphers" cty:"ssh_ciphers" hcl:"ssh_ciphers"` SSHClearAuthorizedKeys *bool `mapstructure:"ssh_clear_authorized_keys" cty:"ssh_clear_authorized_keys" hcl:"ssh_clear_authorized_keys"` @@ -30,7 +30,7 @@ type FlatConfig struct { SSHPty *bool `mapstructure:"ssh_pty" cty:"ssh_pty" hcl:"ssh_pty"` SSHTimeout *string `mapstructure:"ssh_timeout" cty:"ssh_timeout" hcl:"ssh_timeout"` SSHWaitTimeout *string `mapstructure:"ssh_wait_timeout" undocumented:"true" cty:"ssh_wait_timeout" hcl:"ssh_wait_timeout"` - SSHAgentAuth *bool `mapstructure:"ssh_agent_auth" cty:"ssh_agent_auth" hcl:"ssh_agent_auth"` + SSHAgentAuth *bool `mapstructure:"ssh_agent_auth" undocumented:"true" cty:"ssh_agent_auth" hcl:"ssh_agent_auth"` SSHDisableAgentForwarding *bool `mapstructure:"ssh_disable_agent_forwarding" cty:"ssh_disable_agent_forwarding" hcl:"ssh_disable_agent_forwarding"` SSHHandshakeAttempts *int `mapstructure:"ssh_handshake_attempts" cty:"ssh_handshake_attempts" hcl:"ssh_handshake_attempts"` SSHBastionHost *string `mapstructure:"ssh_bastion_host" cty:"ssh_bastion_host" hcl:"ssh_bastion_host"` diff --git a/builder/tencentcloud/cvm/builder.hcl2spec.go b/builder/tencentcloud/cvm/builder.hcl2spec.go index c472e3ad6..fb431b4fd 100644 --- a/builder/tencentcloud/cvm/builder.hcl2spec.go +++ b/builder/tencentcloud/cvm/builder.hcl2spec.go @@ -59,7 +59,7 @@ type FlatConfig struct { SSHPort *int `mapstructure:"ssh_port" cty:"ssh_port" hcl:"ssh_port"` SSHUsername *string `mapstructure:"ssh_username" cty:"ssh_username" hcl:"ssh_username"` SSHPassword *string `mapstructure:"ssh_password" cty:"ssh_password" hcl:"ssh_password"` - SSHKeyPairName *string `mapstructure:"ssh_keypair_name" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` + SSHKeyPairName *string `mapstructure:"ssh_keypair_name" undocumented:"true" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" undocumented:"true" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` SSHCiphers []string `mapstructure:"ssh_ciphers" cty:"ssh_ciphers" hcl:"ssh_ciphers"` SSHClearAuthorizedKeys *bool `mapstructure:"ssh_clear_authorized_keys" cty:"ssh_clear_authorized_keys" hcl:"ssh_clear_authorized_keys"` @@ -67,7 +67,7 @@ type FlatConfig struct { SSHPty *bool `mapstructure:"ssh_pty" cty:"ssh_pty" hcl:"ssh_pty"` SSHTimeout *string `mapstructure:"ssh_timeout" cty:"ssh_timeout" hcl:"ssh_timeout"` SSHWaitTimeout *string `mapstructure:"ssh_wait_timeout" undocumented:"true" cty:"ssh_wait_timeout" hcl:"ssh_wait_timeout"` - SSHAgentAuth *bool `mapstructure:"ssh_agent_auth" cty:"ssh_agent_auth" hcl:"ssh_agent_auth"` + SSHAgentAuth *bool `mapstructure:"ssh_agent_auth" undocumented:"true" cty:"ssh_agent_auth" hcl:"ssh_agent_auth"` SSHDisableAgentForwarding *bool `mapstructure:"ssh_disable_agent_forwarding" cty:"ssh_disable_agent_forwarding" hcl:"ssh_disable_agent_forwarding"` SSHHandshakeAttempts *int `mapstructure:"ssh_handshake_attempts" cty:"ssh_handshake_attempts" hcl:"ssh_handshake_attempts"` SSHBastionHost *string `mapstructure:"ssh_bastion_host" cty:"ssh_bastion_host" hcl:"ssh_bastion_host"` diff --git a/builder/triton/config.hcl2spec.go b/builder/triton/config.hcl2spec.go index 2de450b7a..748012823 100644 --- a/builder/triton/config.hcl2spec.go +++ b/builder/triton/config.hcl2spec.go @@ -46,7 +46,7 @@ type FlatConfig struct { SSHPort *int `mapstructure:"ssh_port" cty:"ssh_port" hcl:"ssh_port"` SSHUsername *string `mapstructure:"ssh_username" cty:"ssh_username" hcl:"ssh_username"` SSHPassword *string `mapstructure:"ssh_password" cty:"ssh_password" hcl:"ssh_password"` - SSHKeyPairName *string `mapstructure:"ssh_keypair_name" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` + SSHKeyPairName *string `mapstructure:"ssh_keypair_name" undocumented:"true" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" undocumented:"true" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` SSHCiphers []string `mapstructure:"ssh_ciphers" cty:"ssh_ciphers" hcl:"ssh_ciphers"` SSHClearAuthorizedKeys *bool `mapstructure:"ssh_clear_authorized_keys" cty:"ssh_clear_authorized_keys" hcl:"ssh_clear_authorized_keys"` @@ -54,7 +54,7 @@ type FlatConfig struct { SSHPty *bool `mapstructure:"ssh_pty" cty:"ssh_pty" hcl:"ssh_pty"` SSHTimeout *string `mapstructure:"ssh_timeout" cty:"ssh_timeout" hcl:"ssh_timeout"` SSHWaitTimeout *string `mapstructure:"ssh_wait_timeout" undocumented:"true" cty:"ssh_wait_timeout" hcl:"ssh_wait_timeout"` - SSHAgentAuth *bool `mapstructure:"ssh_agent_auth" cty:"ssh_agent_auth" hcl:"ssh_agent_auth"` + SSHAgentAuth *bool `mapstructure:"ssh_agent_auth" undocumented:"true" cty:"ssh_agent_auth" hcl:"ssh_agent_auth"` SSHDisableAgentForwarding *bool `mapstructure:"ssh_disable_agent_forwarding" cty:"ssh_disable_agent_forwarding" hcl:"ssh_disable_agent_forwarding"` SSHHandshakeAttempts *int `mapstructure:"ssh_handshake_attempts" cty:"ssh_handshake_attempts" hcl:"ssh_handshake_attempts"` SSHBastionHost *string `mapstructure:"ssh_bastion_host" cty:"ssh_bastion_host" hcl:"ssh_bastion_host"` diff --git a/builder/ucloud/uhost/builder.hcl2spec.go b/builder/ucloud/uhost/builder.hcl2spec.go index 694d4abec..f389775d4 100644 --- a/builder/ucloud/uhost/builder.hcl2spec.go +++ b/builder/ucloud/uhost/builder.hcl2spec.go @@ -47,7 +47,7 @@ type FlatConfig struct { SSHPort *int `mapstructure:"ssh_port" cty:"ssh_port" hcl:"ssh_port"` SSHUsername *string `mapstructure:"ssh_username" cty:"ssh_username" hcl:"ssh_username"` SSHPassword *string `mapstructure:"ssh_password" cty:"ssh_password" hcl:"ssh_password"` - SSHKeyPairName *string `mapstructure:"ssh_keypair_name" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` + SSHKeyPairName *string `mapstructure:"ssh_keypair_name" undocumented:"true" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" undocumented:"true" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` SSHCiphers []string `mapstructure:"ssh_ciphers" cty:"ssh_ciphers" hcl:"ssh_ciphers"` SSHClearAuthorizedKeys *bool `mapstructure:"ssh_clear_authorized_keys" cty:"ssh_clear_authorized_keys" hcl:"ssh_clear_authorized_keys"` @@ -55,7 +55,7 @@ type FlatConfig struct { SSHPty *bool `mapstructure:"ssh_pty" cty:"ssh_pty" hcl:"ssh_pty"` SSHTimeout *string `mapstructure:"ssh_timeout" cty:"ssh_timeout" hcl:"ssh_timeout"` SSHWaitTimeout *string `mapstructure:"ssh_wait_timeout" undocumented:"true" cty:"ssh_wait_timeout" hcl:"ssh_wait_timeout"` - SSHAgentAuth *bool `mapstructure:"ssh_agent_auth" cty:"ssh_agent_auth" hcl:"ssh_agent_auth"` + SSHAgentAuth *bool `mapstructure:"ssh_agent_auth" undocumented:"true" cty:"ssh_agent_auth" hcl:"ssh_agent_auth"` SSHDisableAgentForwarding *bool `mapstructure:"ssh_disable_agent_forwarding" cty:"ssh_disable_agent_forwarding" hcl:"ssh_disable_agent_forwarding"` SSHHandshakeAttempts *int `mapstructure:"ssh_handshake_attempts" cty:"ssh_handshake_attempts" hcl:"ssh_handshake_attempts"` SSHBastionHost *string `mapstructure:"ssh_bastion_host" cty:"ssh_bastion_host" hcl:"ssh_bastion_host"` diff --git a/builder/vagrant/builder.hcl2spec.go b/builder/vagrant/builder.hcl2spec.go index 1bb889096..f97358954 100644 --- a/builder/vagrant/builder.hcl2spec.go +++ b/builder/vagrant/builder.hcl2spec.go @@ -37,7 +37,7 @@ type FlatConfig struct { SSHPort *int `mapstructure:"ssh_port" cty:"ssh_port" hcl:"ssh_port"` SSHUsername *string `mapstructure:"ssh_username" cty:"ssh_username" hcl:"ssh_username"` SSHPassword *string `mapstructure:"ssh_password" cty:"ssh_password" hcl:"ssh_password"` - SSHKeyPairName *string `mapstructure:"ssh_keypair_name" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` + SSHKeyPairName *string `mapstructure:"ssh_keypair_name" undocumented:"true" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" undocumented:"true" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` SSHCiphers []string `mapstructure:"ssh_ciphers" cty:"ssh_ciphers" hcl:"ssh_ciphers"` SSHClearAuthorizedKeys *bool `mapstructure:"ssh_clear_authorized_keys" cty:"ssh_clear_authorized_keys" hcl:"ssh_clear_authorized_keys"` @@ -45,7 +45,7 @@ type FlatConfig struct { SSHPty *bool `mapstructure:"ssh_pty" cty:"ssh_pty" hcl:"ssh_pty"` SSHTimeout *string `mapstructure:"ssh_timeout" cty:"ssh_timeout" hcl:"ssh_timeout"` SSHWaitTimeout *string `mapstructure:"ssh_wait_timeout" undocumented:"true" cty:"ssh_wait_timeout" hcl:"ssh_wait_timeout"` - SSHAgentAuth *bool `mapstructure:"ssh_agent_auth" cty:"ssh_agent_auth" hcl:"ssh_agent_auth"` + SSHAgentAuth *bool `mapstructure:"ssh_agent_auth" undocumented:"true" cty:"ssh_agent_auth" hcl:"ssh_agent_auth"` SSHDisableAgentForwarding *bool `mapstructure:"ssh_disable_agent_forwarding" cty:"ssh_disable_agent_forwarding" hcl:"ssh_disable_agent_forwarding"` SSHHandshakeAttempts *int `mapstructure:"ssh_handshake_attempts" cty:"ssh_handshake_attempts" hcl:"ssh_handshake_attempts"` SSHBastionHost *string `mapstructure:"ssh_bastion_host" cty:"ssh_bastion_host" hcl:"ssh_bastion_host"` diff --git a/builder/virtualbox/iso/builder.hcl2spec.go b/builder/virtualbox/iso/builder.hcl2spec.go index 25752cc13..65c5a0252 100644 --- a/builder/virtualbox/iso/builder.hcl2spec.go +++ b/builder/virtualbox/iso/builder.hcl2spec.go @@ -50,7 +50,7 @@ type FlatConfig struct { SSHPort *int `mapstructure:"ssh_port" cty:"ssh_port" hcl:"ssh_port"` SSHUsername *string `mapstructure:"ssh_username" cty:"ssh_username" hcl:"ssh_username"` SSHPassword *string `mapstructure:"ssh_password" cty:"ssh_password" hcl:"ssh_password"` - SSHKeyPairName *string `mapstructure:"ssh_keypair_name" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` + SSHKeyPairName *string `mapstructure:"ssh_keypair_name" undocumented:"true" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" undocumented:"true" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` SSHCiphers []string `mapstructure:"ssh_ciphers" cty:"ssh_ciphers" hcl:"ssh_ciphers"` SSHClearAuthorizedKeys *bool `mapstructure:"ssh_clear_authorized_keys" cty:"ssh_clear_authorized_keys" hcl:"ssh_clear_authorized_keys"` @@ -58,7 +58,7 @@ type FlatConfig struct { SSHPty *bool `mapstructure:"ssh_pty" cty:"ssh_pty" hcl:"ssh_pty"` SSHTimeout *string `mapstructure:"ssh_timeout" cty:"ssh_timeout" hcl:"ssh_timeout"` SSHWaitTimeout *string `mapstructure:"ssh_wait_timeout" undocumented:"true" cty:"ssh_wait_timeout" hcl:"ssh_wait_timeout"` - SSHAgentAuth *bool `mapstructure:"ssh_agent_auth" cty:"ssh_agent_auth" hcl:"ssh_agent_auth"` + SSHAgentAuth *bool `mapstructure:"ssh_agent_auth" undocumented:"true" cty:"ssh_agent_auth" hcl:"ssh_agent_auth"` SSHDisableAgentForwarding *bool `mapstructure:"ssh_disable_agent_forwarding" cty:"ssh_disable_agent_forwarding" hcl:"ssh_disable_agent_forwarding"` SSHHandshakeAttempts *int `mapstructure:"ssh_handshake_attempts" cty:"ssh_handshake_attempts" hcl:"ssh_handshake_attempts"` SSHBastionHost *string `mapstructure:"ssh_bastion_host" cty:"ssh_bastion_host" hcl:"ssh_bastion_host"` diff --git a/builder/virtualbox/ovf/config.hcl2spec.go b/builder/virtualbox/ovf/config.hcl2spec.go index 2965e3b96..727be6bf4 100644 --- a/builder/virtualbox/ovf/config.hcl2spec.go +++ b/builder/virtualbox/ovf/config.hcl2spec.go @@ -40,7 +40,7 @@ type FlatConfig struct { SSHPort *int `mapstructure:"ssh_port" cty:"ssh_port" hcl:"ssh_port"` SSHUsername *string `mapstructure:"ssh_username" cty:"ssh_username" hcl:"ssh_username"` SSHPassword *string `mapstructure:"ssh_password" cty:"ssh_password" hcl:"ssh_password"` - SSHKeyPairName *string `mapstructure:"ssh_keypair_name" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` + SSHKeyPairName *string `mapstructure:"ssh_keypair_name" undocumented:"true" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" undocumented:"true" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` SSHCiphers []string `mapstructure:"ssh_ciphers" cty:"ssh_ciphers" hcl:"ssh_ciphers"` SSHClearAuthorizedKeys *bool `mapstructure:"ssh_clear_authorized_keys" cty:"ssh_clear_authorized_keys" hcl:"ssh_clear_authorized_keys"` @@ -48,7 +48,7 @@ type FlatConfig struct { SSHPty *bool `mapstructure:"ssh_pty" cty:"ssh_pty" hcl:"ssh_pty"` SSHTimeout *string `mapstructure:"ssh_timeout" cty:"ssh_timeout" hcl:"ssh_timeout"` SSHWaitTimeout *string `mapstructure:"ssh_wait_timeout" undocumented:"true" cty:"ssh_wait_timeout" hcl:"ssh_wait_timeout"` - SSHAgentAuth *bool `mapstructure:"ssh_agent_auth" cty:"ssh_agent_auth" hcl:"ssh_agent_auth"` + SSHAgentAuth *bool `mapstructure:"ssh_agent_auth" undocumented:"true" cty:"ssh_agent_auth" hcl:"ssh_agent_auth"` SSHDisableAgentForwarding *bool `mapstructure:"ssh_disable_agent_forwarding" cty:"ssh_disable_agent_forwarding" hcl:"ssh_disable_agent_forwarding"` SSHHandshakeAttempts *int `mapstructure:"ssh_handshake_attempts" cty:"ssh_handshake_attempts" hcl:"ssh_handshake_attempts"` SSHBastionHost *string `mapstructure:"ssh_bastion_host" cty:"ssh_bastion_host" hcl:"ssh_bastion_host"` diff --git a/builder/virtualbox/vm/config.hcl2spec.go b/builder/virtualbox/vm/config.hcl2spec.go index 9a767261e..9a0718007 100644 --- a/builder/virtualbox/vm/config.hcl2spec.go +++ b/builder/virtualbox/vm/config.hcl2spec.go @@ -40,7 +40,7 @@ type FlatConfig struct { SSHPort *int `mapstructure:"ssh_port" cty:"ssh_port" hcl:"ssh_port"` SSHUsername *string `mapstructure:"ssh_username" cty:"ssh_username" hcl:"ssh_username"` SSHPassword *string `mapstructure:"ssh_password" cty:"ssh_password" hcl:"ssh_password"` - SSHKeyPairName *string `mapstructure:"ssh_keypair_name" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` + SSHKeyPairName *string `mapstructure:"ssh_keypair_name" undocumented:"true" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" undocumented:"true" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` SSHCiphers []string `mapstructure:"ssh_ciphers" cty:"ssh_ciphers" hcl:"ssh_ciphers"` SSHClearAuthorizedKeys *bool `mapstructure:"ssh_clear_authorized_keys" cty:"ssh_clear_authorized_keys" hcl:"ssh_clear_authorized_keys"` @@ -48,7 +48,7 @@ type FlatConfig struct { SSHPty *bool `mapstructure:"ssh_pty" cty:"ssh_pty" hcl:"ssh_pty"` SSHTimeout *string `mapstructure:"ssh_timeout" cty:"ssh_timeout" hcl:"ssh_timeout"` SSHWaitTimeout *string `mapstructure:"ssh_wait_timeout" undocumented:"true" cty:"ssh_wait_timeout" hcl:"ssh_wait_timeout"` - SSHAgentAuth *bool `mapstructure:"ssh_agent_auth" cty:"ssh_agent_auth" hcl:"ssh_agent_auth"` + SSHAgentAuth *bool `mapstructure:"ssh_agent_auth" undocumented:"true" cty:"ssh_agent_auth" hcl:"ssh_agent_auth"` SSHDisableAgentForwarding *bool `mapstructure:"ssh_disable_agent_forwarding" cty:"ssh_disable_agent_forwarding" hcl:"ssh_disable_agent_forwarding"` SSHHandshakeAttempts *int `mapstructure:"ssh_handshake_attempts" cty:"ssh_handshake_attempts" hcl:"ssh_handshake_attempts"` SSHBastionHost *string `mapstructure:"ssh_bastion_host" cty:"ssh_bastion_host" hcl:"ssh_bastion_host"` diff --git a/builder/vmware/iso/config.hcl2spec.go b/builder/vmware/iso/config.hcl2spec.go index 2768d8866..51e820c11 100644 --- a/builder/vmware/iso/config.hcl2spec.go +++ b/builder/vmware/iso/config.hcl2spec.go @@ -68,7 +68,7 @@ type FlatConfig struct { SSHPort *int `mapstructure:"ssh_port" cty:"ssh_port" hcl:"ssh_port"` SSHUsername *string `mapstructure:"ssh_username" cty:"ssh_username" hcl:"ssh_username"` SSHPassword *string `mapstructure:"ssh_password" cty:"ssh_password" hcl:"ssh_password"` - SSHKeyPairName *string `mapstructure:"ssh_keypair_name" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` + SSHKeyPairName *string `mapstructure:"ssh_keypair_name" undocumented:"true" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" undocumented:"true" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` SSHCiphers []string `mapstructure:"ssh_ciphers" cty:"ssh_ciphers" hcl:"ssh_ciphers"` SSHClearAuthorizedKeys *bool `mapstructure:"ssh_clear_authorized_keys" cty:"ssh_clear_authorized_keys" hcl:"ssh_clear_authorized_keys"` @@ -76,7 +76,7 @@ type FlatConfig struct { SSHPty *bool `mapstructure:"ssh_pty" cty:"ssh_pty" hcl:"ssh_pty"` SSHTimeout *string `mapstructure:"ssh_timeout" cty:"ssh_timeout" hcl:"ssh_timeout"` SSHWaitTimeout *string `mapstructure:"ssh_wait_timeout" undocumented:"true" cty:"ssh_wait_timeout" hcl:"ssh_wait_timeout"` - SSHAgentAuth *bool `mapstructure:"ssh_agent_auth" cty:"ssh_agent_auth" hcl:"ssh_agent_auth"` + SSHAgentAuth *bool `mapstructure:"ssh_agent_auth" undocumented:"true" cty:"ssh_agent_auth" hcl:"ssh_agent_auth"` SSHDisableAgentForwarding *bool `mapstructure:"ssh_disable_agent_forwarding" cty:"ssh_disable_agent_forwarding" hcl:"ssh_disable_agent_forwarding"` SSHHandshakeAttempts *int `mapstructure:"ssh_handshake_attempts" cty:"ssh_handshake_attempts" hcl:"ssh_handshake_attempts"` SSHBastionHost *string `mapstructure:"ssh_bastion_host" cty:"ssh_bastion_host" hcl:"ssh_bastion_host"` diff --git a/builder/vmware/vmx/config.hcl2spec.go b/builder/vmware/vmx/config.hcl2spec.go index 4282ef5b2..38dd41892 100644 --- a/builder/vmware/vmx/config.hcl2spec.go +++ b/builder/vmware/vmx/config.hcl2spec.go @@ -54,7 +54,7 @@ type FlatConfig struct { SSHPort *int `mapstructure:"ssh_port" cty:"ssh_port" hcl:"ssh_port"` SSHUsername *string `mapstructure:"ssh_username" cty:"ssh_username" hcl:"ssh_username"` SSHPassword *string `mapstructure:"ssh_password" cty:"ssh_password" hcl:"ssh_password"` - SSHKeyPairName *string `mapstructure:"ssh_keypair_name" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` + SSHKeyPairName *string `mapstructure:"ssh_keypair_name" undocumented:"true" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" undocumented:"true" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` SSHCiphers []string `mapstructure:"ssh_ciphers" cty:"ssh_ciphers" hcl:"ssh_ciphers"` SSHClearAuthorizedKeys *bool `mapstructure:"ssh_clear_authorized_keys" cty:"ssh_clear_authorized_keys" hcl:"ssh_clear_authorized_keys"` @@ -62,7 +62,7 @@ type FlatConfig struct { SSHPty *bool `mapstructure:"ssh_pty" cty:"ssh_pty" hcl:"ssh_pty"` SSHTimeout *string `mapstructure:"ssh_timeout" cty:"ssh_timeout" hcl:"ssh_timeout"` SSHWaitTimeout *string `mapstructure:"ssh_wait_timeout" undocumented:"true" cty:"ssh_wait_timeout" hcl:"ssh_wait_timeout"` - SSHAgentAuth *bool `mapstructure:"ssh_agent_auth" cty:"ssh_agent_auth" hcl:"ssh_agent_auth"` + SSHAgentAuth *bool `mapstructure:"ssh_agent_auth" undocumented:"true" cty:"ssh_agent_auth" hcl:"ssh_agent_auth"` SSHDisableAgentForwarding *bool `mapstructure:"ssh_disable_agent_forwarding" cty:"ssh_disable_agent_forwarding" hcl:"ssh_disable_agent_forwarding"` SSHHandshakeAttempts *int `mapstructure:"ssh_handshake_attempts" cty:"ssh_handshake_attempts" hcl:"ssh_handshake_attempts"` SSHBastionHost *string `mapstructure:"ssh_bastion_host" cty:"ssh_bastion_host" hcl:"ssh_bastion_host"` diff --git a/builder/vsphere/clone/config.hcl2spec.go b/builder/vsphere/clone/config.hcl2spec.go index e636c6b95..e769cd496 100644 --- a/builder/vsphere/clone/config.hcl2spec.go +++ b/builder/vsphere/clone/config.hcl2spec.go @@ -68,7 +68,7 @@ type FlatConfig struct { SSHPort *int `mapstructure:"ssh_port" cty:"ssh_port" hcl:"ssh_port"` SSHUsername *string `mapstructure:"ssh_username" cty:"ssh_username" hcl:"ssh_username"` SSHPassword *string `mapstructure:"ssh_password" cty:"ssh_password" hcl:"ssh_password"` - SSHKeyPairName *string `mapstructure:"ssh_keypair_name" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` + SSHKeyPairName *string `mapstructure:"ssh_keypair_name" undocumented:"true" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" undocumented:"true" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` SSHCiphers []string `mapstructure:"ssh_ciphers" cty:"ssh_ciphers" hcl:"ssh_ciphers"` SSHClearAuthorizedKeys *bool `mapstructure:"ssh_clear_authorized_keys" cty:"ssh_clear_authorized_keys" hcl:"ssh_clear_authorized_keys"` @@ -76,7 +76,7 @@ type FlatConfig struct { SSHPty *bool `mapstructure:"ssh_pty" cty:"ssh_pty" hcl:"ssh_pty"` SSHTimeout *string `mapstructure:"ssh_timeout" cty:"ssh_timeout" hcl:"ssh_timeout"` SSHWaitTimeout *string `mapstructure:"ssh_wait_timeout" undocumented:"true" cty:"ssh_wait_timeout" hcl:"ssh_wait_timeout"` - SSHAgentAuth *bool `mapstructure:"ssh_agent_auth" cty:"ssh_agent_auth" hcl:"ssh_agent_auth"` + SSHAgentAuth *bool `mapstructure:"ssh_agent_auth" undocumented:"true" cty:"ssh_agent_auth" hcl:"ssh_agent_auth"` SSHDisableAgentForwarding *bool `mapstructure:"ssh_disable_agent_forwarding" cty:"ssh_disable_agent_forwarding" hcl:"ssh_disable_agent_forwarding"` SSHHandshakeAttempts *int `mapstructure:"ssh_handshake_attempts" cty:"ssh_handshake_attempts" hcl:"ssh_handshake_attempts"` SSHBastionHost *string `mapstructure:"ssh_bastion_host" cty:"ssh_bastion_host" hcl:"ssh_bastion_host"` diff --git a/builder/vsphere/iso/config.hcl2spec.go b/builder/vsphere/iso/config.hcl2spec.go index ae0059398..f93e94943 100644 --- a/builder/vsphere/iso/config.hcl2spec.go +++ b/builder/vsphere/iso/config.hcl2spec.go @@ -82,7 +82,7 @@ type FlatConfig struct { SSHPort *int `mapstructure:"ssh_port" cty:"ssh_port" hcl:"ssh_port"` SSHUsername *string `mapstructure:"ssh_username" cty:"ssh_username" hcl:"ssh_username"` SSHPassword *string `mapstructure:"ssh_password" cty:"ssh_password" hcl:"ssh_password"` - SSHKeyPairName *string `mapstructure:"ssh_keypair_name" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` + SSHKeyPairName *string `mapstructure:"ssh_keypair_name" undocumented:"true" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" undocumented:"true" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` SSHCiphers []string `mapstructure:"ssh_ciphers" cty:"ssh_ciphers" hcl:"ssh_ciphers"` SSHClearAuthorizedKeys *bool `mapstructure:"ssh_clear_authorized_keys" cty:"ssh_clear_authorized_keys" hcl:"ssh_clear_authorized_keys"` @@ -90,7 +90,7 @@ type FlatConfig struct { SSHPty *bool `mapstructure:"ssh_pty" cty:"ssh_pty" hcl:"ssh_pty"` SSHTimeout *string `mapstructure:"ssh_timeout" cty:"ssh_timeout" hcl:"ssh_timeout"` SSHWaitTimeout *string `mapstructure:"ssh_wait_timeout" undocumented:"true" cty:"ssh_wait_timeout" hcl:"ssh_wait_timeout"` - SSHAgentAuth *bool `mapstructure:"ssh_agent_auth" cty:"ssh_agent_auth" hcl:"ssh_agent_auth"` + SSHAgentAuth *bool `mapstructure:"ssh_agent_auth" undocumented:"true" cty:"ssh_agent_auth" hcl:"ssh_agent_auth"` SSHDisableAgentForwarding *bool `mapstructure:"ssh_disable_agent_forwarding" cty:"ssh_disable_agent_forwarding" hcl:"ssh_disable_agent_forwarding"` SSHHandshakeAttempts *int `mapstructure:"ssh_handshake_attempts" cty:"ssh_handshake_attempts" hcl:"ssh_handshake_attempts"` SSHBastionHost *string `mapstructure:"ssh_bastion_host" cty:"ssh_bastion_host" hcl:"ssh_bastion_host"` diff --git a/builder/yandex/config.hcl2spec.go b/builder/yandex/config.hcl2spec.go index 299b558a7..3cda7acdc 100644 --- a/builder/yandex/config.hcl2spec.go +++ b/builder/yandex/config.hcl2spec.go @@ -22,7 +22,7 @@ type FlatConfig struct { SSHPort *int `mapstructure:"ssh_port" cty:"ssh_port" hcl:"ssh_port"` SSHUsername *string `mapstructure:"ssh_username" cty:"ssh_username" hcl:"ssh_username"` SSHPassword *string `mapstructure:"ssh_password" cty:"ssh_password" hcl:"ssh_password"` - SSHKeyPairName *string `mapstructure:"ssh_keypair_name" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` + SSHKeyPairName *string `mapstructure:"ssh_keypair_name" undocumented:"true" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" undocumented:"true" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` SSHCiphers []string `mapstructure:"ssh_ciphers" cty:"ssh_ciphers" hcl:"ssh_ciphers"` SSHClearAuthorizedKeys *bool `mapstructure:"ssh_clear_authorized_keys" cty:"ssh_clear_authorized_keys" hcl:"ssh_clear_authorized_keys"` @@ -30,7 +30,7 @@ type FlatConfig struct { SSHPty *bool `mapstructure:"ssh_pty" cty:"ssh_pty" hcl:"ssh_pty"` SSHTimeout *string `mapstructure:"ssh_timeout" cty:"ssh_timeout" hcl:"ssh_timeout"` SSHWaitTimeout *string `mapstructure:"ssh_wait_timeout" undocumented:"true" cty:"ssh_wait_timeout" hcl:"ssh_wait_timeout"` - SSHAgentAuth *bool `mapstructure:"ssh_agent_auth" cty:"ssh_agent_auth" hcl:"ssh_agent_auth"` + SSHAgentAuth *bool `mapstructure:"ssh_agent_auth" undocumented:"true" cty:"ssh_agent_auth" hcl:"ssh_agent_auth"` SSHDisableAgentForwarding *bool `mapstructure:"ssh_disable_agent_forwarding" cty:"ssh_disable_agent_forwarding" hcl:"ssh_disable_agent_forwarding"` SSHHandshakeAttempts *int `mapstructure:"ssh_handshake_attempts" cty:"ssh_handshake_attempts" hcl:"ssh_handshake_attempts"` SSHBastionHost *string `mapstructure:"ssh_bastion_host" cty:"ssh_bastion_host" hcl:"ssh_bastion_host"` diff --git a/helper/communicator/config.go b/helper/communicator/config.go index 28d52e400..55fe5efe7 100644 --- a/helper/communicator/config.go +++ b/helper/communicator/config.go @@ -83,7 +83,7 @@ type SSH struct { // [`ssh_private_key_file`](#ssh_private_key_file) or // [`ssh_agent_auth`](#ssh_agent_auth) must be specified when // [`ssh_keypair_name`](#ssh_keypair_name) is utilized. - SSHKeyPairName string `mapstructure:"ssh_keypair_name"` + SSHKeyPairName string `mapstructure:"ssh_keypair_name" undocumented:"true"` // The name of the temporary key pair to generate. By default, Packer // generates a name that looks like `packer_`, where <UUID> is // a 36 character unique identifier. @@ -125,7 +125,7 @@ type SSH struct { // [`ssh_private_key_file`](#ssh_private_key_file) will be ignored. The // environment variable `SSH_AUTH_SOCK` must be set for this option to work // properly. - SSHAgentAuth bool `mapstructure:"ssh_agent_auth"` + SSHAgentAuth bool `mapstructure:"ssh_agent_auth" undocumented:"true"` // If true, SSH agent forwarding will be disabled. Defaults to `false`. SSHDisableAgentForwarding bool `mapstructure:"ssh_disable_agent_forwarding"` // The number of handshakes to attempt with SSH once it can connect. This diff --git a/helper/communicator/config.hcl2spec.go b/helper/communicator/config.hcl2spec.go index d7c0de1fd..a5cc481f3 100644 --- a/helper/communicator/config.hcl2spec.go +++ b/helper/communicator/config.hcl2spec.go @@ -15,7 +15,7 @@ type FlatConfig struct { SSHPort *int `mapstructure:"ssh_port" cty:"ssh_port" hcl:"ssh_port"` SSHUsername *string `mapstructure:"ssh_username" cty:"ssh_username" hcl:"ssh_username"` SSHPassword *string `mapstructure:"ssh_password" cty:"ssh_password" hcl:"ssh_password"` - SSHKeyPairName *string `mapstructure:"ssh_keypair_name" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` + SSHKeyPairName *string `mapstructure:"ssh_keypair_name" undocumented:"true" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" undocumented:"true" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` SSHCiphers []string `mapstructure:"ssh_ciphers" cty:"ssh_ciphers" hcl:"ssh_ciphers"` SSHClearAuthorizedKeys *bool `mapstructure:"ssh_clear_authorized_keys" cty:"ssh_clear_authorized_keys" hcl:"ssh_clear_authorized_keys"` @@ -23,7 +23,7 @@ type FlatConfig struct { SSHPty *bool `mapstructure:"ssh_pty" cty:"ssh_pty" hcl:"ssh_pty"` SSHTimeout *string `mapstructure:"ssh_timeout" cty:"ssh_timeout" hcl:"ssh_timeout"` SSHWaitTimeout *string `mapstructure:"ssh_wait_timeout" undocumented:"true" cty:"ssh_wait_timeout" hcl:"ssh_wait_timeout"` - SSHAgentAuth *bool `mapstructure:"ssh_agent_auth" cty:"ssh_agent_auth" hcl:"ssh_agent_auth"` + SSHAgentAuth *bool `mapstructure:"ssh_agent_auth" undocumented:"true" cty:"ssh_agent_auth" hcl:"ssh_agent_auth"` SSHDisableAgentForwarding *bool `mapstructure:"ssh_disable_agent_forwarding" cty:"ssh_disable_agent_forwarding" hcl:"ssh_disable_agent_forwarding"` SSHHandshakeAttempts *int `mapstructure:"ssh_handshake_attempts" cty:"ssh_handshake_attempts" hcl:"ssh_handshake_attempts"` SSHBastionHost *string `mapstructure:"ssh_bastion_host" cty:"ssh_bastion_host" hcl:"ssh_bastion_host"` @@ -122,7 +122,7 @@ type FlatSSH struct { SSHPort *int `mapstructure:"ssh_port" cty:"ssh_port" hcl:"ssh_port"` SSHUsername *string `mapstructure:"ssh_username" cty:"ssh_username" hcl:"ssh_username"` SSHPassword *string `mapstructure:"ssh_password" cty:"ssh_password" hcl:"ssh_password"` - SSHKeyPairName *string `mapstructure:"ssh_keypair_name" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` + SSHKeyPairName *string `mapstructure:"ssh_keypair_name" undocumented:"true" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" undocumented:"true" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` SSHCiphers []string `mapstructure:"ssh_ciphers" cty:"ssh_ciphers" hcl:"ssh_ciphers"` SSHClearAuthorizedKeys *bool `mapstructure:"ssh_clear_authorized_keys" cty:"ssh_clear_authorized_keys" hcl:"ssh_clear_authorized_keys"` @@ -130,7 +130,7 @@ type FlatSSH struct { SSHPty *bool `mapstructure:"ssh_pty" cty:"ssh_pty" hcl:"ssh_pty"` SSHTimeout *string `mapstructure:"ssh_timeout" cty:"ssh_timeout" hcl:"ssh_timeout"` SSHWaitTimeout *string `mapstructure:"ssh_wait_timeout" undocumented:"true" cty:"ssh_wait_timeout" hcl:"ssh_wait_timeout"` - SSHAgentAuth *bool `mapstructure:"ssh_agent_auth" cty:"ssh_agent_auth" hcl:"ssh_agent_auth"` + SSHAgentAuth *bool `mapstructure:"ssh_agent_auth" undocumented:"true" cty:"ssh_agent_auth" hcl:"ssh_agent_auth"` SSHDisableAgentForwarding *bool `mapstructure:"ssh_disable_agent_forwarding" cty:"ssh_disable_agent_forwarding" hcl:"ssh_disable_agent_forwarding"` SSHHandshakeAttempts *int `mapstructure:"ssh_handshake_attempts" cty:"ssh_handshake_attempts" hcl:"ssh_handshake_attempts"` SSHBastionHost *string `mapstructure:"ssh_bastion_host" cty:"ssh_bastion_host" hcl:"ssh_bastion_host"` diff --git a/post-processor/alicloud-import/post-processor.hcl2spec.go b/post-processor/alicloud-import/post-processor.hcl2spec.go index 625d21bed..a6733cab4 100644 --- a/post-processor/alicloud-import/post-processor.hcl2spec.go +++ b/post-processor/alicloud-import/post-processor.hcl2spec.go @@ -69,7 +69,7 @@ type FlatConfig struct { SSHPort *int `mapstructure:"ssh_port" cty:"ssh_port" hcl:"ssh_port"` SSHUsername *string `mapstructure:"ssh_username" cty:"ssh_username" hcl:"ssh_username"` SSHPassword *string `mapstructure:"ssh_password" cty:"ssh_password" hcl:"ssh_password"` - SSHKeyPairName *string `mapstructure:"ssh_keypair_name" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` + SSHKeyPairName *string `mapstructure:"ssh_keypair_name" undocumented:"true" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" undocumented:"true" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` SSHCiphers []string `mapstructure:"ssh_ciphers" cty:"ssh_ciphers" hcl:"ssh_ciphers"` SSHClearAuthorizedKeys *bool `mapstructure:"ssh_clear_authorized_keys" cty:"ssh_clear_authorized_keys" hcl:"ssh_clear_authorized_keys"` @@ -77,7 +77,7 @@ type FlatConfig struct { SSHPty *bool `mapstructure:"ssh_pty" cty:"ssh_pty" hcl:"ssh_pty"` SSHTimeout *string `mapstructure:"ssh_timeout" cty:"ssh_timeout" hcl:"ssh_timeout"` SSHWaitTimeout *string `mapstructure:"ssh_wait_timeout" undocumented:"true" cty:"ssh_wait_timeout" hcl:"ssh_wait_timeout"` - SSHAgentAuth *bool `mapstructure:"ssh_agent_auth" cty:"ssh_agent_auth" hcl:"ssh_agent_auth"` + SSHAgentAuth *bool `mapstructure:"ssh_agent_auth" undocumented:"true" cty:"ssh_agent_auth" hcl:"ssh_agent_auth"` SSHDisableAgentForwarding *bool `mapstructure:"ssh_disable_agent_forwarding" cty:"ssh_disable_agent_forwarding" hcl:"ssh_disable_agent_forwarding"` SSHHandshakeAttempts *int `mapstructure:"ssh_handshake_attempts" cty:"ssh_handshake_attempts" hcl:"ssh_handshake_attempts"` SSHBastionHost *string `mapstructure:"ssh_bastion_host" cty:"ssh_bastion_host" hcl:"ssh_bastion_host"` diff --git a/website/pages/partials/helper/communicator/SSH-Key-Pair-not-required.mdx b/website/pages/partials/helper/communicator/SSH-Key-Pair-not-required.mdx index 59e688a51..a2be645da 100644 --- a/website/pages/partials/helper/communicator/SSH-Key-Pair-not-required.mdx +++ b/website/pages/partials/helper/communicator/SSH-Key-Pair-not-required.mdx @@ -3,6 +3,21 @@ generates a name that looks like `packer_`, where <UUID> is a 36 character unique identifier. +- `ssh_keypair_name` (string) - If specified, this is the key that will be used for SSH with the + machine. The key must match a key pair name loaded up into the remote. + By default, this is blank, and Packer will generate a temporary keypair + unless [`ssh_password`](#ssh_password) is used. + [`ssh_private_key_file`](#ssh_private_key_file) or + [`ssh_agent_auth`](#ssh_agent_auth) must be specified when + [`ssh_keypair_name`](#ssh_keypair_name) is utilized. + - `ssh_private_key_file` (string) - Path to a PEM encoded private key file to use to authenticate with SSH. The `~` can be used in path and will be expanded to the home directory of current user. + +- `ssh_agent_auth` (bool) - If true, the local SSH agent will be used to authenticate connections to + the source instance. No temporary keypair will be created, and the + values of [`ssh_password`](#ssh_password) and + [`ssh_private_key_file`](#ssh_private_key_file) will be ignored. The + environment variable `SSH_AUTH_SOCK` must be set for this option to work + properly. diff --git a/website/pages/partials/helper/communicator/SSH-not-required.mdx b/website/pages/partials/helper/communicator/SSH-not-required.mdx index 76391ab84..116b97db3 100644 --- a/website/pages/partials/helper/communicator/SSH-not-required.mdx +++ b/website/pages/partials/helper/communicator/SSH-not-required.mdx @@ -9,14 +9,6 @@ - `ssh_password` (string) - A plaintext password to use to authenticate with SSH. -- `ssh_keypair_name` (string) - If specified, this is the key that will be used for SSH with the - machine. The key must match a key pair name loaded up into the remote. - By default, this is blank, and Packer will generate a temporary keypair - unless [`ssh_password`](#ssh_password) is used. - [`ssh_private_key_file`](#ssh_private_key_file) or - [`ssh_agent_auth`](#ssh_agent_auth) must be specified when - [`ssh_keypair_name`](#ssh_keypair_name) is utilized. - - `ssh_ciphers` ([]string) - This overrides the value of ciphers supported by default by golang. The default value is [ "aes128-gcm@openssh.com", @@ -43,13 +35,6 @@ determine when the machine has booted so this is usually quite long. Example value: `10m`. -- `ssh_agent_auth` (bool) - If true, the local SSH agent will be used to authenticate connections to - the source instance. No temporary keypair will be created, and the - values of [`ssh_password`](#ssh_password) and - [`ssh_private_key_file`](#ssh_private_key_file) will be ignored. The - environment variable `SSH_AUTH_SOCK` must be set for this option to work - properly. - - `ssh_disable_agent_forwarding` (bool) - If true, SSH agent forwarding will be disabled. Defaults to `false`. - `ssh_handshake_attempts` (int) - The number of handshakes to attempt with SSH once it can connect. This From 7969b690de7dd09ec2ed7f09c41aa3870d064e18 Mon Sep 17 00:00:00 2001 From: Adrien Delorme Date: Thu, 2 Jul 2020 15:07:29 +0200 Subject: [PATCH 03/38] Revert "Share build info with Provisioner and Post-Processor via HCL2 variables (#9444)" This reverts commit 99046c917822ede71b32b46a841fd6b4f2fa5d79. --- command/build_test.go | 115 +++--------------- .../basic_template.pkr.hcl | 15 --- .../basic_template_with_hcl_func.pkr.hcl | 21 ---- .../multiple_build_blocks.pkr.hcl | 46 ------- .../multiple_source_build.pkr.hcl | 32 ----- .../named_build.pkr.hcl | 16 --- hcl2template/common_test.go | 32 ----- hcl2template/types.build.post-processor.go | 48 +------- hcl2template/types.build.provisioners.go | 38 +----- hcl2template/types.packer_config.go | 69 ++++------- packer/build.go | 23 ---- packer/provisioner.go | 31 +---- post-processor/shell-local/post-processor.go | 6 +- website/data/docs-navigation.js | 1 - website/pages/docs/builders/amazon/chroot.mdx | 45 +------ website/pages/docs/builders/amazon/ebs.mdx | 41 +------ .../docs/builders/amazon/ebssurrogate.mdx | 41 +------ .../pages/docs/builders/amazon/ebsvolume.mdx | 41 +------ .../pages/docs/builders/amazon/instance.mdx | 41 +------ .../from-1.5/blocks/build/post-processor.mdx | 5 - .../from-1.5/blocks/build/provisioner.mdx | 7 +- .../docs/from-1.5/contextual-variables.mdx | 71 ----------- website/pages/docs/templates/engine.mdx | 16 +-- 23 files changed, 69 insertions(+), 732 deletions(-) delete mode 100644 command/test-fixtures/build-variable-sharing/basic_template.pkr.hcl delete mode 100644 command/test-fixtures/build-variable-sharing/basic_template_with_hcl_func.pkr.hcl delete mode 100644 command/test-fixtures/build-variable-sharing/multiple_build_blocks.pkr.hcl delete mode 100644 command/test-fixtures/build-variable-sharing/multiple_source_build.pkr.hcl delete mode 100644 command/test-fixtures/build-variable-sharing/named_build.pkr.hcl delete mode 100644 website/pages/docs/from-1.5/contextual-variables.mdx diff --git a/command/build_test.go b/command/build_test.go index 5cc9ba10a..e464b3401 100644 --- a/command/build_test.go +++ b/command/build_test.go @@ -228,8 +228,8 @@ func TestBuild(t *testing.T) { testFixture("hcl-only-except"), }, fileCheck: fileCheck{ - expected: []string{"chocolate.txt", "vanilla.txt"}, notExpected: []string{"cherry.txt"}, + expected: []string{"chocolate.txt", "vanilla.txt"}, }, }, } @@ -341,109 +341,26 @@ func TestBuildProvisionAndPosProcessWithBuildVariablesSharing(t *testing.T) { c := &BuildCommand{ Meta: testMetaFile(t), } - tc := []struct { - name string - args []string - expectedFiles []string - notExpectedFiles []string - }{ - { - name: "JSON: basic template", - args: []string{ - filepath.Join(testFixture("build-variable-sharing"), "template.json"), - }, - expectedFiles: []string{ - "provisioner.Null.txt", - "post-processor.Null.txt", - }, - notExpectedFiles: []string{}, - }, - { - name: "HCL2: basic template", - args: []string{ - filepath.Join(testFixture("build-variable-sharing"), "basic_template.pkr.hcl"), - }, - expectedFiles: []string{ - "provisioner.Null.txt", - "post-processor.Null.txt", - }, - notExpectedFiles: []string{}, - }, - { - name: "HCL2: basic template with build variables within HCL function", - args: []string{ - filepath.Join(testFixture("build-variable-sharing"), "basic_template_with_hcl_func.pkr.hcl"), - }, - expectedFiles: []string{ - "provisioner.Null.txt", - "provisioner.NULL.txt", - "post-processor.Null.txt", - "post-processor.NULL.txt", - }, - notExpectedFiles: []string{}, - }, - { - name: "HCL2: basic template with named build", - args: []string{ - filepath.Join(testFixture("build-variable-sharing"), "named_build.pkr.hcl"), - }, - expectedFiles: []string{ - "provisioner.Null.txt", - "post-processor.Null.txt", - }, - notExpectedFiles: []string{}, - }, - { - name: "HCL2: multiple build block sharing same sources", - args: []string{ - filepath.Join(testFixture("build-variable-sharing"), "multiple_build_blocks.pkr.hcl"), - }, - expectedFiles: []string{ - "vanilla.chocolate.provisioner.Null.txt", - "vanilla.chocolate.post-processor.Null.txt", - "apple.chocolate.provisioner.Null.txt", - "apple.chocolate.post-processor.Null.txt", - "sugar.banana.provisioner.Null.txt", - "sugar.banana.post-processor.Null.txt", - }, - notExpectedFiles: []string{}, - }, - { - name: "HCL2: multiple sources build with only/except set for provisioner and post-processors", - args: []string{ - filepath.Join(testFixture("build-variable-sharing"), "multiple_source_build.pkr.hcl"), - }, - expectedFiles: []string{ - "all.Null.txt", - }, - notExpectedFiles: []string{ - "chocolate.Null.txt", - "banana.Null.txt", - }, - }, + + args := []string{ + filepath.Join(testFixture("build-variable-sharing"), "template.json"), } - for _, tt := range tc { - t.Run(tt.name, func(t *testing.T) { - defer cleanup(tt.expectedFiles...) - defer cleanup(tt.notExpectedFiles...) + files := []string{ + "provisioner.Null.txt", + "post-processor.Null.txt", + } - if code := c.Run(tt.args); code != 0 { - fatalCommand(t, c.Meta) - } + defer cleanup(files...) - for _, f := range tt.expectedFiles { - if !fileExists(f) { - t.Errorf("Expected to find %s", f) - } - } + if code := c.Run(args); code != 0 { + fatalCommand(t, c.Meta) + } - for _, f := range tt.notExpectedFiles { - if fileExists(f) { - t.Errorf("Not expected to find %s", f) - } - } - }) + for _, f := range files { + if !fileExists(f) { + t.Errorf("Expected to find %s", f) + } } } diff --git a/command/test-fixtures/build-variable-sharing/basic_template.pkr.hcl b/command/test-fixtures/build-variable-sharing/basic_template.pkr.hcl deleted file mode 100644 index 052a9b072..000000000 --- a/command/test-fixtures/build-variable-sharing/basic_template.pkr.hcl +++ /dev/null @@ -1,15 +0,0 @@ -source "null" "chocolate" { - communicator = "none" -} - -build { - sources = ["null.chocolate"] - - provisioner "shell-local" { - inline = ["echo hi > provisioner.${build.ID}.txt"] - } - - post-processor "shell-local" { - inline = ["echo hi > post-processor.${build.ID}.txt"] - } -} \ No newline at end of file diff --git a/command/test-fixtures/build-variable-sharing/basic_template_with_hcl_func.pkr.hcl b/command/test-fixtures/build-variable-sharing/basic_template_with_hcl_func.pkr.hcl deleted file mode 100644 index 218c28f2a..000000000 --- a/command/test-fixtures/build-variable-sharing/basic_template_with_hcl_func.pkr.hcl +++ /dev/null @@ -1,21 +0,0 @@ -source "null" "chocolate" { - communicator = "none" -} - -build { - sources = ["null.chocolate"] - - provisioner "shell-local" { - inline = [ - "echo hi > provisioner.${build.ID}.txt", - "echo hi > provisioner.${upper(build.ID)}.txt" - ] - } - - post-processor "shell-local" { - inline = [ - "echo hi > post-processor.${build.ID}.txt", - "echo hi > post-processor.${upper(build.ID)}.txt" - ] - } -} \ No newline at end of file diff --git a/command/test-fixtures/build-variable-sharing/multiple_build_blocks.pkr.hcl b/command/test-fixtures/build-variable-sharing/multiple_build_blocks.pkr.hcl deleted file mode 100644 index 4af6bcc5b..000000000 --- a/command/test-fixtures/build-variable-sharing/multiple_build_blocks.pkr.hcl +++ /dev/null @@ -1,46 +0,0 @@ -source "null" "chocolate" { - communicator = "none" -} - -source "null" "banana" { - communicator = "none" -} - -build { - name = "vanilla" - sources = ["null.chocolate"] - - provisioner "shell-local" { - inline = ["echo hi > vanilla.chocolate.provisioner.${build.ID}.txt"] - } - - post-processor "shell-local" { - inline = ["echo hi > vanilla.chocolate.post-processor.${build.ID}.txt"] - } -} - -build { - name = "apple" - sources = ["null.chocolate"] - - provisioner "shell-local" { - inline = ["echo hi > apple.chocolate.provisioner.${build.ID}.txt"] - } - - post-processor "shell-local" { - inline = ["echo hi > apple.chocolate.post-processor.${build.ID}.txt"] - } -} - -build { - name = "sugar" - sources = ["null.banana"] - - provisioner "shell-local" { - inline = ["echo hi > sugar.banana.provisioner.${build.ID}.txt"] - } - - post-processor "shell-local" { - inline = ["echo hi > sugar.banana.post-processor.${build.ID}.txt"] - } -} \ No newline at end of file diff --git a/command/test-fixtures/build-variable-sharing/multiple_source_build.pkr.hcl b/command/test-fixtures/build-variable-sharing/multiple_source_build.pkr.hcl deleted file mode 100644 index 8e1f0e97a..000000000 --- a/command/test-fixtures/build-variable-sharing/multiple_source_build.pkr.hcl +++ /dev/null @@ -1,32 +0,0 @@ -source "null" "chocolate" { - communicator = "none" -} - -source "null" "banana" { - communicator = "none" -} - -build { - name = "vanilla" - sources = [ - "null.chocolate", - "null.banana", - ] - - provisioner "shell-local" { - inline = [ - "echo hi > all.${build.ID}.txt", - "echo hi > chocolate.${build.ID}.txt", - "echo hi > banana.${build.ID}.txt" - ] - } - - post-processor "shell-local" { - only = ["null.chocolate"] - inline = ["rm chocolate.${build.ID}.txt"] - } - post-processor "shell-local" { - except = ["null.chocolate"] - inline = ["rm banana.${build.ID}.txt"] - } -} \ No newline at end of file diff --git a/command/test-fixtures/build-variable-sharing/named_build.pkr.hcl b/command/test-fixtures/build-variable-sharing/named_build.pkr.hcl deleted file mode 100644 index 6e110365f..000000000 --- a/command/test-fixtures/build-variable-sharing/named_build.pkr.hcl +++ /dev/null @@ -1,16 +0,0 @@ -source "null" "chocolate" { - communicator = "none" -} - -build { - name = "vanilla" - sources = ["null.chocolate"] - - provisioner "shell-local" { - inline = ["echo hi > provisioner.${build.ID}.txt"] - } - - post-processor "shell-local" { - inline = ["echo hi > post-processor.${build.ID}.txt"] - } -} \ No newline at end of file diff --git a/hcl2template/common_test.go b/hcl2template/common_test.go index 541d077b2..5db6dc6c2 100644 --- a/hcl2template/common_test.go +++ b/hcl2template/common_test.go @@ -121,37 +121,6 @@ func testParse(t *testing.T, tests []parseTest) { if tt.getBuildsWantDiags == (gotDiags == nil) { t.Fatalf("Parser.getBuilds() unexpected diagnostics. %s", gotDiags) } - - // Validates implementation of HCL2ProvisionerPrepare and HCL2PostProcessorsPrepare - for _, build := range gotBuilds { - coreBuild, ok := build.(*packer.CoreBuild) - if !ok { - t.Fatalf("build %s should implement CoreBuild", build.Name()) - } - if coreBuild.HCL2ProvisionerPrepare == nil { - t.Fatalf("build %s should have HCL2ProvisionerPrepare implementation", build.Name()) - } - if coreBuild.HCL2PostProcessorsPrepare == nil { - t.Fatalf("build %s should have HCL2PostProcessorsPrepare implementation", build.Name()) - } - - provisioners, diags := coreBuild.HCL2ProvisionerPrepare(nil) - if diags.HasErrors() { - t.Fatalf("build %s: HCL2ProvisionerPrepare should prepare provisioners", build.Name()) - } - coreBuild.Provisioners = provisioners - - postProcessors, diags := coreBuild.HCL2PostProcessorsPrepare(nil) - if diags.HasErrors() { - t.Fatalf("build %s: HCL2PostProcessorsPrepare should prepare post-processors", build.Name()) - } - if len(postProcessors) > 0 { - coreBuild.PostProcessors = [][]packer.CoreBuildPostProcessor{postProcessors} - } else { - coreBuild.PostProcessors = [][]packer.CoreBuildPostProcessor{} - } - } - if diff := cmp.Diff(tt.getBuildsWantBuilds, gotBuilds, cmpopts.IgnoreUnexported( cty.Value{}, @@ -161,7 +130,6 @@ func testParse(t *testing.T, tests []parseTest) { packer.CoreBuildPostProcessor{}, null.Builder{}, ), - cmpopts.IgnoreFields(packer.CoreBuild{}, "HCL2ProvisionerPrepare", "HCL2PostProcessorsPrepare"), ); diff != "" { t.Fatalf("Parser.getBuilds() wrong packer builds. %s", diff) } diff --git a/hcl2template/types.build.post-processor.go b/hcl2template/types.build.post-processor.go index 6fa249f00..b45b682f5 100644 --- a/hcl2template/types.build.post-processor.go +++ b/hcl2template/types.build.post-processor.go @@ -6,7 +6,6 @@ import ( "github.com/hashicorp/hcl/v2" "github.com/hashicorp/hcl/v2/gohcl" "github.com/hashicorp/packer/packer" - "github.com/zclconf/go-cty/cty" ) // ProvisionerBlock references a detected but unparsed post processor @@ -62,7 +61,7 @@ func (p *Parser) decodePostProcessor(block *hcl.Block) (*PostProcessorBlock, hcl return postProcessor, diags } -func (cfg *PackerConfig) startPostProcessor(source SourceBlock, pp *PostProcessorBlock, ectx *hcl.EvalContext) (packer.PostProcessor, hcl.Diagnostics) { +func (cfg *PackerConfig) startPostProcessor(source SourceBlock, pp *PostProcessorBlock, ectx *hcl.EvalContext, generatedVars map[string]string) (packer.PostProcessor, hcl.Diagnostics) { // ProvisionerBlock represents a detected but unparsed provisioner var diags hcl.Diagnostics @@ -77,7 +76,7 @@ func (cfg *PackerConfig) startPostProcessor(source SourceBlock, pp *PostProcesso } flatProvisinerCfg, moreDiags := decodeHCL2Spec(pp.Rest, ectx, postProcessor) diags = append(diags, moreDiags...) - err = postProcessor.Configure(source.builderVariables(), flatProvisinerCfg) + err = postProcessor.Configure(source.builderVariables(), flatProvisinerCfg, generatedVars) if err != nil { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, @@ -89,46 +88,3 @@ func (cfg *PackerConfig) startPostProcessor(source SourceBlock, pp *PostProcesso } return postProcessor, diags } - -type postProcessorsPrepare struct { - cfg *PackerConfig - postProcessorBlock []*PostProcessorBlock - src SourceRef -} - -// HCL2PostProcessorsPrepare is used by the CoreBuild at the runtime, after running the build and before running the post-processors, -// to interpolate any build variable by decoding and preparing it. -func (pp *postProcessorsPrepare) HCL2PostProcessorsPrepare(builderArtifact packer.Artifact) ([]packer.CoreBuildPostProcessor, hcl.Diagnostics) { - src := pp.cfg.Sources[pp.src.Ref()] - - generatedData := make(map[string]interface{}) - if builderArtifact != nil { - artifactStateData := builderArtifact.State("generated_data") - if artifactStateData != nil { - for k, v := range artifactStateData.(map[interface{}]interface{}) { - generatedData[k.(string)] = v - } - } - } - - variables := make(Variables) - for k, v := range generatedData { - if value, ok := v.(string); ok { - variables[k] = &Variable{ - DefaultValue: cty.StringVal(value), - Type: cty.String, - } - } - } - variablesVal, _ := variables.Values() - - generatedVariables := map[string]cty.Value{ - sourcesAccessor: cty.ObjectVal(map[string]cty.Value{ - "type": cty.StringVal(src.Type), - "name": cty.StringVal(src.Name), - }), - buildAccessor: cty.ObjectVal(variablesVal), - } - - return pp.cfg.getCoreBuildPostProcessors(src, pp.postProcessorBlock, pp.cfg.EvalContext(generatedVariables)) -} diff --git a/hcl2template/types.build.provisioners.go b/hcl2template/types.build.provisioners.go index a2eeb2ee9..70756f39e 100644 --- a/hcl2template/types.build.provisioners.go +++ b/hcl2template/types.build.provisioners.go @@ -7,7 +7,6 @@ import ( "github.com/hashicorp/hcl/v2" "github.com/hashicorp/hcl/v2/gohcl" "github.com/hashicorp/packer/packer" - "github.com/zclconf/go-cty/cty" ) // OnlyExcept is a struct that is meant to be embedded that contains the @@ -133,7 +132,7 @@ func (p *Parser) decodeProvisioner(block *hcl.Block) (*ProvisionerBlock, hcl.Dia return provisioner, diags } -func (cfg *PackerConfig) startProvisioner(source SourceBlock, pb *ProvisionerBlock, ectx *hcl.EvalContext) (packer.Provisioner, hcl.Diagnostics) { +func (cfg *PackerConfig) startProvisioner(source SourceBlock, pb *ProvisionerBlock, ectx *hcl.EvalContext, generatedVars map[string]string) (packer.Provisioner, hcl.Diagnostics) { var diags hcl.Diagnostics provisioner, err := cfg.provisionersSchemas.Start(pb.PType) @@ -156,7 +155,7 @@ func (cfg *PackerConfig) startProvisioner(source SourceBlock, pb *ProvisionerBlo // configs := make([]interface{}, 2) // configs = append(, flatProvisionerCfg) // configs = append(configs, generatedVars) - err = provisioner.Prepare(source.builderVariables(), flatProvisionerCfg) + err = provisioner.Prepare(source.builderVariables(), flatProvisionerCfg, generatedVars) if err != nil { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, @@ -168,36 +167,3 @@ func (cfg *PackerConfig) startProvisioner(source SourceBlock, pb *ProvisionerBlo } return provisioner, diags } - -type provisionerPrepare struct { - cfg *PackerConfig - provisionerBlock []*ProvisionerBlock - src SourceRef -} - -// HCL2ProvisionerPrepare is used by the ProvisionHook at the runtime in the provision step -// to interpolate any build variable by decoding and preparing it again. -func (pp *provisionerPrepare) HCL2ProvisionerPrepare(data map[string]interface{}) ([]packer.CoreBuildProvisioner, hcl.Diagnostics) { - src := pp.cfg.Sources[pp.src.Ref()] - - variables := make(Variables) - for k, v := range data { - if value, ok := v.(string); ok { - variables[k] = &Variable{ - DefaultValue: cty.StringVal(value), - Type: cty.String, - } - } - } - variablesVal, _ := variables.Values() - - generatedVariables := map[string]cty.Value{ - sourcesAccessor: cty.ObjectVal(map[string]cty.Value{ - "type": cty.StringVal(src.Type), - "name": cty.StringVal(src.Name), - }), - buildAccessor: cty.ObjectVal(variablesVal), - } - - return pp.cfg.getCoreBuildProvisioners(src, pp.provisionerBlock, pp.cfg.EvalContext(generatedVariables)) -} diff --git a/hcl2template/types.packer_config.go b/hcl2template/types.packer_config.go index b791dabd1..2758c5ed1 100644 --- a/hcl2template/types.packer_config.go +++ b/hcl2template/types.packer_config.go @@ -7,6 +7,7 @@ import ( "github.com/gobwas/glob" "github.com/hashicorp/hcl/v2" "github.com/hashicorp/hcl/v2/hclsyntax" + "github.com/hashicorp/packer/helper/common" "github.com/hashicorp/packer/packer" "github.com/zclconf/go-cty/cty" ) @@ -40,7 +41,6 @@ type PackerConfig struct { except []glob.Glob only []glob.Glob - debug bool } type ValidationOptions struct { @@ -51,7 +51,6 @@ const ( inputVariablesAccessor = "var" localsAccessor = "local" sourcesAccessor = "source" - buildAccessor = "build" ) // EvalContext returns the *hcl.EvalContext that will be passed to an hcl @@ -199,18 +198,19 @@ func (c *PackerConfig) evaluateLocalVariable(local *Local) hcl.Diagnostics { // getCoreBuildProvisioners takes a list of provisioner block, starts according // provisioners and sends parsed HCL2 over to it. -func (cfg *PackerConfig) getCoreBuildProvisioners(source SourceBlock, blocks []*ProvisionerBlock, ectx *hcl.EvalContext) ([]packer.CoreBuildProvisioner, hcl.Diagnostics) { +func (cfg *PackerConfig) getCoreBuildProvisioners(source SourceBlock, blocks []*ProvisionerBlock, ectx *hcl.EvalContext, generatedVars map[string]string) ([]packer.CoreBuildProvisioner, hcl.Diagnostics) { var diags hcl.Diagnostics res := []packer.CoreBuildProvisioner{} for _, pb := range blocks { if pb.OnlyExcept.Skip(source.String()) { continue } - provisioner, moreDiags := cfg.startProvisioner(source, pb, ectx) + provisioner, moreDiags := cfg.startProvisioner(source, pb, ectx, generatedVars) diags = append(diags, moreDiags...) if moreDiags.HasErrors() { continue } + // If we're pausing, we wrap the provisioner in a special pauser. if pb.PauseBefore != 0 { provisioner = &packer.PausedProvisioner{ @@ -229,11 +229,6 @@ func (cfg *PackerConfig) getCoreBuildProvisioners(source SourceBlock, blocks []* Provisioner: provisioner, } } - if cfg.debug { - provisioner = &packer.DebuggedProvisioner{ - Provisioner: provisioner, - } - } res = append(res, packer.CoreBuildProvisioner{ PType: pb.PType, @@ -246,7 +241,7 @@ func (cfg *PackerConfig) getCoreBuildProvisioners(source SourceBlock, blocks []* // getCoreBuildProvisioners takes a list of post processor block, starts // according provisioners and sends parsed HCL2 over to it. -func (cfg *PackerConfig) getCoreBuildPostProcessors(source SourceBlock, blocks []*PostProcessorBlock, ectx *hcl.EvalContext) ([]packer.CoreBuildPostProcessor, hcl.Diagnostics) { +func (cfg *PackerConfig) getCoreBuildPostProcessors(source SourceBlock, blocks []*PostProcessorBlock, ectx *hcl.EvalContext, generatedVars map[string]string) ([]packer.CoreBuildPostProcessor, hcl.Diagnostics) { var diags hcl.Diagnostics res := []packer.CoreBuildPostProcessor{} for _, ppb := range blocks { @@ -270,7 +265,7 @@ func (cfg *PackerConfig) getCoreBuildPostProcessors(source SourceBlock, blocks [ break } - postProcessor, moreDiags := cfg.startPostProcessor(source, ppb, ectx) + postProcessor, moreDiags := cfg.startPostProcessor(source, ppb, ectx, generatedVars) diags = append(diags, moreDiags...) if moreDiags.HasErrors() { continue @@ -293,8 +288,6 @@ func (cfg *PackerConfig) GetBuilds(opts packer.GetBuildsOptions) ([]packer.Build res := []packer.Build{} var diags hcl.Diagnostics - cfg.debug = opts.Debug - for _, build := range cfg.Builds { for _, from := range build.Sources { src, found := cfg.Sources[from.Ref()] @@ -361,6 +354,13 @@ func (cfg *PackerConfig) GetBuilds(opts packer.GetBuildsOptions) ([]packer.Build continue } + variables := map[string]cty.Value{ + sourcesAccessor: cty.ObjectVal(map[string]cty.Value{ + "type": cty.StringVal(src.Type), + "name": cty.StringVal(src.Name), + }), + } + // If the builder has provided a list of to-be-generated variables that // should be made accessible to provisioners, pass that list into // the provisioner prepare() so that the provisioner can appropriately @@ -369,42 +369,30 @@ func (cfg *PackerConfig) GetBuilds(opts packer.GetBuildsOptions) ([]packer.Build generatedPlaceholderMap := packer.BasicPlaceholderData() if generatedVars != nil { for _, k := range generatedVars { - generatedPlaceholderMap[k] = "" + generatedPlaceholderMap[k] = fmt.Sprintf("Build_%s. "+ + common.PlaceholderMsg, k) } } - buildVariables, _ := setBuildVariables(generatedPlaceholderMap).Values() - variables := map[string]cty.Value{ - sourcesAccessor: cty.ObjectVal(map[string]cty.Value{ - "type": cty.StringVal(src.Type), - "name": cty.StringVal(src.Name), - }), - buildAccessor: cty.ObjectVal(buildVariables), - } - - _, moreDiags = cfg.getCoreBuildProvisioners(src, build.ProvisionerBlocks, cfg.EvalContext(variables)) + provisioners, moreDiags := cfg.getCoreBuildProvisioners(src, build.ProvisionerBlocks, cfg.EvalContext(variables), generatedPlaceholderMap) diags = append(diags, moreDiags...) if moreDiags.HasErrors() { continue } - _, moreDiags = cfg.getCoreBuildPostProcessors(src, build.PostProcessors, cfg.EvalContext(variables)) + postProcessors, moreDiags := cfg.getCoreBuildPostProcessors(src, build.PostProcessors, cfg.EvalContext(variables), generatedPlaceholderMap) + pps := [][]packer.CoreBuildPostProcessor{} + if len(postProcessors) > 0 { + pps = [][]packer.CoreBuildPostProcessor{postProcessors} + } diags = append(diags, moreDiags...) if moreDiags.HasErrors() { continue } pcb.Builder = builder + pcb.Provisioners = provisioners + pcb.PostProcessors = pps pcb.Prepared = true - pcb.HCL2ProvisionerPrepare = (&provisionerPrepare{ - cfg: cfg, - provisionerBlock: build.ProvisionerBlocks, - src: from, - }).HCL2ProvisionerPrepare - pcb.HCL2PostProcessorsPrepare = (&postProcessorsPrepare{ - cfg: cfg, - postProcessorBlock: build.PostProcessors, - src: from, - }).HCL2PostProcessorsPrepare // Prepare just sets the "prepareCalled" flag on CoreBuild, since // we did all the prep here. @@ -425,17 +413,6 @@ func (cfg *PackerConfig) GetBuilds(opts packer.GetBuildsOptions) ([]packer.Build return res, diags } -func setBuildVariables(generatedVars map[string]string) Variables { - variables := make(Variables) - for k := range generatedVars { - variables[k] = &Variable{ - DefaultValue: cty.StringVal("unknown"), - Type: cty.String, - } - } - return variables -} - var PackerConsoleHelp = strings.TrimSpace(` Packer console HCL2 Mode. The Packer console allows you to experiment with Packer interpolations. diff --git a/packer/build.go b/packer/build.go index 78b16ec3f..ca900797f 100644 --- a/packer/build.go +++ b/packer/build.go @@ -6,7 +6,6 @@ import ( "log" "sync" - "github.com/hashicorp/hcl/v2" "github.com/hashicorp/packer/helper/common" ) @@ -102,11 +101,6 @@ type CoreBuild struct { // Indicates whether the build is already initialized before calling Prepare(..) Prepared bool - // HCL2ProvisionerPrepare and HCL2PostProcessorsPrepare are used to interpolate any build variable by decoding and preparing - // the Provisioners and Post-Processors at runtime for HCL2 templates. - HCL2ProvisionerPrepare func(data map[string]interface{}) ([]CoreBuildProvisioner, hcl.Diagnostics) - HCL2PostProcessorsPrepare func(builderArtifact Artifact) ([]CoreBuildPostProcessor, hcl.Diagnostics) - debug bool force bool onError string @@ -274,12 +268,6 @@ func (b *CoreBuild) Run(ctx context.Context, originalUi Ui) ([]Artifact, error) }) } - if b.HCL2ProvisionerPrepare != nil { - hooks[HookProvision] = append(hooks[HookProvision], &ProvisionHook{ - HCL2Prepare: b.HCL2ProvisionerPrepare, - }) - } - if b.CleanupProvisioner.PType != "" { hookedCleanupProvisioner := &HookedProvisioner{ b.CleanupProvisioner.Provisioner, @@ -315,17 +303,6 @@ func (b *CoreBuild) Run(ctx context.Context, originalUi Ui) ([]Artifact, error) } errors := make([]error, 0) - - if b.HCL2PostProcessorsPrepare != nil { - // For HCL2, decode and prepare Post-Processors to interpolate build variables. - postProcessors, diags := b.HCL2PostProcessorsPrepare(builderArtifact) - if diags.HasErrors() { - errors = append(errors, diags) - } else if len(postProcessors) > 0 { - b.PostProcessors = [][]CoreBuildPostProcessor{postProcessors} - } - } - keepOriginalArtifact := len(b.PostProcessors) == 0 // Run the post-processors diff --git a/packer/provisioner.go b/packer/provisioner.go index d549c431b..905b28971 100644 --- a/packer/provisioner.go +++ b/packer/provisioner.go @@ -7,7 +7,6 @@ import ( "sync" "time" - "github.com/hashicorp/hcl/v2" "github.com/hashicorp/hcl/v2/hcldec" "github.com/hashicorp/packer/helper/common" ) @@ -41,8 +40,6 @@ type ProvisionHook struct { // The provisioners to run as part of the hook. These should already // be prepared (by calling Prepare) at some earlier stage. Provisioners []*HookedProvisioner - - HCL2Prepare func(data map[string]interface{}) ([]CoreBuildProvisioner, hcl.Diagnostics) } // Provisioners interpolate most of their fields in the prepare stage; this @@ -116,7 +113,7 @@ func CastDataToMap(data interface{}) map[string]interface{} { // Runs the provisioners in order. func (h *ProvisionHook) Run(ctx context.Context, name string, ui Ui, comm Communicator, data interface{}) error { // Shortcut - if len(h.Provisioners) == 0 && h.HCL2Prepare == nil { + if len(h.Provisioners) == 0 { return nil } @@ -126,34 +123,10 @@ func (h *ProvisionHook) Run(ctx context.Context, name string, ui Ui, comm Commun "`communicator` config was set to \"none\". If you have any provisioners\n" + "then a communicator is required. Please fix this to continue.") } - - cast := CastDataToMap(data) - - if h.HCL2Prepare != nil { - // For HCL2, decode and prepare Provisioners now to interpolate build variables - coreP, diags := h.HCL2Prepare(cast) - if diags.HasErrors() { - return diags - } - hookedProvisioners := make([]*HookedProvisioner, len(coreP)) - for i, p := range coreP { - var pConfig interface{} - if len(p.config) > 0 { - pConfig = p.config[0] - } - - hookedProvisioners[i] = &HookedProvisioner{ - Provisioner: p.Provisioner, - Config: pConfig, - TypeName: p.PType, - } - } - h.Provisioners = hookedProvisioners - } - for _, p := range h.Provisioners { ts := CheckpointReporter.AddSpan(p.TypeName, "provisioner", p.Config) + cast := CastDataToMap(data) err := p.Provisioner.Provision(ctx, ui, comm, cast) ts.End(err) diff --git a/post-processor/shell-local/post-processor.go b/post-processor/shell-local/post-processor.go index a17ce67e3..0cbf9fe71 100644 --- a/post-processor/shell-local/post-processor.go +++ b/post-processor/shell-local/post-processor.go @@ -42,9 +42,9 @@ func (p *PostProcessor) Configure(raws ...interface{}) error { func (p *PostProcessor) PostProcess(ctx context.Context, ui packer.Ui, artifact packer.Artifact) (packer.Artifact, bool, bool, error) { generatedData := make(map[string]interface{}) - artifactStateData := artifact.State("generated_data") - if artifactStateData != nil { - for k, v := range artifactStateData.(map[interface{}]interface{}) { + artifactSateData := artifact.State("generated_data") + if artifactSateData != nil { + for k, v := range artifactSateData.(map[interface{}]interface{}) { generatedData[k.(string)] = v } } diff --git a/website/data/docs-navigation.js b/website/data/docs-navigation.js index 0669763f6..a05fe8525 100644 --- a/website/data/docs-navigation.js +++ b/website/data/docs-navigation.js @@ -140,7 +140,6 @@ export default [ }, 'variables', 'locals', - 'contextual-variables', 'syntax', 'onlyexcept', 'expressions', diff --git a/website/pages/docs/builders/amazon/chroot.mdx b/website/pages/docs/builders/amazon/chroot.mdx index 7bf474b22..d5165d6f3 100644 --- a/website/pages/docs/builders/amazon/chroot.mdx +++ b/website/pages/docs/builders/amazon/chroot.mdx @@ -328,52 +328,13 @@ variables are available: - `SourceAMIOwnerName` - The source AMI owner alias/name (for example `amazon`). - `SourceAMITags` - The source AMI Tags, as a `map[string]string` object. -## Build Shared Information Variables +## Build function template engine variables -This builder generates data that are shared with provisioner and post-processor via build function of [template engine](/docs/templates/engine) for JSON and [contextual variables](/docs/from-1.5/contextual-variables) for HCL2. - -The generated variables available for this builder are: +For the build function of [template engine](/docs/templates/engine), the following +variables are available: - `SourceAMIName` - The source AMI Name (for example `ubuntu/images/ebs-ssd/ubuntu-xenial-16.04-amd64-server-20180306`) used to build the AMI. - `Device` - Root device path. - `MountPath` - Device mounting path. - -Usage example: - - - - -```json -"post-processors": [ - { - "type": "manifest", - "output": "manifest.json", - "strip_path": true, - "custom_data": { - "source_ami_name": "{{ build `SourceAMIName` }}", - "device": "{{ build `Device` }}", - "mount_path": "{{ build `MountPath` }}" - } - } -] -``` - - - - -```hcl -post-processor "manifest" { - output = "manifest.json" - strip_path = true - custom_data = { - source_ami_name = "${build.SourceAMIName}" - device = "${build.Device}" - mount_path = "${build.MountPath}" - } -} -``` - - - diff --git a/website/pages/docs/builders/amazon/ebs.mdx b/website/pages/docs/builders/amazon/ebs.mdx index e0db95037..351f97915 100644 --- a/website/pages/docs/builders/amazon/ebs.mdx +++ b/website/pages/docs/builders/amazon/ebs.mdx @@ -235,50 +235,15 @@ variables are available: - `SourceAMIOwnerName` - The source AMI owner alias/name (for example `amazon`). - `SourceAMITags` - The source AMI Tags, as a `map[string]string` object. -## Build Shared Information Variables +## Build function template engine variables -This builder generates data that are shared with provisioner and post-processor via build function of [template engine](/docs/templates/engine) for JSON and [contextual variables](/docs/from-1.5/contextual-variables) for HCL2. - -The generated variables available for this builder are: +For the build function of [template engine](/docs/templates/engine), the following +variables are available: - `SourceAMIName` - The source AMI Name (for example `ubuntu/images/ebs-ssd/ubuntu-xenial-16.04-amd64-server-20180306`) used to build the AMI. -Usage example: - - - - -```json -"post-processors": [ - { - "type": "manifest", - "output": "manifest.json", - "strip_path": true, - "custom_data": { - "source_ami_name": "{{ build `SourceAMIName` }}" - } - } -] -``` - - - - -```hcl -post-processor "manifest" { - output = "manifest.json" - strip_path = true - custom_data = { - source_ami_name = "${build.SourceAMIName}" - } -} -``` - - - - ## Tag Example Here is an example using the optional AMI tags. This will add the tags diff --git a/website/pages/docs/builders/amazon/ebssurrogate.mdx b/website/pages/docs/builders/amazon/ebssurrogate.mdx index 529db51e0..deb506e13 100644 --- a/website/pages/docs/builders/amazon/ebssurrogate.mdx +++ b/website/pages/docs/builders/amazon/ebssurrogate.mdx @@ -207,50 +207,15 @@ variables are available: - `SourceAMIOwnerName` - The source AMI owner alias/name (for example `amazon`). - `SourceAMITags` - The source AMI Tags, as a `map[string]string` object. -## Build Shared Information Variables +## Build function template engine variables -This builder generates data that are shared with provisioner and post-processor via build function of [template engine](/docs/templates/engine) for JSON and [contextual variables](/docs/from-1.5/contextual-variables) for HCL2. - -The generated variables available for this builder are: +For the build function of [template engine](/docs/templates/engine), the following +variables are available: - `SourceAMIName` - The source AMI Name (for example `ubuntu/images/ebs-ssd/ubuntu-xenial-16.04-amd64-server-20180306`) used to build the AMI. -Usage example: - - - - -```json -"post-processors": [ - { - "type": "manifest", - "output": "manifest.json", - "strip_path": true, - "custom_data": { - "source_ami_name": "{{ build `SourceAMIName` }}" - } - } -] -``` - - - - -```hcl -post-processor "manifest" { - output = "manifest.json" - strip_path = true - custom_data = { - source_ami_name = "${build.SourceAMIName}" - } -} -``` - - - - -> **Note:** Packer uses pre-built AMIs as the source for building images. These source AMIs may include volumes that are not flagged to be destroyed on termination of the instance building the new image. In addition to those diff --git a/website/pages/docs/builders/amazon/ebsvolume.mdx b/website/pages/docs/builders/amazon/ebsvolume.mdx index 4e25e3dcf..1b5b6aabc 100644 --- a/website/pages/docs/builders/amazon/ebsvolume.mdx +++ b/website/pages/docs/builders/amazon/ebsvolume.mdx @@ -243,48 +243,13 @@ termination of the instance building the new image. In addition to those volumes created by this builder, any volumes in the source AMI which are not marked for deletion on termination will remain in your account. -## Build Shared Information Variables +## Build function template engine variables -This builder generates data that are shared with provisioner and post-processor via build function of [template engine](/docs/templates/engine) for JSON and [contextual variables](/docs/from-1.5/contextual-variables) for HCL2. - -The generated variables available for this builder are: +For the build function of [template engine](/docs/templates/engine), the following +variables are available: - `SourceAMIName` - The source AMI Name (for example `ubuntu/images/ebs-ssd/ubuntu-xenial-16.04-amd64-server-20180306`) used to build the AMI. -Usage example: - - - - -```json -"post-processors": [ - { - "type": "manifest", - "output": "manifest.json", - "strip_path": true, - "custom_data": { - "source_ami_name": "{{ build `SourceAMIName` }}" - } - } -] -``` - - - - -```hcl -post-processor "manifest" { - output = "manifest.json" - strip_path = true - custom_data = { - source_ami_name = "${build.SourceAMIName}" - } -} -``` - - - - @include 'builders/aws-ssh-differentiation-table.mdx' diff --git a/website/pages/docs/builders/amazon/instance.mdx b/website/pages/docs/builders/amazon/instance.mdx index 9abf80da1..69410bbcf 100644 --- a/website/pages/docs/builders/amazon/instance.mdx +++ b/website/pages/docs/builders/amazon/instance.mdx @@ -199,50 +199,15 @@ variables are available: - `SourceAMIOwnerName` - The source AMI owner alias/name (for example `amazon`). - `SourceAMITags` - The source AMI Tags, as a `map[string]string` object. -## Build Shared Information Variables +## Build function template engine variables -This builder generates data that are shared with provisioner and post-processor via build function of [template engine](/docs/templates/engine) for JSON and [contextual variables](/docs/from-1.5/contextual-variables) for HCL2. - -The generated variables available for this builder are: +For the build function of [template engine](/docs/templates/engine), the following +variables are available: - `SourceAMIName` - The source AMI Name (for example `ubuntu/images/ebs-ssd/ubuntu-xenial-16.04-amd64-server-20180306`) used to build the AMI. -Usage example: - - - - -```json -"post-processors": [ - { - "type": "manifest", - "output": "manifest.json", - "strip_path": true, - "custom_data": { - "source_ami_name": "{{ build `SourceAMIName` }}" - } - } -] -``` - - - - -```hcl -post-processor "manifest" { - output = "manifest.json" - strip_path = true - custom_data = { - source_ami_name = "${build.SourceAMIName}" - } -} -``` - - - - ## Custom Bundle Commands A lot of the process required for creating an instance-store backed AMI diff --git a/website/pages/docs/from-1.5/blocks/build/post-processor.mdx b/website/pages/docs/from-1.5/blocks/build/post-processor.mdx index cb94f1ef9..47fccaabb 100644 --- a/website/pages/docs/from-1.5/blocks/build/post-processor.mdx +++ b/website/pages/docs/from-1.5/blocks/build/post-processor.mdx @@ -71,8 +71,3 @@ build { ``` The values within `only` or `except` are _source names_, not builder types. - -## Build Contextual Variables - -Packer allows to access connection information and basic instance state information from a post-processor. These information are stored in the `build` variable. -Check out the [Contextual Variables](/docs/from-1.5/contextual-variables) documentation to learn more about and see some examples of how to use them. diff --git a/website/pages/docs/from-1.5/blocks/build/provisioner.mdx b/website/pages/docs/from-1.5/blocks/build/provisioner.mdx index 5ab488405..0c06e36f8 100644 --- a/website/pages/docs/from-1.5/blocks/build/provisioner.mdx +++ b/website/pages/docs/from-1.5/blocks/build/provisioner.mdx @@ -59,7 +59,7 @@ build { ] provisioner "shell" { # This provisioner only runs for the 'first-example' source. - only = ["source.amazon-ebs.first-example"] + only = ["source.amazon-ebs.first-example"] inline = [ "echo provisioning all the things", @@ -160,8 +160,3 @@ For the above provisioner, Packer will cancel the script if it takes more than 5 minutes. Timeout has no effect in debug mode. - -## Build Contextual Variables - -Packer allows to access connection information and basic instance state information from a provisioner. These information are stored in the `build` variable. -Check out the [Contextual Variables](/docs/from-1.5/contextual-variables) documentation to learn more about and see some examples of how to use them. diff --git a/website/pages/docs/from-1.5/contextual-variables.mdx b/website/pages/docs/from-1.5/contextual-variables.mdx deleted file mode 100644 index 48c91472d..000000000 --- a/website/pages/docs/from-1.5/contextual-variables.mdx +++ /dev/null @@ -1,71 +0,0 @@ ---- -layout: docs -page_title: Contextual Variables - HCL Configuration Language -sidebar_title: Contextual Variables -description: |- - Special variables provide connection information and basic instance state information. - This page covers all existing special variables. ---- - -# Build Variables - -`@include 'from-1.5/beta-hcl2-note.mdx'` - -Build variables will allow you to access connection information and basic instance state information for a builder. -All special build variables are stored in the `build` variable: - -```hcl - provisioner "shell" { - environment_vars = ["TESTVAR=${build.PackerRunUUID}"] - inline = ["echo $TESTVAR"] - } -``` - -Here is the list of available build variables: - -- **ID**: Represents the vm being provisioned. For example, in Amazon it is the instance id; in digitalocean, - it is the droplet id; in Vmware, it is the vm name. - -- **Host**, **Port**, **User** and **Password**: The host, port, user, and password that Packer uses to access the machine. - Useful for using the shell local provisioner to run Ansible or Inspec against the provisioned instance. - -- **ConnType**: Type of communicator being used. For example, for SSH communicator this will be "ssh". - -- **PackerRunUUID**: Current build's unique id. Can be used to specify build artifacts. - An example of that, is when multiple builds runs at the same time producing the same artifact. - It's possible to differentiate these artifacts by naming them with the builds' unique ids. - -- **PackerHTTPIP**, **PackerHTTPPort**, and **PackerHTTPAddr**: HTTP IP, port, and address of the file server Packer creates to serve items in the "http" dir to the vm. The HTTP address is displayed in the format `IP:PORT`. - -- **SSHPublicKey** and **SSHPrivateKey**: The public and private key that Packer uses to connect to the instance. - These are unique to the SSH communicator and are unset when using other communicators. - **SSHPublicKey** and **SSHPrivateKey** can have escape sequences and special characters so their output should be single quoted to avoid surprises. For example: - - ```hcl - provisioner "shell" { - inline = ["echo '${build.SSHPrivateKey}' > /tmp/packer-session.pem"] - } - ``` - -For backwards compatibility, `WinRMPassword` is also available through this -engine, though it is no different than using the more general `Password`. - -All build variables are valid to use with any of the [HCL2 functions](/docs/from-1.5/functions). -Example of using [upper](/docs/from-1.5/functions/string/upper) to upper case the build ID: - -```hcl - post-processor "shell-local" { - inline = ["echo ${upper(build.ID)}"] - } -``` - -For builder-specific builder variables, please also refer to the builder docs: - - - Amazon EC2: [chroot](/docs/builders/amazon/chroot#build-shared-information-variables), - [EBS Volume](/docs/builders/amazon/ebsvolume#build-shared-information-variables), - [EBS](/docs/builders/amazon/ebs#build-shared-information-variables), - [EBS Surrogate](/docs/builders/amazon/ebssurrogate#build-shared-information-variables), - [Instance](/docs/builders/amazon/instance#build-shared-information-variables). - -The HCL2 Special Build Variables is in beta; please report any issues or requests on the Packer -issue tracker on GitHub. diff --git a/website/pages/docs/templates/engine.mdx b/website/pages/docs/templates/engine.mdx index 11ec5f9f2..ebf50fd2e 100644 --- a/website/pages/docs/templates/engine.mdx +++ b/website/pages/docs/templates/engine.mdx @@ -83,8 +83,6 @@ Here is a full list of the available functions for reference. - **ConnType**: Type of communicator being used. For example, for SSH communicator this will be "ssh". - **PackerRunUUID**: Current build's unique id. Can be used to specify build artifacts. - An example of that, is when multiple builds runs at the same time producing the same artifact. - It's possible to differentiate these artifacts by naming them with the builds' unique ids. - **PackerHTTPIP**, **PackerHTTPPort**, and **PackerHTTPAddr**: HTTP IP, port, and address of the file server Packer creates to serve items in the "http" dir to the vm. The HTTP address is displayed in the format `IP:PORT`. @@ -100,20 +98,16 @@ Here is a full list of the available functions for reference. } ``` - For backwards compatibility, `WinRMPassword` is also available through this + For backwards compatability, `WinRMPassword` is also available through this engine, though it is no different than using the more general `Password`. This function is only for use within specific options inside of _provisioners_ -- these options will be listed as being template engines - in the provisioner documentation. + in the provisioner documentation. This feature does not yet work + if the provisioners are being used in conjunction with our chroot builders + or with lxc/lxd builders. - For builder-specific builder variables, please also refer to the builder docs: - - - Amazon EC2: [chroot](/docs/builders/amazon/chroot#build-shared-information-variables), - [EBS Volume](/docs/builders/amazon/ebsvolume#build-shared-information-variables), - [EBS](/docs/builders/amazon/ebs#build-shared-information-variables), - [EBS Surrogate](/docs/builders/amazon/ebssurrogate#build-shared-information-variables), - [Instance](/docs/builders/amazon/instance#build-shared-information-variables). + For builder-specific engine variables, please also refer to the builder docs. This engine is in beta; please report any issues or requests on the Packer issue tracker on GitHub. From d060cc9ef21b8e6675aca7660aee9530fac85481 Mon Sep 17 00:00:00 2001 From: Moss Date: Thu, 2 Jul 2020 14:50:45 +0200 Subject: [PATCH 04/38] create partials for each ssh key pair related config --- website/pages/docs/builders/amazon/ebs.mdx | 8 ++++++- .../docs/builders/amazon/ebssurrogate.mdx | 8 ++++++- .../pages/docs/builders/amazon/ebsvolume.mdx | 8 ++++++- .../pages/docs/builders/amazon/instance.mdx | 8 ++++++- website/pages/docs/builders/openstack.mdx | 8 ++++++- .../pages/docs/builders/virtualbox/iso.mdx | 8 ++++++- .../pages/docs/builders/virtualbox/ovf.mdx | 8 ++++++- website/pages/docs/builders/virtualbox/vm.mdx | 2 -- .../SSH-Agent-Auth-not-required.mdx | 7 ++++++ .../SSH-Key-Pair-Name-not-required.mdx | 9 ++++++++ .../SSH-Key-Pair-not-required.mdx | 23 ------------------- .../SSH-Private-Key-File-not-required.mdx | 4 ++++ .../SSH-Temporary-Key-Pair-not-required.mdx | 4 ++++ 13 files changed, 73 insertions(+), 32 deletions(-) create mode 100644 website/pages/partials/helper/communicator/SSH-Agent-Auth-not-required.mdx create mode 100644 website/pages/partials/helper/communicator/SSH-Key-Pair-Name-not-required.mdx delete mode 100644 website/pages/partials/helper/communicator/SSH-Key-Pair-not-required.mdx create mode 100644 website/pages/partials/helper/communicator/SSH-Private-Key-File-not-required.mdx create mode 100644 website/pages/partials/helper/communicator/SSH-Temporary-Key-Pair-not-required.mdx diff --git a/website/pages/docs/builders/amazon/ebs.mdx b/website/pages/docs/builders/amazon/ebs.mdx index 57ac2126a..adcb24669 100644 --- a/website/pages/docs/builders/amazon/ebs.mdx +++ b/website/pages/docs/builders/amazon/ebs.mdx @@ -101,7 +101,13 @@ Block devices can be nested in the @include 'helper/communicator/SSH-not-required.mdx' -@include 'helper/communicator/SSH-Key-Pair-not-required.mdx' +@include 'helper/communicator/SSH-Temporary-Key-Pair-not-required.mdx' + +@include 'helper/communicator/SSH-Key-Pair-Name-not-required.mdx' + +@include 'helper/communicator/SSH-Private-Key-File-not-required.mdx' + +@include 'helper/communicator/SSH-Agent-Auth-not-required.mdx' ## Basic Example diff --git a/website/pages/docs/builders/amazon/ebssurrogate.mdx b/website/pages/docs/builders/amazon/ebssurrogate.mdx index 1fe903e4d..bb02f5636 100644 --- a/website/pages/docs/builders/amazon/ebssurrogate.mdx +++ b/website/pages/docs/builders/amazon/ebssurrogate.mdx @@ -100,7 +100,13 @@ Block devices can be nested in the @include 'helper/communicator/SSH-not-required.mdx' -@include 'helper/communicator/SSH-Key-Pair-not-required.mdx' +@include 'helper/communicator/SSH-Temporary-Key-Pair-not-required.mdx' + +@include 'helper/communicator/SSH-Key-Pair-Name-not-required.mdx' + +@include 'helper/communicator/SSH-Private-Key-File-not-required.mdx' + +@include 'helper/communicator/SSH-Agent-Auth-not-required.mdx' ## Basic Example diff --git a/website/pages/docs/builders/amazon/ebsvolume.mdx b/website/pages/docs/builders/amazon/ebsvolume.mdx index 3708a5c9c..e4e49720a 100644 --- a/website/pages/docs/builders/amazon/ebsvolume.mdx +++ b/website/pages/docs/builders/amazon/ebsvolume.mdx @@ -104,7 +104,13 @@ Block devices can be nested in the @include 'helper/communicator/SSH-not-required.mdx' -@include 'helper/communicator/SSH-Key-Pair-not-required.mdx' +@include 'helper/communicator/SSH-Temporary-Key-Pair-not-required.mdx' + +@include 'helper/communicator/SSH-Key-Pair-Name-not-required.mdx' + +@include 'helper/communicator/SSH-Private-Key-File-not-required.mdx' + +@include 'helper/communicator/SSH-Agent-Auth-not-required.mdx' ## Basic Example diff --git a/website/pages/docs/builders/amazon/instance.mdx b/website/pages/docs/builders/amazon/instance.mdx index 5aa4ba7ad..f8e1083a2 100644 --- a/website/pages/docs/builders/amazon/instance.mdx +++ b/website/pages/docs/builders/amazon/instance.mdx @@ -117,7 +117,13 @@ Block devices can be nested in the @include 'helper/communicator/SSH-not-required.mdx' -@include 'helper/communicator/SSH-Key-Pair-not-required.mdx' +@include 'helper/communicator/SSH-Temporary-Key-Pair-not-required.mdx' + +@include 'helper/communicator/SSH-Key-Pair-Name-not-required.mdx' + +@include 'helper/communicator/SSH-Private-Key-File-not-required.mdx' + +@include 'helper/communicator/SSH-Agent-Auth-not-required.mdx' ## Basic Example diff --git a/website/pages/docs/builders/openstack.mdx b/website/pages/docs/builders/openstack.mdx index 5a6f57ab2..336b5135d 100644 --- a/website/pages/docs/builders/openstack.mdx +++ b/website/pages/docs/builders/openstack.mdx @@ -79,7 +79,13 @@ builder. @include 'helper/communicator/SSH-not-required.mdx' -@include 'helper/communicator/SSH-Key-Pair-not-required.mdx' +@include 'helper/communicator/SSH-Temporary-Key-Pair-not-required.mdx' + +@include 'helper/communicator/SSH-Key-Pair-Name-not-required.mdx' + +@include 'helper/communicator/SSH-Private-Key-File-not-required.mdx' + +@include 'helper/communicator/SSH-Agent-Auth-not-required.mdx' @include 'helper/communicator/SSHInterface-not-required.mdx' diff --git a/website/pages/docs/builders/virtualbox/iso.mdx b/website/pages/docs/builders/virtualbox/iso.mdx index a2bbf9e44..05d14c717 100644 --- a/website/pages/docs/builders/virtualbox/iso.mdx +++ b/website/pages/docs/builders/virtualbox/iso.mdx @@ -172,7 +172,13 @@ necessary for this build to succeed and can be found further down the page. @include 'helper/communicator/SSH-not-required.mdx' -@include 'helper/communicator/SSH-Key-Pair-not-required.mdx' +@include 'helper/communicator/SSH-Temporary-Key-Pair-not-required.mdx' + +@include 'helper/communicator/SSH-Key-Pair-Name-not-required.mdx' + +@include 'helper/communicator/SSH-Private-Key-File-not-required.mdx' + +@include 'helper/communicator/SSH-Agent-Auth-not-required.mdx' #### Optional WinRM fields: diff --git a/website/pages/docs/builders/virtualbox/ovf.mdx b/website/pages/docs/builders/virtualbox/ovf.mdx index 57b874c91..6f253faf4 100644 --- a/website/pages/docs/builders/virtualbox/ovf.mdx +++ b/website/pages/docs/builders/virtualbox/ovf.mdx @@ -159,7 +159,13 @@ necessary for this build to succeed and can be found further down the page. @include 'helper/communicator/SSH-not-required.mdx' -@include 'helper/communicator/SSH-Key-Pair-not-required.mdx' +@include 'helper/communicator/SSH-Temporary-Key-Pair-not-required.mdx' + +@include 'helper/communicator/SSH-Key-Pair-Name-not-required.mdx' + +@include 'helper/communicator/SSH-Private-Key-File-not-required.mdx' + +@include 'helper/communicator/SSH-Agent-Auth-not-required.mdx' #### Optional WinRM fields: diff --git a/website/pages/docs/builders/virtualbox/vm.mdx b/website/pages/docs/builders/virtualbox/vm.mdx index 464f04dd7..12ac15401 100644 --- a/website/pages/docs/builders/virtualbox/vm.mdx +++ b/website/pages/docs/builders/virtualbox/vm.mdx @@ -182,8 +182,6 @@ builder. @include 'helper/communicator/SSH-not-required.mdx' -@include 'helper/communicator/SSH-Key-Pair-not-required.mdx' - #### Optional WinRM fields: @include 'helper/communicator/WinRM-not-required.mdx' diff --git a/website/pages/partials/helper/communicator/SSH-Agent-Auth-not-required.mdx b/website/pages/partials/helper/communicator/SSH-Agent-Auth-not-required.mdx new file mode 100644 index 000000000..3039120dd --- /dev/null +++ b/website/pages/partials/helper/communicator/SSH-Agent-Auth-not-required.mdx @@ -0,0 +1,7 @@ + +- `ssh_agent_auth` (bool) - If true, the local SSH agent will be used to authenticate connections to + the source instance. No temporary keypair will be created, and the + values of [`ssh_password`](#ssh_password) and + [`ssh_private_key_file`](#ssh_private_key_file) will be ignored. The + environment variable `SSH_AUTH_SOCK` must be set for this option to work + properly. diff --git a/website/pages/partials/helper/communicator/SSH-Key-Pair-Name-not-required.mdx b/website/pages/partials/helper/communicator/SSH-Key-Pair-Name-not-required.mdx new file mode 100644 index 000000000..2bb1ecc51 --- /dev/null +++ b/website/pages/partials/helper/communicator/SSH-Key-Pair-Name-not-required.mdx @@ -0,0 +1,9 @@ + +- `ssh_keypair_name` (string) - If specified, this is the key that will be used for SSH with the + machine. The key must match a key pair name loaded up into the remote. + By default, this is blank, and Packer will generate a temporary keypair + unless [`ssh_password`](#ssh_password) is used. + [`ssh_private_key_file`](#ssh_private_key_file) or + [`ssh_agent_auth`](#ssh_agent_auth) must be specified when + [`ssh_keypair_name`](#ssh_keypair_name) is utilized. + diff --git a/website/pages/partials/helper/communicator/SSH-Key-Pair-not-required.mdx b/website/pages/partials/helper/communicator/SSH-Key-Pair-not-required.mdx deleted file mode 100644 index a2be645da..000000000 --- a/website/pages/partials/helper/communicator/SSH-Key-Pair-not-required.mdx +++ /dev/null @@ -1,23 +0,0 @@ - -- `temporary_key_pair_name` (string) - The name of the temporary key pair to generate. By default, Packer - generates a name that looks like `packer_`, where <UUID> is - a 36 character unique identifier. - -- `ssh_keypair_name` (string) - If specified, this is the key that will be used for SSH with the - machine. The key must match a key pair name loaded up into the remote. - By default, this is blank, and Packer will generate a temporary keypair - unless [`ssh_password`](#ssh_password) is used. - [`ssh_private_key_file`](#ssh_private_key_file) or - [`ssh_agent_auth`](#ssh_agent_auth) must be specified when - [`ssh_keypair_name`](#ssh_keypair_name) is utilized. - -- `ssh_private_key_file` (string) - Path to a PEM encoded private key file to use to authenticate with SSH. - The `~` can be used in path and will be expanded to the home directory - of current user. - -- `ssh_agent_auth` (bool) - If true, the local SSH agent will be used to authenticate connections to - the source instance. No temporary keypair will be created, and the - values of [`ssh_password`](#ssh_password) and - [`ssh_private_key_file`](#ssh_private_key_file) will be ignored. The - environment variable `SSH_AUTH_SOCK` must be set for this option to work - properly. diff --git a/website/pages/partials/helper/communicator/SSH-Private-Key-File-not-required.mdx b/website/pages/partials/helper/communicator/SSH-Private-Key-File-not-required.mdx new file mode 100644 index 000000000..92d185f36 --- /dev/null +++ b/website/pages/partials/helper/communicator/SSH-Private-Key-File-not-required.mdx @@ -0,0 +1,4 @@ + +- `ssh_private_key_file` (string) - Path to a PEM encoded private key file to use to authenticate with SSH. + The `~` can be used in path and will be expanded to the home directory + of current user. diff --git a/website/pages/partials/helper/communicator/SSH-Temporary-Key-Pair-not-required.mdx b/website/pages/partials/helper/communicator/SSH-Temporary-Key-Pair-not-required.mdx new file mode 100644 index 000000000..133f946de --- /dev/null +++ b/website/pages/partials/helper/communicator/SSH-Temporary-Key-Pair-not-required.mdx @@ -0,0 +1,4 @@ + +- `temporary_key_pair_name` (string) - The name of the temporary key pair to generate. By default, Packer + generates a name that looks like `packer_`, where <UUID> is + a 36 character unique identifier. From 284d46a1e0e3c54bbdf8bca399e7e716849c22be Mon Sep 17 00:00:00 2001 From: Adrien Delorme Date: Thu, 2 Jul 2020 15:56:49 +0200 Subject: [PATCH 05/38] WIP --- hcl2template/internal/mock.go | 2 +- hcl2template/testdata/complete/build.pkr.hcl | 2 +- hcl2template/types.packer_config.go | 26 +++++++++++--------- 3 files changed, 16 insertions(+), 14 deletions(-) diff --git a/hcl2template/internal/mock.go b/hcl2template/internal/mock.go index 3c36528f3..bf746ed5c 100644 --- a/hcl2template/internal/mock.go +++ b/hcl2template/internal/mock.go @@ -74,7 +74,7 @@ var _ packer.Builder = new(MockBuilder) func (b *MockBuilder) ConfigSpec() hcldec.ObjectSpec { return b.Config.FlatMapstructure().HCL2Spec() } func (b *MockBuilder) Prepare(raws ...interface{}) ([]string, []string, error) { - return nil, nil, b.Config.Prepare(raws...) + return []string{"ID"}, nil, b.Config.Prepare(raws...) } func (b *MockBuilder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (packer.Artifact, error) { diff --git a/hcl2template/testdata/complete/build.pkr.hcl b/hcl2template/testdata/complete/build.pkr.hcl index d26ecb4ed..ef73e65f9 100644 --- a/hcl2template/testdata/complete/build.pkr.hcl +++ b/hcl2template/testdata/complete/build.pkr.hcl @@ -11,7 +11,7 @@ build { provisioner "shell" { name = "provisioner that does something" - not_squashed = var.foo + not_squashed = "${var.foo} ${lower(build.ID)}" string = "string" int = "${41 + 1}" int64 = "${42 + 1}" diff --git a/hcl2template/types.packer_config.go b/hcl2template/types.packer_config.go index 2758c5ed1..3908c91fe 100644 --- a/hcl2template/types.packer_config.go +++ b/hcl2template/types.packer_config.go @@ -51,6 +51,7 @@ const ( inputVariablesAccessor = "var" localsAccessor = "local" sourcesAccessor = "source" + buildAccessor = "build" ) // EvalContext returns the *hcl.EvalContext that will be passed to an hcl @@ -354,24 +355,25 @@ func (cfg *PackerConfig) GetBuilds(opts packer.GetBuildsOptions) ([]packer.Build continue } - variables := map[string]cty.Value{ - sourcesAccessor: cty.ObjectVal(map[string]cty.Value{ - "type": cty.StringVal(src.Type), - "name": cty.StringVal(src.Name), - }), - } - // If the builder has provided a list of to-be-generated variables that // should be made accessible to provisioners, pass that list into // the provisioner prepare() so that the provisioner can appropriately // validate user input against what will become available. Otherwise, // only pass the default variables, using the basic placeholder data. generatedPlaceholderMap := packer.BasicPlaceholderData() - if generatedVars != nil { - for _, k := range generatedVars { - generatedPlaceholderMap[k] = fmt.Sprintf("Build_%s. "+ - common.PlaceholderMsg, k) - } + unknownBuildValues := map[string]cty.Value{} + for _, k := range generatedVars { + generatedPlaceholderMap[k] = fmt.Sprintf("Build_%s. "+ + common.PlaceholderMsg, k) + unknownBuildValues[k] = cty.StringVal("") + } + + variables := map[string]cty.Value{ + sourcesAccessor: cty.ObjectVal(map[string]cty.Value{ + "type": cty.StringVal(src.Type), + "name": cty.StringVal(src.Name), + }), + buildAccessor: cty.ObjectVal(unknownBuildValues), } provisioners, moreDiags := cfg.getCoreBuildProvisioners(src, build.ProvisionerBlocks, cfg.EvalContext(variables), generatedPlaceholderMap) From 6a108fa3f6c30d943835a9b5bb8772954d9210cd Mon Sep 17 00:00:00 2001 From: Adrien Delorme Date: Thu, 2 Jul 2020 16:03:23 +0200 Subject: [PATCH 06/38] bring docs from master --- website/data/docs-navigation.js | 1 + website/pages/docs/builders/amazon/chroot.mdx | 45 +++++++++++- website/pages/docs/builders/amazon/ebs.mdx | 41 ++++++++++- .../docs/builders/amazon/ebssurrogate.mdx | 41 ++++++++++- .../pages/docs/builders/amazon/ebsvolume.mdx | 41 ++++++++++- .../pages/docs/builders/amazon/instance.mdx | 41 ++++++++++- .../from-1.5/blocks/build/post-processor.mdx | 5 ++ .../from-1.5/blocks/build/provisioner.mdx | 7 +- .../docs/from-1.5/contextual-variables.mdx | 71 +++++++++++++++++++ website/pages/docs/templates/engine.mdx | 16 +++-- 10 files changed, 288 insertions(+), 21 deletions(-) create mode 100644 website/pages/docs/from-1.5/contextual-variables.mdx diff --git a/website/data/docs-navigation.js b/website/data/docs-navigation.js index a05fe8525..0669763f6 100644 --- a/website/data/docs-navigation.js +++ b/website/data/docs-navigation.js @@ -140,6 +140,7 @@ export default [ }, 'variables', 'locals', + 'contextual-variables', 'syntax', 'onlyexcept', 'expressions', diff --git a/website/pages/docs/builders/amazon/chroot.mdx b/website/pages/docs/builders/amazon/chroot.mdx index d5165d6f3..7bf474b22 100644 --- a/website/pages/docs/builders/amazon/chroot.mdx +++ b/website/pages/docs/builders/amazon/chroot.mdx @@ -328,13 +328,52 @@ variables are available: - `SourceAMIOwnerName` - The source AMI owner alias/name (for example `amazon`). - `SourceAMITags` - The source AMI Tags, as a `map[string]string` object. -## Build function template engine variables +## Build Shared Information Variables -For the build function of [template engine](/docs/templates/engine), the following -variables are available: +This builder generates data that are shared with provisioner and post-processor via build function of [template engine](/docs/templates/engine) for JSON and [contextual variables](/docs/from-1.5/contextual-variables) for HCL2. + +The generated variables available for this builder are: - `SourceAMIName` - The source AMI Name (for example `ubuntu/images/ebs-ssd/ubuntu-xenial-16.04-amd64-server-20180306`) used to build the AMI. - `Device` - Root device path. - `MountPath` - Device mounting path. + +Usage example: + + + + +```json +"post-processors": [ + { + "type": "manifest", + "output": "manifest.json", + "strip_path": true, + "custom_data": { + "source_ami_name": "{{ build `SourceAMIName` }}", + "device": "{{ build `Device` }}", + "mount_path": "{{ build `MountPath` }}" + } + } +] +``` + + + + +```hcl +post-processor "manifest" { + output = "manifest.json" + strip_path = true + custom_data = { + source_ami_name = "${build.SourceAMIName}" + device = "${build.Device}" + mount_path = "${build.MountPath}" + } +} +``` + + + diff --git a/website/pages/docs/builders/amazon/ebs.mdx b/website/pages/docs/builders/amazon/ebs.mdx index 351f97915..e0db95037 100644 --- a/website/pages/docs/builders/amazon/ebs.mdx +++ b/website/pages/docs/builders/amazon/ebs.mdx @@ -235,15 +235,50 @@ variables are available: - `SourceAMIOwnerName` - The source AMI owner alias/name (for example `amazon`). - `SourceAMITags` - The source AMI Tags, as a `map[string]string` object. -## Build function template engine variables +## Build Shared Information Variables -For the build function of [template engine](/docs/templates/engine), the following -variables are available: +This builder generates data that are shared with provisioner and post-processor via build function of [template engine](/docs/templates/engine) for JSON and [contextual variables](/docs/from-1.5/contextual-variables) for HCL2. + +The generated variables available for this builder are: - `SourceAMIName` - The source AMI Name (for example `ubuntu/images/ebs-ssd/ubuntu-xenial-16.04-amd64-server-20180306`) used to build the AMI. +Usage example: + + + + +```json +"post-processors": [ + { + "type": "manifest", + "output": "manifest.json", + "strip_path": true, + "custom_data": { + "source_ami_name": "{{ build `SourceAMIName` }}" + } + } +] +``` + + + + +```hcl +post-processor "manifest" { + output = "manifest.json" + strip_path = true + custom_data = { + source_ami_name = "${build.SourceAMIName}" + } +} +``` + + + + ## Tag Example Here is an example using the optional AMI tags. This will add the tags diff --git a/website/pages/docs/builders/amazon/ebssurrogate.mdx b/website/pages/docs/builders/amazon/ebssurrogate.mdx index deb506e13..529db51e0 100644 --- a/website/pages/docs/builders/amazon/ebssurrogate.mdx +++ b/website/pages/docs/builders/amazon/ebssurrogate.mdx @@ -207,15 +207,50 @@ variables are available: - `SourceAMIOwnerName` - The source AMI owner alias/name (for example `amazon`). - `SourceAMITags` - The source AMI Tags, as a `map[string]string` object. -## Build function template engine variables +## Build Shared Information Variables -For the build function of [template engine](/docs/templates/engine), the following -variables are available: +This builder generates data that are shared with provisioner and post-processor via build function of [template engine](/docs/templates/engine) for JSON and [contextual variables](/docs/from-1.5/contextual-variables) for HCL2. + +The generated variables available for this builder are: - `SourceAMIName` - The source AMI Name (for example `ubuntu/images/ebs-ssd/ubuntu-xenial-16.04-amd64-server-20180306`) used to build the AMI. +Usage example: + + + + +```json +"post-processors": [ + { + "type": "manifest", + "output": "manifest.json", + "strip_path": true, + "custom_data": { + "source_ami_name": "{{ build `SourceAMIName` }}" + } + } +] +``` + + + + +```hcl +post-processor "manifest" { + output = "manifest.json" + strip_path = true + custom_data = { + source_ami_name = "${build.SourceAMIName}" + } +} +``` + + + + -> **Note:** Packer uses pre-built AMIs as the source for building images. These source AMIs may include volumes that are not flagged to be destroyed on termination of the instance building the new image. In addition to those diff --git a/website/pages/docs/builders/amazon/ebsvolume.mdx b/website/pages/docs/builders/amazon/ebsvolume.mdx index 1b5b6aabc..4e25e3dcf 100644 --- a/website/pages/docs/builders/amazon/ebsvolume.mdx +++ b/website/pages/docs/builders/amazon/ebsvolume.mdx @@ -243,13 +243,48 @@ termination of the instance building the new image. In addition to those volumes created by this builder, any volumes in the source AMI which are not marked for deletion on termination will remain in your account. -## Build function template engine variables +## Build Shared Information Variables -For the build function of [template engine](/docs/templates/engine), the following -variables are available: +This builder generates data that are shared with provisioner and post-processor via build function of [template engine](/docs/templates/engine) for JSON and [contextual variables](/docs/from-1.5/contextual-variables) for HCL2. + +The generated variables available for this builder are: - `SourceAMIName` - The source AMI Name (for example `ubuntu/images/ebs-ssd/ubuntu-xenial-16.04-amd64-server-20180306`) used to build the AMI. +Usage example: + + + + +```json +"post-processors": [ + { + "type": "manifest", + "output": "manifest.json", + "strip_path": true, + "custom_data": { + "source_ami_name": "{{ build `SourceAMIName` }}" + } + } +] +``` + + + + +```hcl +post-processor "manifest" { + output = "manifest.json" + strip_path = true + custom_data = { + source_ami_name = "${build.SourceAMIName}" + } +} +``` + + + + @include 'builders/aws-ssh-differentiation-table.mdx' diff --git a/website/pages/docs/builders/amazon/instance.mdx b/website/pages/docs/builders/amazon/instance.mdx index 69410bbcf..9abf80da1 100644 --- a/website/pages/docs/builders/amazon/instance.mdx +++ b/website/pages/docs/builders/amazon/instance.mdx @@ -199,15 +199,50 @@ variables are available: - `SourceAMIOwnerName` - The source AMI owner alias/name (for example `amazon`). - `SourceAMITags` - The source AMI Tags, as a `map[string]string` object. -## Build function template engine variables +## Build Shared Information Variables -For the build function of [template engine](/docs/templates/engine), the following -variables are available: +This builder generates data that are shared with provisioner and post-processor via build function of [template engine](/docs/templates/engine) for JSON and [contextual variables](/docs/from-1.5/contextual-variables) for HCL2. + +The generated variables available for this builder are: - `SourceAMIName` - The source AMI Name (for example `ubuntu/images/ebs-ssd/ubuntu-xenial-16.04-amd64-server-20180306`) used to build the AMI. +Usage example: + + + + +```json +"post-processors": [ + { + "type": "manifest", + "output": "manifest.json", + "strip_path": true, + "custom_data": { + "source_ami_name": "{{ build `SourceAMIName` }}" + } + } +] +``` + + + + +```hcl +post-processor "manifest" { + output = "manifest.json" + strip_path = true + custom_data = { + source_ami_name = "${build.SourceAMIName}" + } +} +``` + + + + ## Custom Bundle Commands A lot of the process required for creating an instance-store backed AMI diff --git a/website/pages/docs/from-1.5/blocks/build/post-processor.mdx b/website/pages/docs/from-1.5/blocks/build/post-processor.mdx index 47fccaabb..cb94f1ef9 100644 --- a/website/pages/docs/from-1.5/blocks/build/post-processor.mdx +++ b/website/pages/docs/from-1.5/blocks/build/post-processor.mdx @@ -71,3 +71,8 @@ build { ``` The values within `only` or `except` are _source names_, not builder types. + +## Build Contextual Variables + +Packer allows to access connection information and basic instance state information from a post-processor. These information are stored in the `build` variable. +Check out the [Contextual Variables](/docs/from-1.5/contextual-variables) documentation to learn more about and see some examples of how to use them. diff --git a/website/pages/docs/from-1.5/blocks/build/provisioner.mdx b/website/pages/docs/from-1.5/blocks/build/provisioner.mdx index 0c06e36f8..5ab488405 100644 --- a/website/pages/docs/from-1.5/blocks/build/provisioner.mdx +++ b/website/pages/docs/from-1.5/blocks/build/provisioner.mdx @@ -59,7 +59,7 @@ build { ] provisioner "shell" { # This provisioner only runs for the 'first-example' source. - only = ["source.amazon-ebs.first-example"] + only = ["source.amazon-ebs.first-example"] inline = [ "echo provisioning all the things", @@ -160,3 +160,8 @@ For the above provisioner, Packer will cancel the script if it takes more than 5 minutes. Timeout has no effect in debug mode. + +## Build Contextual Variables + +Packer allows to access connection information and basic instance state information from a provisioner. These information are stored in the `build` variable. +Check out the [Contextual Variables](/docs/from-1.5/contextual-variables) documentation to learn more about and see some examples of how to use them. diff --git a/website/pages/docs/from-1.5/contextual-variables.mdx b/website/pages/docs/from-1.5/contextual-variables.mdx new file mode 100644 index 000000000..48c91472d --- /dev/null +++ b/website/pages/docs/from-1.5/contextual-variables.mdx @@ -0,0 +1,71 @@ +--- +layout: docs +page_title: Contextual Variables - HCL Configuration Language +sidebar_title: Contextual Variables +description: |- + Special variables provide connection information and basic instance state information. + This page covers all existing special variables. +--- + +# Build Variables + +`@include 'from-1.5/beta-hcl2-note.mdx'` + +Build variables will allow you to access connection information and basic instance state information for a builder. +All special build variables are stored in the `build` variable: + +```hcl + provisioner "shell" { + environment_vars = ["TESTVAR=${build.PackerRunUUID}"] + inline = ["echo $TESTVAR"] + } +``` + +Here is the list of available build variables: + +- **ID**: Represents the vm being provisioned. For example, in Amazon it is the instance id; in digitalocean, + it is the droplet id; in Vmware, it is the vm name. + +- **Host**, **Port**, **User** and **Password**: The host, port, user, and password that Packer uses to access the machine. + Useful for using the shell local provisioner to run Ansible or Inspec against the provisioned instance. + +- **ConnType**: Type of communicator being used. For example, for SSH communicator this will be "ssh". + +- **PackerRunUUID**: Current build's unique id. Can be used to specify build artifacts. + An example of that, is when multiple builds runs at the same time producing the same artifact. + It's possible to differentiate these artifacts by naming them with the builds' unique ids. + +- **PackerHTTPIP**, **PackerHTTPPort**, and **PackerHTTPAddr**: HTTP IP, port, and address of the file server Packer creates to serve items in the "http" dir to the vm. The HTTP address is displayed in the format `IP:PORT`. + +- **SSHPublicKey** and **SSHPrivateKey**: The public and private key that Packer uses to connect to the instance. + These are unique to the SSH communicator and are unset when using other communicators. + **SSHPublicKey** and **SSHPrivateKey** can have escape sequences and special characters so their output should be single quoted to avoid surprises. For example: + + ```hcl + provisioner "shell" { + inline = ["echo '${build.SSHPrivateKey}' > /tmp/packer-session.pem"] + } + ``` + +For backwards compatibility, `WinRMPassword` is also available through this +engine, though it is no different than using the more general `Password`. + +All build variables are valid to use with any of the [HCL2 functions](/docs/from-1.5/functions). +Example of using [upper](/docs/from-1.5/functions/string/upper) to upper case the build ID: + +```hcl + post-processor "shell-local" { + inline = ["echo ${upper(build.ID)}"] + } +``` + +For builder-specific builder variables, please also refer to the builder docs: + + - Amazon EC2: [chroot](/docs/builders/amazon/chroot#build-shared-information-variables), + [EBS Volume](/docs/builders/amazon/ebsvolume#build-shared-information-variables), + [EBS](/docs/builders/amazon/ebs#build-shared-information-variables), + [EBS Surrogate](/docs/builders/amazon/ebssurrogate#build-shared-information-variables), + [Instance](/docs/builders/amazon/instance#build-shared-information-variables). + +The HCL2 Special Build Variables is in beta; please report any issues or requests on the Packer +issue tracker on GitHub. diff --git a/website/pages/docs/templates/engine.mdx b/website/pages/docs/templates/engine.mdx index ebf50fd2e..11ec5f9f2 100644 --- a/website/pages/docs/templates/engine.mdx +++ b/website/pages/docs/templates/engine.mdx @@ -83,6 +83,8 @@ Here is a full list of the available functions for reference. - **ConnType**: Type of communicator being used. For example, for SSH communicator this will be "ssh". - **PackerRunUUID**: Current build's unique id. Can be used to specify build artifacts. + An example of that, is when multiple builds runs at the same time producing the same artifact. + It's possible to differentiate these artifacts by naming them with the builds' unique ids. - **PackerHTTPIP**, **PackerHTTPPort**, and **PackerHTTPAddr**: HTTP IP, port, and address of the file server Packer creates to serve items in the "http" dir to the vm. The HTTP address is displayed in the format `IP:PORT`. @@ -98,16 +100,20 @@ Here is a full list of the available functions for reference. } ``` - For backwards compatability, `WinRMPassword` is also available through this + For backwards compatibility, `WinRMPassword` is also available through this engine, though it is no different than using the more general `Password`. This function is only for use within specific options inside of _provisioners_ -- these options will be listed as being template engines - in the provisioner documentation. This feature does not yet work - if the provisioners are being used in conjunction with our chroot builders - or with lxc/lxd builders. + in the provisioner documentation. - For builder-specific engine variables, please also refer to the builder docs. + For builder-specific builder variables, please also refer to the builder docs: + + - Amazon EC2: [chroot](/docs/builders/amazon/chroot#build-shared-information-variables), + [EBS Volume](/docs/builders/amazon/ebsvolume#build-shared-information-variables), + [EBS](/docs/builders/amazon/ebs#build-shared-information-variables), + [EBS Surrogate](/docs/builders/amazon/ebssurrogate#build-shared-information-variables), + [Instance](/docs/builders/amazon/instance#build-shared-information-variables). This engine is in beta; please report any issues or requests on the Packer issue tracker on GitHub. From c88cb098a167f3005919eb87421c4c6c00481a1f Mon Sep 17 00:00:00 2001 From: Adrien Delorme Date: Thu, 2 Jul 2020 16:04:38 +0200 Subject: [PATCH 07/38] Update post-processor.go --- post-processor/shell-local/post-processor.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/post-processor/shell-local/post-processor.go b/post-processor/shell-local/post-processor.go index 0cbf9fe71..a17ce67e3 100644 --- a/post-processor/shell-local/post-processor.go +++ b/post-processor/shell-local/post-processor.go @@ -42,9 +42,9 @@ func (p *PostProcessor) Configure(raws ...interface{}) error { func (p *PostProcessor) PostProcess(ctx context.Context, ui packer.Ui, artifact packer.Artifact) (packer.Artifact, bool, bool, error) { generatedData := make(map[string]interface{}) - artifactSateData := artifact.State("generated_data") - if artifactSateData != nil { - for k, v := range artifactSateData.(map[interface{}]interface{}) { + artifactStateData := artifact.State("generated_data") + if artifactStateData != nil { + for k, v := range artifactStateData.(map[interface{}]interface{}) { generatedData[k.(string)] = v } } From db6c3adbbaaf90090ed1c7a86b629c6c7ee42ee0 Mon Sep 17 00:00:00 2001 From: Adrien Delorme Date: Thu, 2 Jul 2020 18:02:19 +0200 Subject: [PATCH 08/38] add hcl2 provisioner type that reprepares itself --- hcl2template/common_test.go | 3 +- hcl2template/testdata/complete/build.pkr.hcl | 4 +- hcl2template/types.build.post-processor.go | 4 +- hcl2template/types.build.provisioners.go | 21 +++---- hcl2template/types.build_test.go | 40 ++++++++----- hcl2template/types.hcl_provisioner.go | 61 ++++++++++++++++++++ hcl2template/types.packer_config.go | 12 ++-- hcl2template/types.packer_config_test.go | 30 +++++++--- packer/provisioner.go | 4 +- 9 files changed, 129 insertions(+), 50 deletions(-) create mode 100644 hcl2template/types.hcl_provisioner.go diff --git a/hcl2template/common_test.go b/hcl2template/common_test.go index 5db6dc6c2..610e178ce 100644 --- a/hcl2template/common_test.go +++ b/hcl2template/common_test.go @@ -129,6 +129,7 @@ func testParse(t *testing.T, tests []parseTest) { packer.CoreBuildProvisioner{}, packer.CoreBuildPostProcessor{}, null.Builder{}, + HCL2Provisioner{}, ), ); diff != "" { t.Fatalf("Parser.getBuilds() wrong packer builds. %s", diff) @@ -176,7 +177,7 @@ var ( basicMockProvisioner = &MockProvisioner{ Config: MockConfig{ - NotSquashed: "value", + NotSquashed: "value ", NestedMockConfig: basicNestedMockConfig, Nested: basicNestedMockConfig, NestedSlice: []NestedMockConfig{ diff --git a/hcl2template/testdata/complete/build.pkr.hcl b/hcl2template/testdata/complete/build.pkr.hcl index ef73e65f9..5d6745a01 100644 --- a/hcl2template/testdata/complete/build.pkr.hcl +++ b/hcl2template/testdata/complete/build.pkr.hcl @@ -11,7 +11,7 @@ build { provisioner "shell" { name = "provisioner that does something" - not_squashed = "${var.foo} ${lower(build.ID)}" + not_squashed = "${var.foo} ${upper(build.ID)}" string = "string" int = "${41 + 1}" int64 = "${42 + 1}" @@ -62,7 +62,7 @@ build { } provisioner "file" { - not_squashed = "${var.foo}" + not_squashed = "${var.foo} ${upper(build.ID)}" string = "string" int = 42 int64 = 43 diff --git a/hcl2template/types.build.post-processor.go b/hcl2template/types.build.post-processor.go index b45b682f5..f80b40ecf 100644 --- a/hcl2template/types.build.post-processor.go +++ b/hcl2template/types.build.post-processor.go @@ -61,7 +61,7 @@ func (p *Parser) decodePostProcessor(block *hcl.Block) (*PostProcessorBlock, hcl return postProcessor, diags } -func (cfg *PackerConfig) startPostProcessor(source SourceBlock, pp *PostProcessorBlock, ectx *hcl.EvalContext, generatedVars map[string]string) (packer.PostProcessor, hcl.Diagnostics) { +func (cfg *PackerConfig) startPostProcessor(source SourceBlock, pp *PostProcessorBlock, ectx *hcl.EvalContext, generatedVars map[string]interface{}) (packer.PostProcessor, hcl.Diagnostics) { // ProvisionerBlock represents a detected but unparsed provisioner var diags hcl.Diagnostics @@ -76,7 +76,7 @@ func (cfg *PackerConfig) startPostProcessor(source SourceBlock, pp *PostProcesso } flatProvisinerCfg, moreDiags := decodeHCL2Spec(pp.Rest, ectx, postProcessor) diags = append(diags, moreDiags...) - err = postProcessor.Configure(source.builderVariables(), flatProvisinerCfg, generatedVars) + err = postProcessor.Configure(source.builderVariables(), flatProvisinerCfg) if err != nil { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, diff --git a/hcl2template/types.build.provisioners.go b/hcl2template/types.build.provisioners.go index 70756f39e..19b699155 100644 --- a/hcl2template/types.build.provisioners.go +++ b/hcl2template/types.build.provisioners.go @@ -132,7 +132,7 @@ func (p *Parser) decodeProvisioner(block *hcl.Block) (*ProvisionerBlock, hcl.Dia return provisioner, diags } -func (cfg *PackerConfig) startProvisioner(source SourceBlock, pb *ProvisionerBlock, ectx *hcl.EvalContext, generatedVars map[string]string) (packer.Provisioner, hcl.Diagnostics) { +func (cfg *PackerConfig) startProvisioner(source SourceBlock, pb *ProvisionerBlock, ectx *hcl.EvalContext, generatedVars map[string]interface{}) (packer.Provisioner, hcl.Diagnostics) { var diags hcl.Diagnostics provisioner, err := cfg.provisionersSchemas.Start(pb.PType) @@ -144,18 +144,13 @@ func (cfg *PackerConfig) startProvisioner(source SourceBlock, pb *ProvisionerBlo }) return nil, diags } - flatProvisionerCfg, moreDiags := decodeHCL2Spec(pb.HCL2Ref.Rest, ectx, provisioner) - diags = append(diags, moreDiags...) - if diags.HasErrors() { - return nil, diags + p := &HCL2Provisioner{ + Provisioner: provisioner, + provisionerBlock: pb, + evalContext: ectx, + builderVariables: source.builderVariables(), } - // manipulate generatedVars from builder to add to the interfaces being - // passed to the provisioner Prepare() - - // configs := make([]interface{}, 2) - // configs = append(, flatProvisionerCfg) - // configs = append(configs, generatedVars) - err = provisioner.Prepare(source.builderVariables(), flatProvisionerCfg, generatedVars) + err = p.HCL2Prepare(generatedVars) if err != nil { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, @@ -165,5 +160,5 @@ func (cfg *PackerConfig) startProvisioner(source SourceBlock, pb *ProvisionerBlo }) return nil, diags } - return provisioner, diags + return p, diags } diff --git a/hcl2template/types.build_test.go b/hcl2template/types.build_test.go index c3d5dc9e5..f7a69e844 100644 --- a/hcl2template/types.build_test.go +++ b/hcl2template/types.build_test.go @@ -266,19 +266,23 @@ func TestParse_build(t *testing.T) { Provisioners: []packer.CoreBuildProvisioner{ { PType: "shell", - Provisioner: &MockProvisioner{ - Config: MockConfig{ - NestedMockConfig: NestedMockConfig{Tags: []MockTag{}}, - NestedSlice: []NestedMockConfig{}, + Provisioner: &HCL2Provisioner{ + Provisioner: &MockProvisioner{ + Config: MockConfig{ + NestedMockConfig: NestedMockConfig{Tags: []MockTag{}}, + NestedSlice: []NestedMockConfig{}, + }, }, }, }, { PType: "file", - Provisioner: &MockProvisioner{ - Config: MockConfig{ - NestedMockConfig: NestedMockConfig{Tags: []MockTag{}}, - NestedSlice: []NestedMockConfig{}, + Provisioner: &HCL2Provisioner{ + Provisioner: &MockProvisioner{ + Config: MockConfig{ + NestedMockConfig: NestedMockConfig{Tags: []MockTag{}}, + NestedSlice: []NestedMockConfig{}, + }, }, }, }, @@ -292,19 +296,23 @@ func TestParse_build(t *testing.T) { Provisioners: []packer.CoreBuildProvisioner{ { PType: "file", - Provisioner: &MockProvisioner{ - Config: MockConfig{ - NestedMockConfig: NestedMockConfig{Tags: []MockTag{}}, - NestedSlice: []NestedMockConfig{}, + Provisioner: &HCL2Provisioner{ + Provisioner: &MockProvisioner{ + Config: MockConfig{ + NestedMockConfig: NestedMockConfig{Tags: []MockTag{}}, + NestedSlice: []NestedMockConfig{}, + }, }, }, }, { PType: "shell", - Provisioner: &MockProvisioner{ - Config: MockConfig{ - NestedMockConfig: NestedMockConfig{Tags: []MockTag{}}, - NestedSlice: []NestedMockConfig{}, + Provisioner: &HCL2Provisioner{ + Provisioner: &MockProvisioner{ + Config: MockConfig{ + NestedMockConfig: NestedMockConfig{Tags: []MockTag{}}, + NestedSlice: []NestedMockConfig{}, + }, }, }, }, diff --git a/hcl2template/types.hcl_provisioner.go b/hcl2template/types.hcl_provisioner.go new file mode 100644 index 000000000..795497874 --- /dev/null +++ b/hcl2template/types.hcl_provisioner.go @@ -0,0 +1,61 @@ +package hcl2template + +import ( + "context" + "fmt" + + "github.com/hashicorp/hcl/v2" + "github.com/hashicorp/hcl/v2/hcldec" + "github.com/hashicorp/packer/packer" + "github.com/zclconf/go-cty/cty" +) + +type HCL2Provisioner struct { + Provisioner packer.Provisioner + provisionerBlock *ProvisionerBlock + evalContext *hcl.EvalContext + builderVariables map[string]string +} + +func (p *HCL2Provisioner) ConfigSpec() hcldec.ObjectSpec { + return p.Provisioner.ConfigSpec() +} + +func (p *HCL2Provisioner) HCL2Prepare(buildVars map[string]interface{}) error { + var diags hcl.Diagnostics + ectx := p.evalContext + if len(buildVars) > 0 { + ectx = p.evalContext.NewChild() + buildValues := map[string]cty.Value{} + for k, v := range buildVars { + switch v := v.(type) { + case string: + buildValues[k] = cty.StringVal(v) + default: + return fmt.Errorf("unhandled builvar type: %T", v) + } + } + ectx.Variables = map[string]cty.Value{ + buildAccessor: cty.ObjectVal(buildValues), + } + } + + flatProvisionerCfg, moreDiags := decodeHCL2Spec(p.provisionerBlock.HCL2Ref.Rest, ectx, p.Provisioner) + diags = append(diags, moreDiags...) + if diags.HasErrors() { + return diags + } + return p.Provisioner.Prepare(p.builderVariables, flatProvisionerCfg) +} + +func (p *HCL2Provisioner) Prepare(args ...interface{}) error { + return p.Provisioner.Prepare(args...) +} + +func (p *HCL2Provisioner) Provision(ctx context.Context, ui packer.Ui, c packer.Communicator, vars map[string]interface{}) error { + err := p.HCL2Prepare(vars) + if err != nil { + return err + } + return p.Provisioner.Provision(ctx, ui, c, vars) +} diff --git a/hcl2template/types.packer_config.go b/hcl2template/types.packer_config.go index 3908c91fe..069175ca2 100644 --- a/hcl2template/types.packer_config.go +++ b/hcl2template/types.packer_config.go @@ -199,7 +199,7 @@ func (c *PackerConfig) evaluateLocalVariable(local *Local) hcl.Diagnostics { // getCoreBuildProvisioners takes a list of provisioner block, starts according // provisioners and sends parsed HCL2 over to it. -func (cfg *PackerConfig) getCoreBuildProvisioners(source SourceBlock, blocks []*ProvisionerBlock, ectx *hcl.EvalContext, generatedVars map[string]string) ([]packer.CoreBuildProvisioner, hcl.Diagnostics) { +func (cfg *PackerConfig) getCoreBuildProvisioners(source SourceBlock, blocks []*ProvisionerBlock, ectx *hcl.EvalContext, generatedVars map[string]interface{}) ([]packer.CoreBuildProvisioner, hcl.Diagnostics) { var diags hcl.Diagnostics res := []packer.CoreBuildProvisioner{} for _, pb := range blocks { @@ -242,7 +242,7 @@ func (cfg *PackerConfig) getCoreBuildProvisioners(source SourceBlock, blocks []* // getCoreBuildProvisioners takes a list of post processor block, starts // according provisioners and sends parsed HCL2 over to it. -func (cfg *PackerConfig) getCoreBuildPostProcessors(source SourceBlock, blocks []*PostProcessorBlock, ectx *hcl.EvalContext, generatedVars map[string]string) ([]packer.CoreBuildPostProcessor, hcl.Diagnostics) { +func (cfg *PackerConfig) getCoreBuildPostProcessors(source SourceBlock, blocks []*PostProcessorBlock, ectx *hcl.EvalContext, generatedVars map[string]interface{}) ([]packer.CoreBuildPostProcessor, hcl.Diagnostics) { var diags hcl.Diagnostics res := []packer.CoreBuildPostProcessor{} for _, ppb := range blocks { @@ -365,7 +365,7 @@ func (cfg *PackerConfig) GetBuilds(opts packer.GetBuildsOptions) ([]packer.Build for _, k := range generatedVars { generatedPlaceholderMap[k] = fmt.Sprintf("Build_%s. "+ common.PlaceholderMsg, k) - unknownBuildValues[k] = cty.StringVal("") + unknownBuildValues[k] = cty.StringVal("") } variables := map[string]cty.Value{ @@ -376,16 +376,16 @@ func (cfg *PackerConfig) GetBuilds(opts packer.GetBuildsOptions) ([]packer.Build buildAccessor: cty.ObjectVal(unknownBuildValues), } - provisioners, moreDiags := cfg.getCoreBuildProvisioners(src, build.ProvisionerBlocks, cfg.EvalContext(variables), generatedPlaceholderMap) + provisioners, moreDiags := cfg.getCoreBuildProvisioners(src, build.ProvisionerBlocks, cfg.EvalContext(variables), nil) diags = append(diags, moreDiags...) if moreDiags.HasErrors() { continue } - postProcessors, moreDiags := cfg.getCoreBuildPostProcessors(src, build.PostProcessors, cfg.EvalContext(variables), generatedPlaceholderMap) + postProcessors, moreDiags := cfg.getCoreBuildPostProcessors(src, build.PostProcessors, cfg.EvalContext(variables), nil) pps := [][]packer.CoreBuildPostProcessor{} if len(postProcessors) > 0 { pps = [][]packer.CoreBuildPostProcessor{postProcessors} - } + } // TODO(azr): remove this diags = append(diags, moreDiags...) if moreDiags.HasErrors() { continue diff --git a/hcl2template/types.packer_config_test.go b/hcl2template/types.packer_config_test.go index 74df297e4..9849f06df 100644 --- a/hcl2template/types.packer_config_test.go +++ b/hcl2template/types.packer_config_test.go @@ -110,11 +110,18 @@ func TestParser_complete(t *testing.T) { Builder: basicMockBuilder, Provisioners: []packer.CoreBuildProvisioner{ { - PType: "shell", - PName: "provisioner that does something", - Provisioner: basicMockProvisioner, + PType: "shell", + PName: "provisioner that does something", + Provisioner: &HCL2Provisioner{ + Provisioner: basicMockProvisioner, + }, + }, + { + PType: "file", + Provisioner: &HCL2Provisioner{ + Provisioner: basicMockProvisioner, + }, }, - {PType: "file", Provisioner: basicMockProvisioner}, }, PostProcessors: [][]packer.CoreBuildPostProcessor{ { @@ -146,11 +153,18 @@ func TestParser_complete(t *testing.T) { }, Provisioners: []packer.CoreBuildProvisioner{ { - PType: "shell", - PName: "provisioner that does something", - Provisioner: basicMockProvisioner, + PType: "shell", + PName: "provisioner that does something", + Provisioner: &HCL2Provisioner{ + Provisioner: basicMockProvisioner, + }, + }, + { + PType: "file", + Provisioner: &HCL2Provisioner{ + Provisioner: basicMockProvisioner, + }, }, - {PType: "file", Provisioner: basicMockProvisioner}, }, PostProcessors: [][]packer.CoreBuildPostProcessor{ { diff --git a/packer/provisioner.go b/packer/provisioner.go index 905b28971..8caffc1a9 100644 --- a/packer/provisioner.go +++ b/packer/provisioner.go @@ -51,8 +51,8 @@ type ProvisionHook struct { // custom generated data could be passed into provisioners from builders to // enable specialized builder-specific (but still validated!!) access to builder // data. -func BasicPlaceholderData() map[string]string { - placeholderData := map[string]string{} +func BasicPlaceholderData() map[string]interface{} { + placeholderData := map[string]interface{}{} msg := "Build_%s. " + common.PlaceholderMsg placeholderData["ID"] = fmt.Sprintf(msg, "ID") // The following correspond to communicator-agnostic functions that are From 39261f367149c8e76f8d0a73b9e2b28af322cb4a Mon Sep 17 00:00:00 2001 From: Adrien Delorme Date: Mon, 6 Jul 2020 10:32:39 +0200 Subject: [PATCH 09/38] add hcl2 post processor type that reprepares itself --- hcl2template/common_test.go | 1 + hcl2template/types.build.post-processor.go | 12 ++-- hcl2template/types.build.provisioners.go | 6 +- hcl2template/types.build_test.go | 40 ++++++++----- hcl2template/types.hcl_post-processor.go | 68 ++++++++++++++++++++++ hcl2template/types.packer_config_test.go | 28 +++++---- 6 files changed, 122 insertions(+), 33 deletions(-) create mode 100644 hcl2template/types.hcl_post-processor.go diff --git a/hcl2template/common_test.go b/hcl2template/common_test.go index 610e178ce..4a4889e8b 100644 --- a/hcl2template/common_test.go +++ b/hcl2template/common_test.go @@ -130,6 +130,7 @@ func testParse(t *testing.T, tests []parseTest) { packer.CoreBuildPostProcessor{}, null.Builder{}, HCL2Provisioner{}, + HCL2PostProcessor{}, ), ); diff != "" { t.Fatalf("Parser.getBuilds() wrong packer builds. %s", diff) diff --git a/hcl2template/types.build.post-processor.go b/hcl2template/types.build.post-processor.go index f80b40ecf..c54626639 100644 --- a/hcl2template/types.build.post-processor.go +++ b/hcl2template/types.build.post-processor.go @@ -74,9 +74,13 @@ func (cfg *PackerConfig) startPostProcessor(source SourceBlock, pp *PostProcesso }) return nil, diags } - flatProvisinerCfg, moreDiags := decodeHCL2Spec(pp.Rest, ectx, postProcessor) - diags = append(diags, moreDiags...) - err = postProcessor.Configure(source.builderVariables(), flatProvisinerCfg) + hclPostProcessor := &HCL2PostProcessor{ + PostProcessor: postProcessor, + postProcessorBlock: pp, + evalContext: ectx, + builderVariables: source.builderVariables(), + } + err = hclPostProcessor.HCL2Prepare(generatedVars) if err != nil { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, @@ -86,5 +90,5 @@ func (cfg *PackerConfig) startPostProcessor(source SourceBlock, pp *PostProcesso }) return nil, diags } - return postProcessor, diags + return hclPostProcessor, diags } diff --git a/hcl2template/types.build.provisioners.go b/hcl2template/types.build.provisioners.go index 19b699155..ebc89600b 100644 --- a/hcl2template/types.build.provisioners.go +++ b/hcl2template/types.build.provisioners.go @@ -144,13 +144,13 @@ func (cfg *PackerConfig) startProvisioner(source SourceBlock, pb *ProvisionerBlo }) return nil, diags } - p := &HCL2Provisioner{ + hclProvisioner := &HCL2Provisioner{ Provisioner: provisioner, provisionerBlock: pb, evalContext: ectx, builderVariables: source.builderVariables(), } - err = p.HCL2Prepare(generatedVars) + err = hclProvisioner.HCL2Prepare(generatedVars) if err != nil { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, @@ -160,5 +160,5 @@ func (cfg *PackerConfig) startProvisioner(source SourceBlock, pb *ProvisionerBlo }) return nil, diags } - return p, diags + return hclProvisioner, diags } diff --git a/hcl2template/types.build_test.go b/hcl2template/types.build_test.go index f7a69e844..658c79c68 100644 --- a/hcl2template/types.build_test.go +++ b/hcl2template/types.build_test.go @@ -171,19 +171,23 @@ func TestParse_build(t *testing.T) { { { PType: "amazon-import", - PostProcessor: &MockPostProcessor{ - Config: MockConfig{ - NestedMockConfig: NestedMockConfig{Tags: []MockTag{}}, - NestedSlice: []NestedMockConfig{}, + PostProcessor: &HCL2PostProcessor{ + PostProcessor: &MockPostProcessor{ + Config: MockConfig{ + NestedMockConfig: NestedMockConfig{Tags: []MockTag{}}, + NestedSlice: []NestedMockConfig{}, + }, }, }, }, { PType: "manifest", - PostProcessor: &MockPostProcessor{ - Config: MockConfig{ - NestedMockConfig: NestedMockConfig{Tags: []MockTag{}}, - NestedSlice: []NestedMockConfig{}, + PostProcessor: &HCL2PostProcessor{ + PostProcessor: &MockPostProcessor{ + Config: MockConfig{ + NestedMockConfig: NestedMockConfig{Tags: []MockTag{}}, + NestedSlice: []NestedMockConfig{}, + }, }, }, }, @@ -199,19 +203,23 @@ func TestParse_build(t *testing.T) { { { PType: "manifest", - PostProcessor: &MockPostProcessor{ - Config: MockConfig{ - NestedMockConfig: NestedMockConfig{Tags: []MockTag{}}, - NestedSlice: []NestedMockConfig{}, + PostProcessor: &HCL2PostProcessor{ + PostProcessor: &MockPostProcessor{ + Config: MockConfig{ + NestedMockConfig: NestedMockConfig{Tags: []MockTag{}}, + NestedSlice: []NestedMockConfig{}, + }, }, }, }, { PType: "amazon-import", - PostProcessor: &MockPostProcessor{ - Config: MockConfig{ - NestedMockConfig: NestedMockConfig{Tags: []MockTag{}}, - NestedSlice: []NestedMockConfig{}, + PostProcessor: &HCL2PostProcessor{ + PostProcessor: &MockPostProcessor{ + Config: MockConfig{ + NestedMockConfig: NestedMockConfig{Tags: []MockTag{}}, + NestedSlice: []NestedMockConfig{}, + }, }, }, }, diff --git a/hcl2template/types.hcl_post-processor.go b/hcl2template/types.hcl_post-processor.go new file mode 100644 index 000000000..6698b3f5a --- /dev/null +++ b/hcl2template/types.hcl_post-processor.go @@ -0,0 +1,68 @@ +package hcl2template + +import ( + "context" + "fmt" + + "github.com/hashicorp/hcl/v2" + "github.com/hashicorp/hcl/v2/hcldec" + "github.com/hashicorp/packer/packer" + "github.com/zclconf/go-cty/cty" +) + +type HCL2PostProcessor struct { + PostProcessor packer.PostProcessor + postProcessorBlock *PostProcessorBlock + evalContext *hcl.EvalContext + builderVariables map[string]string +} + +func (p *HCL2PostProcessor) ConfigSpec() hcldec.ObjectSpec { + return p.PostProcessor.ConfigSpec() +} + +func (p *HCL2PostProcessor) HCL2Prepare(buildVars map[string]interface{}) error { + var diags hcl.Diagnostics + ectx := p.evalContext + if len(buildVars) > 0 { + ectx = p.evalContext.NewChild() + buildValues := map[string]cty.Value{} + for k, v := range buildVars { + switch v := v.(type) { + case string: + buildValues[k] = cty.StringVal(v) + default: + return fmt.Errorf("unhandled builvar type: %T", v) + } + } + ectx.Variables = map[string]cty.Value{ + buildAccessor: cty.ObjectVal(buildValues), + } + } + + flatPostProcessorCfg, moreDiags := decodeHCL2Spec(p.postProcessorBlock.HCL2Ref.Rest, ectx, p.PostProcessor) + diags = append(diags, moreDiags...) + if diags.HasErrors() { + return diags + } + return p.PostProcessor.Configure(p.builderVariables, flatPostProcessorCfg) +} + +func (p *HCL2PostProcessor) Configure(args ...interface{}) error { + return p.PostProcessor.Configure(args...) +} + +func (p *HCL2PostProcessor) PostProcess(ctx context.Context, ui packer.Ui, artifact packer.Artifact) (packer.Artifact, bool, bool, error) { + generatedData := make(map[string]interface{}) + if artifactStateData, ok := artifact.State("generated_data").(map[interface{}]interface{}); ok { + for k, v := range artifactStateData { + generatedData[k.(string)] = v + } + } + + err := p.HCL2Prepare(generatedData) + if err != nil { + return nil, false, false, err + } + return p.PostProcessor.PostProcess(ctx, ui, artifact) +} diff --git a/hcl2template/types.packer_config_test.go b/hcl2template/types.packer_config_test.go index 9849f06df..09efb0b3b 100644 --- a/hcl2template/types.packer_config_test.go +++ b/hcl2template/types.packer_config_test.go @@ -126,14 +126,18 @@ func TestParser_complete(t *testing.T) { PostProcessors: [][]packer.CoreBuildPostProcessor{ { { - PType: "amazon-import", - PName: "something", - PostProcessor: basicMockPostProcessor, + PType: "amazon-import", + PName: "something", + PostProcessor: &HCL2PostProcessor{ + PostProcessor: basicMockPostProcessor, + }, KeepInputArtifact: pTrue, }, { - PType: "amazon-import", - PostProcessor: basicMockPostProcessor, + PType: "amazon-import", + PostProcessor: &HCL2PostProcessor{ + PostProcessor: basicMockPostProcessor, + }, }, }, }, @@ -169,14 +173,18 @@ func TestParser_complete(t *testing.T) { PostProcessors: [][]packer.CoreBuildPostProcessor{ { { - PType: "amazon-import", - PName: "something", - PostProcessor: basicMockPostProcessor, + PType: "amazon-import", + PName: "something", + PostProcessor: &HCL2PostProcessor{ + PostProcessor: basicMockPostProcessor, + }, KeepInputArtifact: pTrue, }, { - PType: "amazon-import", - PostProcessor: basicMockPostProcessor, + PType: "amazon-import", + PostProcessor: &HCL2PostProcessor{ + PostProcessor: basicMockPostProcessor, + }, }, }, }, From 1b669ff2ab27f5b8ebc3f6ecbfce43e6b8824480 Mon Sep 17 00:00:00 2001 From: Adrien Delorme Date: Mon, 6 Jul 2020 11:18:02 +0200 Subject: [PATCH 10/38] woops --- packer/provisioner.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packer/provisioner.go b/packer/provisioner.go index 8caffc1a9..905b28971 100644 --- a/packer/provisioner.go +++ b/packer/provisioner.go @@ -51,8 +51,8 @@ type ProvisionHook struct { // custom generated data could be passed into provisioners from builders to // enable specialized builder-specific (but still validated!!) access to builder // data. -func BasicPlaceholderData() map[string]interface{} { - placeholderData := map[string]interface{}{} +func BasicPlaceholderData() map[string]string { + placeholderData := map[string]string{} msg := "Build_%s. " + common.PlaceholderMsg placeholderData["ID"] = fmt.Sprintf(msg, "ID") // The following correspond to communicator-agnostic functions that are From 90610dcf04104b12fb175a9596da4300e696dd09 Mon Sep 17 00:00:00 2001 From: Adrien Delorme Date: Mon, 6 Jul 2020 11:38:12 +0200 Subject: [PATCH 11/38] docs --- hcl2template/types.hcl_post-processor.go | 4 ++++ hcl2template/types.hcl_provisioner.go | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/hcl2template/types.hcl_post-processor.go b/hcl2template/types.hcl_post-processor.go index 6698b3f5a..0afec4d4b 100644 --- a/hcl2template/types.hcl_post-processor.go +++ b/hcl2template/types.hcl_post-processor.go @@ -10,6 +10,10 @@ import ( "github.com/zclconf/go-cty/cty" ) +// HCL2PostProcessor has a reference to the part of the HCL2 body where it is +// defined, allowing to completely reconfigure the PostProcessor right before +// calling PostProcess: with contextual variables. +// This permits using "${build.ID}" values for example. type HCL2PostProcessor struct { PostProcessor packer.PostProcessor postProcessorBlock *PostProcessorBlock diff --git a/hcl2template/types.hcl_provisioner.go b/hcl2template/types.hcl_provisioner.go index 795497874..3ea1e35dc 100644 --- a/hcl2template/types.hcl_provisioner.go +++ b/hcl2template/types.hcl_provisioner.go @@ -10,6 +10,10 @@ import ( "github.com/zclconf/go-cty/cty" ) +// HCL2Provisioner has a reference to the part of the HCL2 body where it is +// defined, allowing to completely reconfigure the Provisioner right before +// calling Provision: with contextual variables. +// This permits using "${build.ID}" values for example. type HCL2Provisioner struct { Provisioner packer.Provisioner provisionerBlock *ProvisionerBlock From 0ed10f921fab558355d0d40162d5f90d8a021134 Mon Sep 17 00:00:00 2001 From: Adrien Delorme Date: Mon, 6 Jul 2020 11:48:39 +0200 Subject: [PATCH 12/38] add test --- hcl2template/common_test.go | 1 + hcl2template/testdata/complete/build.pkr.hcl | 2 ++ 2 files changed, 3 insertions(+) diff --git a/hcl2template/common_test.go b/hcl2template/common_test.go index 4a4889e8b..781febd90 100644 --- a/hcl2template/common_test.go +++ b/hcl2template/common_test.go @@ -190,6 +190,7 @@ var ( } basicMockPostProcessor = &MockPostProcessor{ Config: MockConfig{ + NotSquashed: "value ", NestedMockConfig: basicNestedMockConfig, Nested: basicNestedMockConfig, NestedSlice: []NestedMockConfig{ diff --git a/hcl2template/testdata/complete/build.pkr.hcl b/hcl2template/testdata/complete/build.pkr.hcl index 5d6745a01..0077d98e5 100644 --- a/hcl2template/testdata/complete/build.pkr.hcl +++ b/hcl2template/testdata/complete/build.pkr.hcl @@ -138,6 +138,7 @@ build { ["a","b"], ["c","d"] ] + not_squashed = "${var.foo} ${upper(build.ID)}" nested { string = "string" @@ -185,6 +186,7 @@ build { ["a","b"], ["c","d"] ] + not_squashed = "${var.foo} ${upper(build.ID)}" nested { string = "string" From cf514d31f2a0f80d8841307f0f2e6252f466fd22 Mon Sep 17 00:00:00 2001 From: Adrien Delorme Date: Mon, 6 Jul 2020 15:14:17 +0200 Subject: [PATCH 13/38] avoid passing generatedVars down during first prepare --- hcl2template/types.build.post-processor.go | 4 ++-- hcl2template/types.build.provisioners.go | 4 ++-- hcl2template/types.packer_config.go | 12 ++++++------ 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/hcl2template/types.build.post-processor.go b/hcl2template/types.build.post-processor.go index c54626639..fcfa2dc0e 100644 --- a/hcl2template/types.build.post-processor.go +++ b/hcl2template/types.build.post-processor.go @@ -61,7 +61,7 @@ func (p *Parser) decodePostProcessor(block *hcl.Block) (*PostProcessorBlock, hcl return postProcessor, diags } -func (cfg *PackerConfig) startPostProcessor(source SourceBlock, pp *PostProcessorBlock, ectx *hcl.EvalContext, generatedVars map[string]interface{}) (packer.PostProcessor, hcl.Diagnostics) { +func (cfg *PackerConfig) startPostProcessor(source SourceBlock, pp *PostProcessorBlock, ectx *hcl.EvalContext) (packer.PostProcessor, hcl.Diagnostics) { // ProvisionerBlock represents a detected but unparsed provisioner var diags hcl.Diagnostics @@ -80,7 +80,7 @@ func (cfg *PackerConfig) startPostProcessor(source SourceBlock, pp *PostProcesso evalContext: ectx, builderVariables: source.builderVariables(), } - err = hclPostProcessor.HCL2Prepare(generatedVars) + err = hclPostProcessor.HCL2Prepare(nil) if err != nil { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, diff --git a/hcl2template/types.build.provisioners.go b/hcl2template/types.build.provisioners.go index ebc89600b..519a72e72 100644 --- a/hcl2template/types.build.provisioners.go +++ b/hcl2template/types.build.provisioners.go @@ -132,7 +132,7 @@ func (p *Parser) decodeProvisioner(block *hcl.Block) (*ProvisionerBlock, hcl.Dia return provisioner, diags } -func (cfg *PackerConfig) startProvisioner(source SourceBlock, pb *ProvisionerBlock, ectx *hcl.EvalContext, generatedVars map[string]interface{}) (packer.Provisioner, hcl.Diagnostics) { +func (cfg *PackerConfig) startProvisioner(source SourceBlock, pb *ProvisionerBlock, ectx *hcl.EvalContext) (packer.Provisioner, hcl.Diagnostics) { var diags hcl.Diagnostics provisioner, err := cfg.provisionersSchemas.Start(pb.PType) @@ -150,7 +150,7 @@ func (cfg *PackerConfig) startProvisioner(source SourceBlock, pb *ProvisionerBlo evalContext: ectx, builderVariables: source.builderVariables(), } - err = hclProvisioner.HCL2Prepare(generatedVars) + err = hclProvisioner.HCL2Prepare(nil) if err != nil { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, diff --git a/hcl2template/types.packer_config.go b/hcl2template/types.packer_config.go index 069175ca2..b40df364b 100644 --- a/hcl2template/types.packer_config.go +++ b/hcl2template/types.packer_config.go @@ -199,14 +199,14 @@ func (c *PackerConfig) evaluateLocalVariable(local *Local) hcl.Diagnostics { // getCoreBuildProvisioners takes a list of provisioner block, starts according // provisioners and sends parsed HCL2 over to it. -func (cfg *PackerConfig) getCoreBuildProvisioners(source SourceBlock, blocks []*ProvisionerBlock, ectx *hcl.EvalContext, generatedVars map[string]interface{}) ([]packer.CoreBuildProvisioner, hcl.Diagnostics) { +func (cfg *PackerConfig) getCoreBuildProvisioners(source SourceBlock, blocks []*ProvisionerBlock, ectx *hcl.EvalContext) ([]packer.CoreBuildProvisioner, hcl.Diagnostics) { var diags hcl.Diagnostics res := []packer.CoreBuildProvisioner{} for _, pb := range blocks { if pb.OnlyExcept.Skip(source.String()) { continue } - provisioner, moreDiags := cfg.startProvisioner(source, pb, ectx, generatedVars) + provisioner, moreDiags := cfg.startProvisioner(source, pb, ectx) diags = append(diags, moreDiags...) if moreDiags.HasErrors() { continue @@ -242,7 +242,7 @@ func (cfg *PackerConfig) getCoreBuildProvisioners(source SourceBlock, blocks []* // getCoreBuildProvisioners takes a list of post processor block, starts // according provisioners and sends parsed HCL2 over to it. -func (cfg *PackerConfig) getCoreBuildPostProcessors(source SourceBlock, blocks []*PostProcessorBlock, ectx *hcl.EvalContext, generatedVars map[string]interface{}) ([]packer.CoreBuildPostProcessor, hcl.Diagnostics) { +func (cfg *PackerConfig) getCoreBuildPostProcessors(source SourceBlock, blocks []*PostProcessorBlock, ectx *hcl.EvalContext) ([]packer.CoreBuildPostProcessor, hcl.Diagnostics) { var diags hcl.Diagnostics res := []packer.CoreBuildPostProcessor{} for _, ppb := range blocks { @@ -266,7 +266,7 @@ func (cfg *PackerConfig) getCoreBuildPostProcessors(source SourceBlock, blocks [ break } - postProcessor, moreDiags := cfg.startPostProcessor(source, ppb, ectx, generatedVars) + postProcessor, moreDiags := cfg.startPostProcessor(source, ppb, ectx) diags = append(diags, moreDiags...) if moreDiags.HasErrors() { continue @@ -376,12 +376,12 @@ func (cfg *PackerConfig) GetBuilds(opts packer.GetBuildsOptions) ([]packer.Build buildAccessor: cty.ObjectVal(unknownBuildValues), } - provisioners, moreDiags := cfg.getCoreBuildProvisioners(src, build.ProvisionerBlocks, cfg.EvalContext(variables), nil) + provisioners, moreDiags := cfg.getCoreBuildProvisioners(src, build.ProvisionerBlocks, cfg.EvalContext(variables)) diags = append(diags, moreDiags...) if moreDiags.HasErrors() { continue } - postProcessors, moreDiags := cfg.getCoreBuildPostProcessors(src, build.PostProcessors, cfg.EvalContext(variables), nil) + postProcessors, moreDiags := cfg.getCoreBuildPostProcessors(src, build.PostProcessors, cfg.EvalContext(variables)) pps := [][]packer.CoreBuildPostProcessor{} if len(postProcessors) > 0 { pps = [][]packer.CoreBuildPostProcessor{postProcessors} From eaf63e3bb5f493f392887918f61ec0e151a22413 Mon Sep 17 00:00:00 2001 From: Adrien Delorme Date: Mon, 6 Jul 2020 16:07:29 +0200 Subject: [PATCH 14/38] pass source name from local source name too --- hcl2template/types.packer_config.go | 7 ++----- hcl2template/types.source.go | 19 ++++++++++++++++--- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/hcl2template/types.packer_config.go b/hcl2template/types.packer_config.go index b40df364b..82e4374f3 100644 --- a/hcl2template/types.packer_config.go +++ b/hcl2template/types.packer_config.go @@ -369,11 +369,8 @@ func (cfg *PackerConfig) GetBuilds(opts packer.GetBuildsOptions) ([]packer.Build } variables := map[string]cty.Value{ - sourcesAccessor: cty.ObjectVal(map[string]cty.Value{ - "type": cty.StringVal(src.Type), - "name": cty.StringVal(src.Name), - }), - buildAccessor: cty.ObjectVal(unknownBuildValues), + sourcesAccessor: cty.ObjectVal(src.ctyValues()), + buildAccessor: cty.ObjectVal(unknownBuildValues), } provisioners, moreDiags := cfg.getCoreBuildProvisioners(src, build.ProvisionerBlocks, cfg.EvalContext(variables)) diff --git a/hcl2template/types.source.go b/hcl2template/types.source.go index 51f275aa0..076d83d1b 100644 --- a/hcl2template/types.source.go +++ b/hcl2template/types.source.go @@ -7,6 +7,7 @@ import ( "github.com/hashicorp/hcl/v2" "github.com/hashicorp/hcl/v2/gohcl" "github.com/hashicorp/packer/packer" + "github.com/zclconf/go-cty/cty" ) // SourceBlock references an HCL 'source' block. @@ -26,11 +27,23 @@ type SourceBlock struct { LocalName string } -func (b *SourceBlock) String() string { +func (b *SourceBlock) name() string { if b.LocalName != "" { - return fmt.Sprintf("%s.%s", b.Type, b.LocalName) + return b.LocalName + } + return b.Name +} + +func (b *SourceBlock) String() string { + return fmt.Sprintf("%s.%s", b.Type, b.name()) +} + +// EvalContext adds the values of the source to the passed eval context. +func (b *SourceBlock) ctyValues() map[string]cty.Value { + return map[string]cty.Value{ + "type": cty.StringVal(b.Type), + "name": cty.StringVal(b.name()), } - return fmt.Sprintf("%s.%s", b.Type, b.Name) } // decodeBuildSource reads a used source block from a build: From 0293f69fa12223c6bc5f18d82d0e4cecee24d778 Mon Sep 17 00:00:00 2001 From: Adrien Delorme Date: Mon, 6 Jul 2020 16:07:46 +0200 Subject: [PATCH 15/38] default build values to be unknown --- hcl2template/types.packer_config.go | 1 + 1 file changed, 1 insertion(+) diff --git a/hcl2template/types.packer_config.go b/hcl2template/types.packer_config.go index 82e4374f3..a19dba2dd 100644 --- a/hcl2template/types.packer_config.go +++ b/hcl2template/types.packer_config.go @@ -69,6 +69,7 @@ func (cfg *PackerConfig) EvalContext(variables map[string]cty.Value) *hcl.EvalCo "type": cty.UnknownVal(cty.String), "name": cty.UnknownVal(cty.String), }), + buildAccessor: cty.UnknownVal(cty.EmptyObject), }, } for k, v := range variables { From 8010a23b3413fda6ae168479206cfc90156a3fdf Mon Sep 17 00:00:00 2001 From: Geoff Schultz Date: Mon, 6 Jul 2020 09:41:13 -0500 Subject: [PATCH 16/38] Adding retry for ImportImage call in amazon-import post-processor. --- post-processor/amazon-import/post-processor.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/post-processor/amazon-import/post-processor.go b/post-processor/amazon-import/post-processor.go index 886dbac56..f6cd99d2b 100644 --- a/post-processor/amazon-import/post-processor.go +++ b/post-processor/amazon-import/post-processor.go @@ -8,6 +8,7 @@ import ( "log" "os" "strings" + "time" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" @@ -16,6 +17,7 @@ import ( "github.com/hashicorp/hcl/v2/hcldec" awscommon "github.com/hashicorp/packer/builder/amazon/common" "github.com/hashicorp/packer/common" + "github.com/hashicorp/packer/common/retry" "github.com/hashicorp/packer/helper/config" "github.com/hashicorp/packer/packer" "github.com/hashicorp/packer/template/interpolate" @@ -231,7 +233,14 @@ func (p *PostProcessor) PostProcess(ctx context.Context, ui packer.Ui, artifact params.LicenseType = &p.config.LicenseType } - import_start, err := ec2conn.ImportImage(params) + var import_start *ec2.ImportImageOutput + err = retry.Config{ + Tries: 11, + RetryDelay: (&retry.Backoff{InitialBackoff: 200 * time.Millisecond, MaxBackoff: 30 * time.Second, Multiplier: 2}).Linear, + }.Run(ctx, func(ctx context.Context) error { + import_start, err = ec2conn.ImportImage(params) + return err + }) if err != nil { return nil, false, false, fmt.Errorf("Failed to start import from s3://%s/%s: %s", p.config.S3Bucket, p.config.S3Key, err) From 8e923977f055e9662cc9fcc78a843e0388f47895 Mon Sep 17 00:00:00 2001 From: Adrien Delorme Date: Mon, 6 Jul 2020 16:53:06 +0200 Subject: [PATCH 17/38] null builder: say that we are returnin the ID value --- builder/null/builder.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builder/null/builder.go b/builder/null/builder.go index 1d2fc40e4..f68263069 100644 --- a/builder/null/builder.go +++ b/builder/null/builder.go @@ -25,7 +25,7 @@ func (b *Builder) Prepare(raws ...interface{}) ([]string, []string, error) { return nil, warnings, errs } - return nil, warnings, nil + return []string{"ID"}, warnings, nil } func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (packer.Artifact, error) { From 0deaa5d2a5682b8cd4901158f91ec184106b3eec Mon Sep 17 00:00:00 2001 From: Adrien Delorme Date: Mon, 6 Jul 2020 17:01:55 +0200 Subject: [PATCH 18/38] add a complete tests for builder variables + only/except --- command/build_test.go | 67 +++++++++++++++++++ command/command_test.go | 6 +- .../test-fixtures/hcl/complete/build.pkr.hcl | 54 +++++++++++++++ .../hcl/complete/sources.pkr.hcl | 3 + 4 files changed, 128 insertions(+), 2 deletions(-) create mode 100644 command/test-fixtures/hcl/complete/build.pkr.hcl create mode 100644 command/test-fixtures/hcl/complete/sources.pkr.hcl diff --git a/command/build_test.go b/command/build_test.go index e464b3401..651ae988e 100644 --- a/command/build_test.go +++ b/command/build_test.go @@ -20,6 +20,17 @@ import ( shell_local "github.com/hashicorp/packer/provisioner/shell-local" ) +var ( + spaghettiCarbonara = `spaghetti +carbonara +` + lasagna = `lasagna +tomato +mozza +cooking... +` +) + func TestBuild(t *testing.T) { tc := []struct { name string @@ -232,6 +243,62 @@ func TestBuild(t *testing.T) { expected: []string{"chocolate.txt", "vanilla.txt"}, }, }, + + // complete + { + name: "hcl - complete", + args: []string{ + testFixture("hcl", "complete"), + }, + fileCheck: fileCheck{ + expectedContent: map[string]string{ + "NULL.spaghetti_carbonara.txt": spaghettiCarbonara, + "NULL.lasagna.txt": lasagna, + }, + }, + }, + + { + name: "hcl - complete - except carbonara", + args: []string{ + "-except", "recipes.null.spaghetti_carbonara", + testFixture("hcl", "complete"), + }, + fileCheck: fileCheck{ + notExpected: []string{"NULL.spaghetti_carbonara.txt"}, + expectedContent: map[string]string{ + "NULL.lasagna.txt": lasagna, + }, + }, + }, + + { + name: "hcl - complete - only lasagna", + args: []string{ + "-only", "*lasagna", + testFixture("hcl", "complete"), + }, + fileCheck: fileCheck{ + notExpected: []string{"NULL.spaghetti_carbonara.txt"}, + expectedContent: map[string]string{ + "NULL.lasagna.txt": lasagna, + }, + }, + }, + + { + name: "hcl - complete - only recipes", + args: []string{ + "-only", "recipes.*", + testFixture("hcl", "complete"), + }, + fileCheck: fileCheck{ + expectedContent: map[string]string{ + "NULL.spaghetti_carbonara.txt": spaghettiCarbonara, + "NULL.lasagna.txt": lasagna, + }, + }, + }, } for _, tt := range tc { diff --git a/command/command_test.go b/command/command_test.go index 31f1e3d54..34d044292 100644 --- a/command/command_test.go +++ b/command/command_test.go @@ -27,8 +27,10 @@ func outputCommand(t *testing.T, m Meta) (string, string) { return out.String(), err.String() } -func testFixture(n string) string { - return filepath.Join(fixturesDir, n) +func testFixture(n ...string) string { + paths := []string{fixturesDir} + paths = append(paths, n...) + return filepath.Join(paths...) } func testMeta(t *testing.T) Meta { diff --git a/command/test-fixtures/hcl/complete/build.pkr.hcl b/command/test-fixtures/hcl/complete/build.pkr.hcl new file mode 100644 index 000000000..ceb0a58d3 --- /dev/null +++ b/command/test-fixtures/hcl/complete/build.pkr.hcl @@ -0,0 +1,54 @@ + +build { + source "source.null.base" { + name = "tiramisu" + } +} + +build { + name = "recipes" + source "source.null.base" { + name = "spaghetti_carbonara" + } + source "source.null.base" { + name = "lasagna" + } + + provisioner "shell-local" { + name = "add_spaghetti" + inline = [ "echo spaghetti > ${upper(build.ID)}.${source.name}.txt" ] + only = ["null.spaghetti_carbonara"] + } + + post-processor "shell-local" { + name = "carbonara_it" + inline = [ "echo carbonara >> ${upper(build.ID)}.${source.name}.txt" ] + except = ["null.lasagna"] + } + + + provisioner "shell-local" { + name = "add_lasagna" + inline = [ "echo lasagna > ${upper(build.ID)}.${source.name}.txt" ] + only = ["null.lasagna"] + } + + provisioner "shell-local" { + name = "add_tomato" + inline = [ "echo tomato >> ${upper(build.ID)}.${source.name}.txt" ] + except = ["null.spaghetti_carbonara"] + } + + provisioner "shell-local" { + name = "add_mozza" + inline = [ "echo mozza >> ${upper(build.ID)}.${source.name}.txt" ] + except = ["null.spaghetti_carbonara"] + } + + post-processor "shell-local" { + name = "cook" + inline = [ "echo 'cooking...' >> ${upper(build.ID)}.${source.name}.txt" ] + except = ["null.spaghetti_carbonara"] + } + +} diff --git a/command/test-fixtures/hcl/complete/sources.pkr.hcl b/command/test-fixtures/hcl/complete/sources.pkr.hcl new file mode 100644 index 000000000..baeae65fb --- /dev/null +++ b/command/test-fixtures/hcl/complete/sources.pkr.hcl @@ -0,0 +1,3 @@ +source "null" "base" { + communicator = "none" +} From 0475b0529d8bb8fba4ec4cb1bdcf44f43e874dc1 Mon Sep 17 00:00:00 2001 From: Adrien Delorme Date: Mon, 6 Jul 2020 17:53:08 +0200 Subject: [PATCH 19/38] tests: fix line endings in windows --- command/build_windows_test.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 command/build_windows_test.go diff --git a/command/build_windows_test.go b/command/build_windows_test.go new file mode 100644 index 000000000..fb8a52222 --- /dev/null +++ b/command/build_windows_test.go @@ -0,0 +1,12 @@ +package command + +import "strings" + +func init() { + spaghettiCarbonara = fixWindowsLineEndings(spaghettiCarbonara) + lasagna = fixWindowsLineEndings(lasagna) +} + +func fixWindowsLineEndings(s string) string { + return strings.ReplaceAll(s, "\n", " \r\n") +} From 10e5d952ac010fa90445e14b5215a965710aeffe Mon Sep 17 00:00:00 2001 From: Adrien Delorme Date: Mon, 6 Jul 2020 18:08:51 +0200 Subject: [PATCH 20/38] unquote 'cooking...' --- command/test-fixtures/hcl/complete/build.pkr.hcl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/command/test-fixtures/hcl/complete/build.pkr.hcl b/command/test-fixtures/hcl/complete/build.pkr.hcl index ceb0a58d3..f19bc805d 100644 --- a/command/test-fixtures/hcl/complete/build.pkr.hcl +++ b/command/test-fixtures/hcl/complete/build.pkr.hcl @@ -47,7 +47,7 @@ build { post-processor "shell-local" { name = "cook" - inline = [ "echo 'cooking...' >> ${upper(build.ID)}.${source.name}.txt" ] + inline = [ "echo cooking... >> ${upper(build.ID)}.${source.name}.txt" ] except = ["null.spaghetti_carbonara"] } From 93cd7e40bcb5ce2ba4b994abcef953b082159406 Mon Sep 17 00:00:00 2001 From: Megan Marsh Date: Mon, 6 Jul 2020 12:23:29 -0700 Subject: [PATCH 21/38] add note about ansibles configuration powershell script in our docs (#9526) * add note about ansibles configuration powershell script in our docs * Update website/pages/docs/provisioners/ansible.mdx Co-authored-by: Wilken Rivera --- website/pages/docs/provisioners/ansible.mdx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/website/pages/docs/provisioners/ansible.mdx b/website/pages/docs/provisioners/ansible.mdx index 91018cae9..fad122bcb 100644 --- a/website/pages/docs/provisioners/ansible.mdx +++ b/website/pages/docs/provisioners/ansible.mdx @@ -150,6 +150,11 @@ connection to chroot and running Ansible as root/sudo. There are two possible methods for using ansible with the WinRM communicator. +Please note that if you're having trouble getting Ansible to connect, you may +want to take a look at the script that the Ansible project provides to help +configure remoting for Ansible: +https://github.com/ansible/ansible/blob/devel/examples/scripts/ConfigureRemotingForAnsible.ps1 + #### Method 1 (recommended) The recommended way to use the WinRM communicator is to set `"use_proxy": false` From ab54f48247da0d36d2e1c0bca65a1ae7630809b5 Mon Sep 17 00:00:00 2001 From: Adrien Delorme Date: Tue, 7 Jul 2020 11:28:07 +0200 Subject: [PATCH 22/38] add BuilderDataCommonKeys var to see what common keys a builder can return --- packer/provisioner.go | 41 +++++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/packer/provisioner.go b/packer/provisioner.go index 905b28971..af1772e83 100644 --- a/packer/provisioner.go +++ b/packer/provisioner.go @@ -42,6 +42,24 @@ type ProvisionHook struct { Provisioners []*HookedProvisioner } +// BuilderDataCommonKeys is the list of common keys that all builder will +// return +var BuilderDataCommonKeys = []string{ + "ID", + "Host", + "Port", + "User", + "Password", + "ConnType", + "PackerRunUUID", + "PackerHTTPPort", + "PackerHTTPIP", + "PackerHTTPAddr", + "SSHPublicKey", + "SSHPrivateKey", + "WinRMPassword", +} + // Provisioners interpolate most of their fields in the prepare stage; this // placeholder map helps keep fields that are only generated at build time from // accidentally being interpolated into empty strings at prepare time. @@ -53,26 +71,9 @@ type ProvisionHook struct { // data. func BasicPlaceholderData() map[string]string { placeholderData := map[string]string{} - msg := "Build_%s. " + common.PlaceholderMsg - placeholderData["ID"] = fmt.Sprintf(msg, "ID") - // The following correspond to communicator-agnostic functions that are - // part of the SSH and WinRM communicator implementations. These functions - // are not part of the communicator interface, but are stored on the - // Communicator Config and return the appropriate values rather than - // depending on the actual communicator config values. E.g "Password" - // reprosents either WinRMPassword or SSHPassword, which makes this more - // useful if a template contains multiple builds. - placeholderData["Host"] = fmt.Sprintf(msg, "Host") - placeholderData["Port"] = fmt.Sprintf(msg, "Port") - placeholderData["User"] = fmt.Sprintf(msg, "User") - placeholderData["Password"] = fmt.Sprintf(msg, "Password") - placeholderData["ConnType"] = fmt.Sprintf(msg, "Type") - placeholderData["PackerRunUUID"] = fmt.Sprintf(msg, "PackerRunUUID") - placeholderData["PackerHTTPPort"] = fmt.Sprintf(msg, "PackerHTTPPort") - placeholderData["PackerHTTPIP"] = fmt.Sprintf(msg, "PackerHTTPIP") - placeholderData["PackerHTTPAddr"] = fmt.Sprintf(msg, "PackerHTTPAddr") - placeholderData["SSHPublicKey"] = fmt.Sprintf(msg, "SSHPublicKey") - placeholderData["SSHPrivateKey"] = fmt.Sprintf(msg, "SSHPrivateKey") + for _, key := range BuilderDataCommonKeys { + placeholderData[key] = fmt.Sprintf("Build_%s. "+common.PlaceholderMsg, key) + } // Backwards-compatability: WinRM Password can get through without forcing // the generated func validation. From 34ff3d0c8f2ed67e3a23bd06ef5a407a6754fd79 Mon Sep 17 00:00:00 2001 From: Adrien Delorme Date: Tue, 7 Jul 2020 11:29:27 +0200 Subject: [PATCH 23/38] hcl2 GetBuilds: use packer.BuilderDataCommonKeys to avoid forcing all builders to return exactly what they will return It would have been a bit nicer if all builder were more specific in order for hcl to tell wether a value will be set during the first prepare time but that also totally works ! --- hcl2template/types.packer_config.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/hcl2template/types.packer_config.go b/hcl2template/types.packer_config.go index a19dba2dd..dd72a6955 100644 --- a/hcl2template/types.packer_config.go +++ b/hcl2template/types.packer_config.go @@ -7,7 +7,6 @@ import ( "github.com/gobwas/glob" "github.com/hashicorp/hcl/v2" "github.com/hashicorp/hcl/v2/hclsyntax" - "github.com/hashicorp/packer/helper/common" "github.com/hashicorp/packer/packer" "github.com/zclconf/go-cty/cty" ) @@ -361,11 +360,8 @@ func (cfg *PackerConfig) GetBuilds(opts packer.GetBuildsOptions) ([]packer.Build // the provisioner prepare() so that the provisioner can appropriately // validate user input against what will become available. Otherwise, // only pass the default variables, using the basic placeholder data. - generatedPlaceholderMap := packer.BasicPlaceholderData() unknownBuildValues := map[string]cty.Value{} - for _, k := range generatedVars { - generatedPlaceholderMap[k] = fmt.Sprintf("Build_%s. "+ - common.PlaceholderMsg, k) + for _, k := range append(packer.BuilderDataCommonKeys, generatedVars...) { unknownBuildValues[k] = cty.StringVal("") } From c1c8b8d22ad961b55065e2e62708cae0b67f5701 Mon Sep 17 00:00:00 2001 From: Adrien Delorme Date: Tue, 7 Jul 2020 11:31:19 +0200 Subject: [PATCH 24/38] complete -> recipes --- command/build_test.go | 18 +++++++++--------- .../hcl/{complete => recipes}/build.pkr.hcl | 0 .../hcl/{complete => recipes}/sources.pkr.hcl | 0 3 files changed, 9 insertions(+), 9 deletions(-) rename command/test-fixtures/hcl/{complete => recipes}/build.pkr.hcl (100%) rename command/test-fixtures/hcl/{complete => recipes}/sources.pkr.hcl (100%) diff --git a/command/build_test.go b/command/build_test.go index 651ae988e..0724ff036 100644 --- a/command/build_test.go +++ b/command/build_test.go @@ -244,11 +244,11 @@ func TestBuild(t *testing.T) { }, }, - // complete + // recipes { - name: "hcl - complete", + name: "hcl - recipes", args: []string{ - testFixture("hcl", "complete"), + testFixture("hcl", "recipes"), }, fileCheck: fileCheck{ expectedContent: map[string]string{ @@ -259,10 +259,10 @@ func TestBuild(t *testing.T) { }, { - name: "hcl - complete - except carbonara", + name: "hcl - recipes - except carbonara", args: []string{ "-except", "recipes.null.spaghetti_carbonara", - testFixture("hcl", "complete"), + testFixture("hcl", "recipes"), }, fileCheck: fileCheck{ notExpected: []string{"NULL.spaghetti_carbonara.txt"}, @@ -273,10 +273,10 @@ func TestBuild(t *testing.T) { }, { - name: "hcl - complete - only lasagna", + name: "hcl - recipes - only lasagna", args: []string{ "-only", "*lasagna", - testFixture("hcl", "complete"), + testFixture("hcl", "recipes"), }, fileCheck: fileCheck{ notExpected: []string{"NULL.spaghetti_carbonara.txt"}, @@ -287,10 +287,10 @@ func TestBuild(t *testing.T) { }, { - name: "hcl - complete - only recipes", + name: "hcl - recipes - only recipes", args: []string{ "-only", "recipes.*", - testFixture("hcl", "complete"), + testFixture("hcl", "recipes"), }, fileCheck: fileCheck{ expectedContent: map[string]string{ diff --git a/command/test-fixtures/hcl/complete/build.pkr.hcl b/command/test-fixtures/hcl/recipes/build.pkr.hcl similarity index 100% rename from command/test-fixtures/hcl/complete/build.pkr.hcl rename to command/test-fixtures/hcl/recipes/build.pkr.hcl diff --git a/command/test-fixtures/hcl/complete/sources.pkr.hcl b/command/test-fixtures/hcl/recipes/sources.pkr.hcl similarity index 100% rename from command/test-fixtures/hcl/complete/sources.pkr.hcl rename to command/test-fixtures/hcl/recipes/sources.pkr.hcl From a15ad19411b07f2fd3c59c1782dcbe19fb7301ed Mon Sep 17 00:00:00 2001 From: Adrien Delorme Date: Tue, 7 Jul 2020 11:41:24 +0200 Subject: [PATCH 25/38] test builds can be 'excepted' --- command/build_test.go | 17 +++++++++++++++-- command/test-fixtures/hcl/recipes/build.pkr.hcl | 17 +++++++++++++++++ 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/command/build_test.go b/command/build_test.go index 0724ff036..1a4351d08 100644 --- a/command/build_test.go +++ b/command/build_test.go @@ -28,6 +28,11 @@ carbonara tomato mozza cooking... +` + tiramisu = `whip_york +mascarpone +whipped_egg_white +dress ` ) @@ -254,6 +259,7 @@ func TestBuild(t *testing.T) { expectedContent: map[string]string{ "NULL.spaghetti_carbonara.txt": spaghettiCarbonara, "NULL.lasagna.txt": lasagna, + "NULL.tiramisu.txt": tiramisu, }, }, }, @@ -267,7 +273,8 @@ func TestBuild(t *testing.T) { fileCheck: fileCheck{ notExpected: []string{"NULL.spaghetti_carbonara.txt"}, expectedContent: map[string]string{ - "NULL.lasagna.txt": lasagna, + "NULL.lasagna.txt": lasagna, + "NULL.tiramisu.txt": tiramisu, }, }, }, @@ -279,7 +286,10 @@ func TestBuild(t *testing.T) { testFixture("hcl", "recipes"), }, fileCheck: fileCheck{ - notExpected: []string{"NULL.spaghetti_carbonara.txt"}, + notExpected: []string{ + "NULL.spaghetti_carbonara.txt", + "NULL.tiramisu.txt", + }, expectedContent: map[string]string{ "NULL.lasagna.txt": lasagna, }, @@ -293,6 +303,9 @@ func TestBuild(t *testing.T) { testFixture("hcl", "recipes"), }, fileCheck: fileCheck{ + notExpected: []string{ + "NULL.tiramisu.txt", + }, expectedContent: map[string]string{ "NULL.spaghetti_carbonara.txt": spaghettiCarbonara, "NULL.lasagna.txt": lasagna, diff --git a/command/test-fixtures/hcl/recipes/build.pkr.hcl b/command/test-fixtures/hcl/recipes/build.pkr.hcl index f19bc805d..25a0a5acc 100644 --- a/command/test-fixtures/hcl/recipes/build.pkr.hcl +++ b/command/test-fixtures/hcl/recipes/build.pkr.hcl @@ -3,6 +3,23 @@ build { source "source.null.base" { name = "tiramisu" } + + provisioner "shell-local" { + name = "whipped_york" + inline = [ "echo whip_york > ${upper(build.ID)}.${source.name}.txt" ] + } + provisioner "shell-local" { + name = "mascarpone" + inline = [ "echo mascarpone >> ${upper(build.ID)}.${source.name}.txt" ] + } + post-processor "shell-local" { + name = "whipped_egg_white" + inline = [ "echo whipped_egg_white >> ${upper(build.ID)}.${source.name}.txt" ] + } + post-processor "shell-local" { + name = "dress_with_coffeed_boudoirs" + inline = [ "echo dress >> ${upper(build.ID)}.${source.name}.txt" ] + } } build { From d84d956e3612fe29d7bffd16f4445f6999534546 Mon Sep 17 00:00:00 2001 From: Adrien Delorme Date: Tue, 7 Jul 2020 11:43:13 +0200 Subject: [PATCH 26/38] add language coment ! --- command/test-fixtures/hcl/recipes/build.pkr.hcl | 1 + 1 file changed, 1 insertion(+) diff --git a/command/test-fixtures/hcl/recipes/build.pkr.hcl b/command/test-fixtures/hcl/recipes/build.pkr.hcl index 25a0a5acc..782bf10a2 100644 --- a/command/test-fixtures/hcl/recipes/build.pkr.hcl +++ b/command/test-fixtures/hcl/recipes/build.pkr.hcl @@ -2,6 +2,7 @@ build { source "source.null.base" { name = "tiramisu" + // pull me up ! } provisioner "shell-local" { From 12c9959db2ec7ddc0498f83a92ceeefdee5ec3d5 Mon Sep 17 00:00:00 2001 From: Adrien Delorme Date: Tue, 7 Jul 2020 11:46:43 +0200 Subject: [PATCH 27/38] Revert "null builder: say that we are returnin the ID value" This reverts commit 8e923977f055e9662cc9fcc78a843e0388f47895. --- builder/null/builder.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builder/null/builder.go b/builder/null/builder.go index f68263069..1d2fc40e4 100644 --- a/builder/null/builder.go +++ b/builder/null/builder.go @@ -25,7 +25,7 @@ func (b *Builder) Prepare(raws ...interface{}) ([]string, []string, error) { return nil, warnings, errs } - return []string{"ID"}, warnings, nil + return nil, warnings, nil } func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (packer.Artifact, error) { From 3fb7ddf5095aff02cdf47220e17622de3ef1cb51 Mon Sep 17 00:00:00 2001 From: Adrien Delorme Date: Tue, 7 Jul 2020 11:52:08 +0200 Subject: [PATCH 28/38] Update provisioner.go --- packer/provisioner.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packer/provisioner.go b/packer/provisioner.go index af1772e83..834f7433f 100644 --- a/packer/provisioner.go +++ b/packer/provisioner.go @@ -46,6 +46,13 @@ type ProvisionHook struct { // return var BuilderDataCommonKeys = []string{ "ID", + // The following correspond to communicator-agnostic functions that are } + // part of the SSH and WinRM communicator implementations. These functions + // are not part of the communicator interface, but are stored on the + // Communicator Config and return the appropriate values rather than + // depending on the actual communicator config values. E.g "Password" + // reprosents either WinRMPassword or SSHPassword, which makes this more + // useful if a template contains multiple builds. "Host", "Port", "User", From b0238e6f4a3f4b688a2d0010d6633e86a31c03cb Mon Sep 17 00:00:00 2001 From: Adrien Delorme Date: Tue, 7 Jul 2020 12:00:36 +0200 Subject: [PATCH 29/38] Update build_windows_test.go --- command/build_windows_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/command/build_windows_test.go b/command/build_windows_test.go index fb8a52222..829cf987f 100644 --- a/command/build_windows_test.go +++ b/command/build_windows_test.go @@ -5,6 +5,7 @@ import "strings" func init() { spaghettiCarbonara = fixWindowsLineEndings(spaghettiCarbonara) lasagna = fixWindowsLineEndings(lasagna) + tiramisu = fixWindowsLineEndings(tiramisu) } func fixWindowsLineEndings(s string) string { From 4462c0b5ab023b280876942c7d072580f658afa9 Mon Sep 17 00:00:00 2001 From: Wilken Rivera Date: Thu, 25 Jun 2020 21:21:10 -0400 Subject: [PATCH 30/38] builder/googlecompute: Add WrapStartupScriptFile configuration option By default the Google builder will wrap any provided startup script file in order to track its execution via custom metadata. The wrapper script can add a bit of complexity to the start script file so a new option is being added `wrap_startup_script`. This option allows a user to disable the script wrapping and just let GCE do its own thing when executing a startup script. --- builder/googlecompute/config.go | 21 ++++++++- builder/googlecompute/config.hcl2spec.go | 2 + builder/googlecompute/step_create_instance.go | 31 ++++++------- .../step_create_instance_test.go | 43 +++++++++++++++++++ .../googlecompute/step_wait_startup_script.go | 5 ++- .../step_wait_startup_script_test.go | 34 +++++++++++++++ .../googlecompute/Config-not-required.mdx | 17 +++++++- 7 files changed, 133 insertions(+), 20 deletions(-) diff --git a/builder/googlecompute/config.go b/builder/googlecompute/config.go index b924ed92c..8d8ccfb04 100644 --- a/builder/googlecompute/config.go +++ b/builder/googlecompute/config.go @@ -192,9 +192,22 @@ type Config struct { // A list of project IDs to search for the source image. Packer will search the first // project ID in the list first, and fall back to the next in the list, until it finds the source image. SourceImageProjectId []string `mapstructure:"source_image_project_id" required:"false"` - // The path to a startup script to run on the VM from which the image will - // be made. + // The path to a startup script to run on the launched instance from which the image will + // be made. When set, the contents of the startup script file will be added to the instance metadata + // under the `"startup_script"` metadata property. See [Providing startup script contents directly](https://cloud.google.com/compute/docs/startupscript#providing_startup_script_contents_directly) for more details. + // + // When using `startup_script_file` the following rules apply: + // - The contents of the script file will overwrite the value of the `"startup_script"` metadata property at runtime. + // - The contents of the script file will be wrapped in Packer's startup script wrapper, unless `wrap_startup_script` is disabled. See `wrap_startup_script` for more details. + // - Not supported by Windows instances. See [Startup Scripts for Windows](https://cloud.google.com/compute/docs/startupscript#providing_a_startup_script_for_windows_instances) for more details. StartupScriptFile string `mapstructure:"startup_script_file" required:"false"` + // For backwards compatibility this option defaults to `"true"` in the future it will default to `"false"`. + // If "true", the contents of `startup_script_file` or `"startup_script"` in the instance metadata + // is wrapped in a Packer specific script that tracks the execution and completion of the provided + // startup script. The wrapper ensures that the builder will not continue until the startup script has been executed. + // - The use of the wrapped script file requires that the user or service account + // running the build has the compute.instance.Metadata role. + WrapStartupScriptFile config.Trilean `mapstructure:"wrap_startup_script" required:"false"` // The Google Compute subnetwork id or URL to use for the launched // instance. Only required if the network has been created with custom // subnetting. Note, the region of the subnetwork must match the region or @@ -448,6 +461,10 @@ func (c *Config) Prepare(raws ...interface{}) ([]string, error) { errs = packer.MultiErrorAppend( errs, fmt.Errorf("startup_script_file: %v", err)) } + + if c.WrapStartupScriptFile == config.TriUnset { + c.WrapStartupScriptFile = config.TriTrue + } } // Check for any errors. diff --git a/builder/googlecompute/config.hcl2spec.go b/builder/googlecompute/config.hcl2spec.go index e8ea31cb2..4b5513f02 100644 --- a/builder/googlecompute/config.hcl2spec.go +++ b/builder/googlecompute/config.hcl2spec.go @@ -102,6 +102,7 @@ type FlatConfig struct { SourceImageFamily *string `mapstructure:"source_image_family" required:"true" cty:"source_image_family" hcl:"source_image_family"` SourceImageProjectId []string `mapstructure:"source_image_project_id" required:"false" cty:"source_image_project_id" hcl:"source_image_project_id"` StartupScriptFile *string `mapstructure:"startup_script_file" required:"false" cty:"startup_script_file" hcl:"startup_script_file"` + WrapStartupScriptFile *bool `mapstructure:"wrap_startup_script" required:"false" cty:"wrap_startup_script" hcl:"wrap_startup_script"` Subnetwork *string `mapstructure:"subnetwork" required:"false" cty:"subnetwork" hcl:"subnetwork"` Tags []string `mapstructure:"tags" required:"false" cty:"tags" hcl:"tags"` UseInternalIP *bool `mapstructure:"use_internal_ip" required:"false" cty:"use_internal_ip" hcl:"use_internal_ip"` @@ -214,6 +215,7 @@ func (*FlatConfig) HCL2Spec() map[string]hcldec.Spec { "source_image_family": &hcldec.AttrSpec{Name: "source_image_family", Type: cty.String, Required: false}, "source_image_project_id": &hcldec.AttrSpec{Name: "source_image_project_id", Type: cty.List(cty.String), Required: false}, "startup_script_file": &hcldec.AttrSpec{Name: "startup_script_file", Type: cty.String, Required: false}, + "wrap_startup_script": &hcldec.AttrSpec{Name: "wrap_startup_script", Type: cty.Bool, Required: false}, "subnetwork": &hcldec.AttrSpec{Name: "subnetwork", Type: cty.String, Required: false}, "tags": &hcldec.AttrSpec{Name: "tags", Type: cty.List(cty.String), Required: false}, "use_internal_ip": &hcldec.AttrSpec{Name: "use_internal_ip", Type: cty.Bool, Required: false}, diff --git a/builder/googlecompute/step_create_instance.go b/builder/googlecompute/step_create_instance.go index 80733beb2..4eb86ad08 100644 --- a/builder/googlecompute/step_create_instance.go +++ b/builder/googlecompute/step_create_instance.go @@ -40,19 +40,30 @@ func (c *Config) createInstanceMetadata(sourceImage *Image, sshPublicKey string) instanceMetadata[sshMetaKey] = sshKeys } - // Wrap any startup script with our own startup script. + startupScript := instanceMetadata[StartupScriptKey] if c.StartupScriptFile != "" { var content []byte content, err = ioutil.ReadFile(c.StartupScriptFile) if err != nil { return nil, err } - instanceMetadata[StartupWrappedScriptKey] = string(content) - } else if wrappedStartupScript, exists := instanceMetadata[StartupScriptKey]; exists { - instanceMetadata[StartupWrappedScriptKey] = wrappedStartupScript + startupScript = string(content) + } + instanceMetadata[StartupScriptKey] = startupScript + + // Wrap any found startup script with our own startup script wrapper. + if startupScript != "" && c.WrapStartupScriptFile.True() { + instanceMetadata[StartupScriptKey] = StartupScriptLinux + instanceMetadata[StartupWrappedScriptKey] = startupScript + instanceMetadata[StartupScriptStatusKey] = StartupScriptStatusNotDone + } + + if sourceImage.IsWindows() { + // Windows startup script support is not yet implemented so clear any script data and set status to done + instanceMetadata[StartupScriptKey] = StartupScriptWindows + instanceMetadata[StartupScriptStatusKey] = StartupScriptStatusDone } - // Read metadata from files specified with metadata_files for key, value := range c.MetadataFiles { var content []byte content, err = ioutil.ReadFile(value) @@ -62,16 +73,6 @@ func (c *Config) createInstanceMetadata(sourceImage *Image, sshPublicKey string) instanceMetadata[key] = string(content) } - if sourceImage.IsWindows() { - // Windows startup script support is not yet implemented. - // Mark the startup script as done. - instanceMetadata[StartupScriptKey] = StartupScriptWindows - instanceMetadata[StartupScriptStatusKey] = StartupScriptStatusDone - } else { - instanceMetadata[StartupScriptKey] = StartupScriptLinux - instanceMetadata[StartupScriptStatusKey] = StartupScriptStatusNotDone - } - if errs != nil && len(errs.Errors) > 0 { return instanceMetadata, errs } diff --git a/builder/googlecompute/step_create_instance_test.go b/builder/googlecompute/step_create_instance_test.go index ce64a99d6..82ccfe881 100644 --- a/builder/googlecompute/step_create_instance_test.go +++ b/builder/googlecompute/step_create_instance_test.go @@ -3,10 +3,12 @@ package googlecompute import ( "context" "errors" + "fmt" "strings" "testing" "time" + "github.com/hashicorp/packer/helper/config" "github.com/hashicorp/packer/helper/multistep" "github.com/stretchr/testify/assert" ) @@ -342,3 +344,44 @@ func TestCreateInstanceMetadata_metadataFile(t *testing.T) { // ensure the user-data key in metadata is updated with file content assert.Equal(t, metadata["user-data"], content, "user-data field of the instance metadata should have been updated.") } + +func TestCreateInstanceMetadata_withWrapStartupScript(t *testing.T) { + tt := []struct { + WrapStartupScript config.Trilean + StartupScriptContents string + WrappedStartupScriptContents string + WrappedStartupScriptStatus string + }{ + { + WrapStartupScript: config.TriUnset, + StartupScriptContents: testMetadataFileContent, + }, + { + WrapStartupScript: config.TriFalse, + StartupScriptContents: testMetadataFileContent, + }, + { + WrapStartupScript: config.TriTrue, + StartupScriptContents: StartupScriptLinux, + WrappedStartupScriptContents: testMetadataFileContent, + WrappedStartupScriptStatus: StartupScriptStatusNotDone, + }, + } + + for _, tc := range tt { + tc := tc + state := testState(t) + image := StubImage("test-image", "test-project", []string{}, 100) + c := state.Get("config").(*Config) + c.StartupScriptFile = testMetadataFile(t) + c.WrapStartupScriptFile = tc.WrapStartupScript + + // create our metadata + metadata, err := c.createInstanceMetadata(image, "") + + assert.True(t, err == nil, "Metadata creation should have succeeded.") + assert.Equal(t, tc.StartupScriptContents, metadata[StartupScriptKey], fmt.Sprintf("Instance metadata for startup script should be %q.", tc.StartupScriptContents)) + assert.Equal(t, tc.WrappedStartupScriptContents, metadata[StartupWrappedScriptKey], fmt.Sprintf("Instance metadata for wrapped startup script should be %q.", tc.WrappedStartupScriptContents)) + assert.Equal(t, tc.WrappedStartupScriptStatus, metadata[StartupScriptStatusKey], fmt.Sprintf("Instance metadata startup script status should be %q.", tc.WrappedStartupScriptStatus)) + } +} diff --git a/builder/googlecompute/step_wait_startup_script.go b/builder/googlecompute/step_wait_startup_script.go index ede82ba8c..8bde22f7e 100644 --- a/builder/googlecompute/step_wait_startup_script.go +++ b/builder/googlecompute/step_wait_startup_script.go @@ -21,8 +21,11 @@ func (s *StepWaitStartupScript) Run(ctx context.Context, state multistep.StateBa ui := state.Get("ui").(packer.Ui) instanceName := state.Get("instance_name").(string) - ui.Say("Waiting for any running startup script to finish...") + if config.WrapStartupScriptFile.False() { + return multistep.ActionContinue + } + ui.Say("Waiting for any running startup script to finish...") // Keep checking the serial port output to see if the startup script is done. err := retry.Config{ ShouldRetry: func(error) bool { diff --git a/builder/googlecompute/step_wait_startup_script_test.go b/builder/googlecompute/step_wait_startup_script_test.go index a970dc48d..0bbe242ba 100644 --- a/builder/googlecompute/step_wait_startup_script_test.go +++ b/builder/googlecompute/step_wait_startup_script_test.go @@ -4,6 +4,7 @@ import ( "context" "testing" + "github.com/hashicorp/packer/helper/config" "github.com/hashicorp/packer/helper/multistep" "github.com/stretchr/testify/assert" ) @@ -30,3 +31,36 @@ func TestStepWaitStartupScript(t *testing.T) { assert.Equal(t, d.GetInstanceMetadataZone, testZone, "Incorrect zone passed to GetInstanceMetadata.") assert.Equal(t, d.GetInstanceMetadataName, testInstanceName, "Incorrect instance name passed to GetInstanceMetadata.") } + +func TestStepWaitStartupScript_withWrapStartupScript(t *testing.T) { + tt := []struct { + WrapStartup config.Trilean + Result, Zone, MetadataName string + }{ + {WrapStartup: config.TriTrue, Result: StartupScriptStatusDone, Zone: "test-zone", MetadataName: "test-instance-name"}, + {WrapStartup: config.TriFalse}, + } + + for _, tc := range tt { + tc := tc + state := testState(t) + step := new(StepWaitStartupScript) + c := state.Get("config").(*Config) + d := state.Get("driver").(*DriverMock) + + c.StartupScriptFile = "startup.sh" + c.WrapStartupScriptFile = tc.WrapStartup + c.Zone = "test-zone" + state.Put("instance_name", "test-instance-name") + + // This step stops when it gets Done back from the metadata. + d.GetInstanceMetadataResult = tc.Result + + // Run the step. + assert.Equal(t, step.Run(context.Background(), state), multistep.ActionContinue, "Step should have continued.") + + assert.Equal(t, d.GetInstanceMetadataResult, tc.Result, "MetadataResult was not the expected value.") + assert.Equal(t, d.GetInstanceMetadataZone, tc.Zone, "Zone was not the expected value.") + assert.Equal(t, d.GetInstanceMetadataName, tc.MetadataName, "Instance name was not the expected value.") + } +} diff --git a/website/pages/partials/builder/googlecompute/Config-not-required.mdx b/website/pages/partials/builder/googlecompute/Config-not-required.mdx index 81528813e..d33a72d04 100644 --- a/website/pages/partials/builder/googlecompute/Config-not-required.mdx +++ b/website/pages/partials/builder/googlecompute/Config-not-required.mdx @@ -148,8 +148,21 @@ - `source_image_project_id` ([]string) - A list of project IDs to search for the source image. Packer will search the first project ID in the list first, and fall back to the next in the list, until it finds the source image. -- `startup_script_file` (string) - The path to a startup script to run on the VM from which the image will - be made. +- `startup_script_file` (string) - The path to a startup script to run on the launched instance from which the image will + be made. When set, the contents of the startup script file will be added to the instance metadata + under the `"startup_script"` metadata property. See [Providing startup script contents directly](https://cloud.google.com/compute/docs/startupscript#providing_startup_script_contents_directly) for more details. + + When using `startup_script_file` the following rules apply: + - The contents of the script file will overwrite the value of the `"startup_script"` metadata property at runtime. + - The contents of the script file will be wrapped in Packer's startup script wrapper, unless `wrap_startup_script` is disabled. See `wrap_startup_script` for more details. + - Not supported by Windows instances. See [Startup Scripts for Windows](https://cloud.google.com/compute/docs/startupscript#providing_a_startup_script_for_windows_instances) for more details. + +- `wrap_startup_script` (boolean) - For backwards compatibility this option defaults to `"true"` in the future it will default to `"false"`. + If "true", the contents of `startup_script_file` or `"startup_script"` in the instance metadata + is wrapped in a Packer specific script that tracks the execution and completion of the provided + startup script. The wrapper ensures that the builder will not continue until the startup script has been executed. + - The use of the wrapped script file requires that the user or service account + running the build has the compute.instance.Metadata role. - `subnetwork` (string) - The Google Compute subnetwork id or URL to use for the launched instance. Only required if the network has been created with custom From a4d1afb83ad33ed840956f0299ad8b43777c65ae Mon Sep 17 00:00:00 2001 From: Lyle Franklin Date: Tue, 7 Jul 2020 10:22:30 -0400 Subject: [PATCH 31/38] Add 'cdrom_interface' option to QEMU builder (#9483) - This option allows the user to select the interface type for the CDROM drive, e.g. `virtio-scsi`, rather than the default `virtio` - Background: Installation of Ubuntu 20.04 on ARM64 fails as it can't mount the installation CDROM. While the default `virtio` CDROM fails, setting `cdrom_interface: virtio-scsi` with this PR succeeds. Some links: - ISO link: http://cdimage.ubuntu.com/ubuntu-legacy-server/releases/20.04/release/ubuntu-20.04-legacy-server-arm64.iso - https://bugs.launchpad.net/ubuntu/+source/debian-installer/+bug/1605407 - https://superuser.com/a/1376628/230508 --- builder/qemu/builder.go | 5 +++++ builder/qemu/builder.hcl2spec.go | 2 ++ builder/qemu/step_run.go | 14 +++++++++++--- .../partials/builder/qemu/Config-not-required.mdx | 5 +++++ 4 files changed, 23 insertions(+), 3 deletions(-) diff --git a/builder/qemu/builder.go b/builder/qemu/builder.go index 6b0686f64..95149782b 100644 --- a/builder/qemu/builder.go +++ b/builder/qemu/builder.go @@ -316,6 +316,11 @@ type Config struct { // "BUILDNAME" is the name of the build. Currently, no file extension will be // used unless it is specified in this option. VMName string `mapstructure:"vm_name" required:"false"` + // The interface to use for the CDROM device which contains the ISO image. + // Allowed values include any of `ide`, `scsi`, `virtio` or + // `virtio-scsi`. The Qemu builder uses `virtio` by default. + // Some ARM64 images require `virtio-scsi`. + CDROMInterface string `mapstructure:"cdrom_interface" required:"false"` // TODO(mitchellh): deprecate RunOnce bool `mapstructure:"run_once"` diff --git a/builder/qemu/builder.hcl2spec.go b/builder/qemu/builder.hcl2spec.go index be4ddc7e9..18977892c 100644 --- a/builder/qemu/builder.hcl2spec.go +++ b/builder/qemu/builder.hcl2spec.go @@ -115,6 +115,7 @@ type FlatConfig struct { VNCPortMin *int `mapstructure:"vnc_port_min" required:"false" cty:"vnc_port_min" hcl:"vnc_port_min"` VNCPortMax *int `mapstructure:"vnc_port_max" cty:"vnc_port_max" hcl:"vnc_port_max"` VMName *string `mapstructure:"vm_name" required:"false" cty:"vm_name" hcl:"vm_name"` + CDROMInterface *string `mapstructure:"cdrom_interface" required:"false" cty:"cdrom_interface" hcl:"cdrom_interface"` RunOnce *bool `mapstructure:"run_once" cty:"run_once" hcl:"run_once"` } @@ -236,6 +237,7 @@ func (*FlatConfig) HCL2Spec() map[string]hcldec.Spec { "vnc_port_min": &hcldec.AttrSpec{Name: "vnc_port_min", Type: cty.Number, Required: false}, "vnc_port_max": &hcldec.AttrSpec{Name: "vnc_port_max", Type: cty.Number, Required: false}, "vm_name": &hcldec.AttrSpec{Name: "vm_name", Type: cty.String, Required: false}, + "cdrom_interface": &hcldec.AttrSpec{Name: "cdrom_interface", Type: cty.String, Required: false}, "run_once": &hcldec.AttrSpec{Name: "run_once", Type: cty.Bool, Required: false}, } return s diff --git a/builder/qemu/step_run.go b/builder/qemu/step_run.go index 10727530e..5a3a2d708 100644 --- a/builder/qemu/step_run.go +++ b/builder/qemu/step_run.go @@ -191,12 +191,20 @@ func getCommandArgs(bootDrive string, state multistep.StateBag) ([]string, error } } + if !config.DiskImage { + if config.CDROMInterface == "" { + defaultArgs["-cdrom"] = isoPath + } else if config.CDROMInterface == "virtio-scsi" { + driveArgs = append(driveArgs, fmt.Sprintf("file=%s,if=none,id=cdrom,media=cdrom", isoPath)) + deviceArgs = append(deviceArgs, "virtio-scsi-device", "scsi-cd,drive=cdrom") + } else { + driveArgs = append(driveArgs, fmt.Sprintf("file=%s,if=%s,id=cdrom,media=cdrom", isoPath, config.CDROMInterface)) + } + } + defaultArgs["-device"] = deviceArgs defaultArgs["-drive"] = driveArgs - if !config.DiskImage { - defaultArgs["-cdrom"] = isoPath - } defaultArgs["-boot"] = bootDrive defaultArgs["-m"] = fmt.Sprintf("%dM", config.MemorySize) if config.CpuCount > 1 { diff --git a/website/pages/partials/builder/qemu/Config-not-required.mdx b/website/pages/partials/builder/qemu/Config-not-required.mdx index d6a40041e..f8c42c402 100644 --- a/website/pages/partials/builder/qemu/Config-not-required.mdx +++ b/website/pages/partials/builder/qemu/Config-not-required.mdx @@ -238,4 +238,9 @@ the new virtual machine. By default this is packer-BUILDNAME, where "BUILDNAME" is the name of the build. Currently, no file extension will be used unless it is specified in this option. + +- `cdrom_interface` (string) - The interface to use for the CDROM device which contains the ISO image. + Allowed values include any of `ide`, `scsi`, `virtio` or + `virtio-scsi`. The Qemu builder uses `virtio` by default. + Some ARM64 images require `virtio-scsi`. \ No newline at end of file From 03d29386dd92d45ad3ada54dc282f229f7bed526 Mon Sep 17 00:00:00 2001 From: Adrien Delorme Date: Tue, 7 Jul 2020 16:50:15 +0200 Subject: [PATCH 32/38] fix error message typo (#9541) --- hcl2template/types.hcl_post-processor.go | 2 +- hcl2template/types.hcl_provisioner.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hcl2template/types.hcl_post-processor.go b/hcl2template/types.hcl_post-processor.go index 0afec4d4b..bc87e962f 100644 --- a/hcl2template/types.hcl_post-processor.go +++ b/hcl2template/types.hcl_post-processor.go @@ -36,7 +36,7 @@ func (p *HCL2PostProcessor) HCL2Prepare(buildVars map[string]interface{}) error case string: buildValues[k] = cty.StringVal(v) default: - return fmt.Errorf("unhandled builvar type: %T", v) + return fmt.Errorf("unhandled buildvar type: %T", v) } } ectx.Variables = map[string]cty.Value{ diff --git a/hcl2template/types.hcl_provisioner.go b/hcl2template/types.hcl_provisioner.go index 3ea1e35dc..26338231a 100644 --- a/hcl2template/types.hcl_provisioner.go +++ b/hcl2template/types.hcl_provisioner.go @@ -36,7 +36,7 @@ func (p *HCL2Provisioner) HCL2Prepare(buildVars map[string]interface{}) error { case string: buildValues[k] = cty.StringVal(v) default: - return fmt.Errorf("unhandled builvar type: %T", v) + return fmt.Errorf("unhandled buildvar type: %T", v) } } ectx.Variables = map[string]cty.Value{ From 892413b7ea4daa0b8a984c43047e9312d272dba7 Mon Sep 17 00:00:00 2001 From: Wilken Rivera Date: Tue, 7 Jul 2020 13:57:51 -0400 Subject: [PATCH 33/38] docs/builder/vsphere-iso: Add documentation for BootConfig (#9538) * docs/builder/vsphere-iso: Add documentation for BootConfig * Add documenation for http_ip * Remove duplicate build configuration section --- builder/vsphere/common/step_boot_command.go | 5 +- .../docs/builders/vmware/vsphere-clone.mdx | 3 +- .../docs/builders/vmware/vsphere-iso.mdx | 52 ++++++++++--------- .../common/BootConfig-not-required.mdx | 5 ++ 4 files changed, 37 insertions(+), 28 deletions(-) create mode 100644 website/pages/partials/builder/vsphere/common/BootConfig-not-required.mdx diff --git a/builder/vsphere/common/step_boot_command.go b/builder/vsphere/common/step_boot_command.go index c7aceaf4e..4949ff0d6 100644 --- a/builder/vsphere/common/step_boot_command.go +++ b/builder/vsphere/common/step_boot_command.go @@ -1,3 +1,4 @@ +//go:generate struct-markdown package common import ( @@ -15,7 +16,9 @@ import ( type BootConfig struct { bootcommand.BootConfig `mapstructure:",squash"` - HTTPIP string `mapstructure:"http_ip"` + // The IP address to use for the HTTP server started to serve the `http_directory`. + // If unset, Packer will automatically discover and assign an IP. + HTTPIP string `mapstructure:"http_ip"` } type bootCommandTemplateData struct { diff --git a/website/pages/docs/builders/vmware/vsphere-clone.mdx b/website/pages/docs/builders/vmware/vsphere-clone.mdx index ee39316f4..361300eb1 100644 --- a/website/pages/docs/builders/vmware/vsphere-clone.mdx +++ b/website/pages/docs/builders/vmware/vsphere-clone.mdx @@ -54,8 +54,7 @@ necessary for this build to succeed and can be found further down the page. @include 'common/bootcommand/BootConfig-not-required.mdx' -For more examples of various boot commands, see the sample projects from our -[community templates page](/community-tools#templates). +@include 'builder/vsphere/common/BootConfig-not-required.mdx' ### Http directory configuration diff --git a/website/pages/docs/builders/vmware/vsphere-iso.mdx b/website/pages/docs/builders/vmware/vsphere-iso.mdx index 6aa4a6bb0..47774cfda 100644 --- a/website/pages/docs/builders/vmware/vsphere-iso.mdx +++ b/website/pages/docs/builders/vmware/vsphere-iso.mdx @@ -41,6 +41,33 @@ necessary for this build to succeed and can be found further down the page. @include 'builder/vsphere/iso/Config-not-required.mdx' +### Boot Configuration + +@include 'common/bootcommand/BootConfig.mdx' + +We send each character to the VM with a default delay of 100ms between groups. +The delay alleviates possible issues with latency and CPU +contention. If you notice missing keys, you can tune this delay by specifying +"boot_keygroup_interval" in your Packer template, for example: + +```json +{ + "builders": [ + { + "type": "vsphere-iso", + "boot_keygroup_interval": "500ms" + ... + } + ] +} +``` + +#### Optional: + +@include 'common/bootcommand/BootConfig-not-required.mdx' + +@include 'builder/vsphere/common/BootConfig-not-required.mdx' + ### Http directory configuration @include 'common/HTTPConfig.mdx' @@ -162,31 +189,6 @@ from the datastore. Example: @include 'helper/communicator/WinRM-not-required.mdx' -## Boot Configuration - -@include 'common/bootcommand/BootConfig.mdx' - -We send each character to the VM with a default delay of 100ms between groups. -The delay alleviates possible issues with latency and CPU -contention. If you notice missing keys, you can tune this delay by specifying -"boot_keygroup_interval" in your Packer template, for example: - -```json -{ - "builders": [ - { - "type": "vsphere-iso", - "boot_keygroup_interval": "500ms" - ... - } - ] -} -``` - -#### Optional: - -@include 'common/bootcommand/BootConfig-not-required.mdx' - ## Working with Clusters #### Standalone Hosts diff --git a/website/pages/partials/builder/vsphere/common/BootConfig-not-required.mdx b/website/pages/partials/builder/vsphere/common/BootConfig-not-required.mdx new file mode 100644 index 000000000..880321a0f --- /dev/null +++ b/website/pages/partials/builder/vsphere/common/BootConfig-not-required.mdx @@ -0,0 +1,5 @@ + + +- `http_ip` (string) - The IP address to use for the HTTP server started to serve the `http_directory`. + If unset, Packer will automatically discover and assign an IP. + \ No newline at end of file From 268e95364fec8b61a6f8f539ad2e27e57bf34991 Mon Sep 17 00:00:00 2001 From: Sylvia Moss Date: Wed, 8 Jul 2020 10:33:45 +0200 Subject: [PATCH 34/38] Adds vApp properties config and save public ssh key to a vApp property (#9507) --- builder/vsphere/clone/builder.go | 6 + builder/vsphere/clone/config.hcl2spec.go | 2 + builder/vsphere/clone/step_clone.go | 36 ++++-- builder/vsphere/clone/step_clone.hcl2spec.go | 37 +++++- builder/vsphere/common/step_ssh_key_pair.go | 115 ++++++++++++++++++ builder/vsphere/driver/vm.go | 100 +++++++++++++-- .../docs/builders/vmware/vsphere-clone.mdx | 54 ++++++++ .../clone/CloneConfig-not-required.mdx | 4 + .../vsphere/clone/vAppConfig-not-required.mdx | 10 ++ 9 files changed, 339 insertions(+), 25 deletions(-) create mode 100644 builder/vsphere/common/step_ssh_key_pair.go create mode 100644 website/pages/partials/builder/vsphere/clone/vAppConfig-not-required.mdx diff --git a/builder/vsphere/clone/builder.go b/builder/vsphere/clone/builder.go index 0f68d33c3..1e5b1c4a0 100644 --- a/builder/vsphere/clone/builder.go +++ b/builder/vsphere/clone/builder.go @@ -2,6 +2,7 @@ package clone import ( "context" + "fmt" "github.com/hashicorp/hcl/v2/hcldec" "github.com/hashicorp/packer/builder/vsphere/common" @@ -65,6 +66,11 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack HTTPPortMax: b.config.HTTPPortMax, HTTPAddress: b.config.HTTPAddress, }, + &common.StepSshKeyPair{ + Debug: b.config.PackerDebug, + DebugKeyPath: fmt.Sprintf("%s.pem", b.config.PackerBuildName), + Comm: &b.config.Comm, + }, &common.StepRun{ Config: &b.config.RunConfig, SetOrder: false, diff --git a/builder/vsphere/clone/config.hcl2spec.go b/builder/vsphere/clone/config.hcl2spec.go index e769cd496..267b232df 100644 --- a/builder/vsphere/clone/config.hcl2spec.go +++ b/builder/vsphere/clone/config.hcl2spec.go @@ -31,6 +31,7 @@ type FlatConfig struct { LinkedClone *bool `mapstructure:"linked_clone" cty:"linked_clone" hcl:"linked_clone"` Network *string `mapstructure:"network" cty:"network" hcl:"network"` Notes *string `mapstructure:"notes" cty:"notes" hcl:"notes"` + VAppConfig *FlatvAppConfig `mapstructure:"vapp" cty:"vapp" hcl:"vapp"` VMName *string `mapstructure:"vm_name" cty:"vm_name" hcl:"vm_name"` Folder *string `mapstructure:"folder" cty:"folder" hcl:"folder"` Cluster *string `mapstructure:"cluster" cty:"cluster" hcl:"cluster"` @@ -147,6 +148,7 @@ func (*FlatConfig) HCL2Spec() map[string]hcldec.Spec { "linked_clone": &hcldec.AttrSpec{Name: "linked_clone", Type: cty.Bool, Required: false}, "network": &hcldec.AttrSpec{Name: "network", Type: cty.String, Required: false}, "notes": &hcldec.AttrSpec{Name: "notes", Type: cty.String, Required: false}, + "vapp": &hcldec.BlockSpec{TypeName: "vapp", Nested: hcldec.ObjectSpec((*FlatvAppConfig)(nil).HCL2Spec())}, "vm_name": &hcldec.AttrSpec{Name: "vm_name", Type: cty.String, Required: false}, "folder": &hcldec.AttrSpec{Name: "folder", Type: cty.String, Required: false}, "cluster": &hcldec.AttrSpec{Name: "cluster", Type: cty.String, Required: false}, diff --git a/builder/vsphere/clone/step_clone.go b/builder/vsphere/clone/step_clone.go index 9f5cd5f62..de6448ff7 100644 --- a/builder/vsphere/clone/step_clone.go +++ b/builder/vsphere/clone/step_clone.go @@ -1,5 +1,5 @@ //go:generate struct-markdown -//go:generate mapstructure-to-hcl2 -type CloneConfig +//go:generate mapstructure-to-hcl2 -type CloneConfig,vAppConfig package clone @@ -14,6 +14,17 @@ import ( "github.com/hashicorp/packer/packer" ) +type vAppConfig struct { + // Set values for the available vApp Properties to supply configuration parameters to a virtual machine cloned from + // a template that came from an imported OVF or OVA file. + // + // -> **Note:** The only supported usage path for vApp properties is for existing user-configurable keys. + // These generally come from an existing template that was created from an imported OVF or OVA file. + // You cannot set values for vApp properties on virtual machines created from scratch, + // virtual machines lacking a vApp configuration, or on property keys that do not exist. + Properties map[string]string `mapstructure:"properties"` +} + type CloneConfig struct { // Name of source VM. Path is optional. Template string `mapstructure:"template"` @@ -26,6 +37,10 @@ type CloneConfig struct { Network string `mapstructure:"network"` // VM notes. Notes string `mapstructure:"notes"` + // Set the vApp Options to a virtual machine. + // See the [vApp Options Configuration](/docs/builders/vmware/vsphere-clone#vapp-options-configuration) + // to know the available options and how to use it. + VAppConfig vAppConfig `mapstructure:"vapp"` } func (c *CloneConfig) Prepare() []error { @@ -67,15 +82,16 @@ func (s *StepCloneVM) Run(ctx context.Context, state multistep.StateBag) multist } vm, err := template.Clone(ctx, &driver.CloneConfig{ - Name: s.Location.VMName, - Folder: s.Location.Folder, - Cluster: s.Location.Cluster, - Host: s.Location.Host, - ResourcePool: s.Location.ResourcePool, - Datastore: s.Location.Datastore, - LinkedClone: s.Config.LinkedClone, - Network: s.Config.Network, - Annotation: s.Config.Notes, + Name: s.Location.VMName, + Folder: s.Location.Folder, + Cluster: s.Location.Cluster, + Host: s.Location.Host, + ResourcePool: s.Location.ResourcePool, + Datastore: s.Location.Datastore, + LinkedClone: s.Config.LinkedClone, + Network: s.Config.Network, + Annotation: s.Config.Notes, + VAppProperties: s.Config.VAppConfig.Properties, }) if err != nil { state.Put("error", err) diff --git a/builder/vsphere/clone/step_clone.hcl2spec.go b/builder/vsphere/clone/step_clone.hcl2spec.go index d7bd87301..a9f670f94 100644 --- a/builder/vsphere/clone/step_clone.hcl2spec.go +++ b/builder/vsphere/clone/step_clone.hcl2spec.go @@ -1,4 +1,4 @@ -// Code generated by "mapstructure-to-hcl2 -type CloneConfig"; DO NOT EDIT. +// Code generated by "mapstructure-to-hcl2 -type CloneConfig,vAppConfig"; DO NOT EDIT. package clone import ( @@ -9,11 +9,12 @@ import ( // FlatCloneConfig is an auto-generated flat version of CloneConfig. // Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. type FlatCloneConfig struct { - Template *string `mapstructure:"template" cty:"template" hcl:"template"` - DiskSize *int64 `mapstructure:"disk_size" cty:"disk_size" hcl:"disk_size"` - LinkedClone *bool `mapstructure:"linked_clone" cty:"linked_clone" hcl:"linked_clone"` - Network *string `mapstructure:"network" cty:"network" hcl:"network"` - Notes *string `mapstructure:"notes" cty:"notes" hcl:"notes"` + Template *string `mapstructure:"template" cty:"template" hcl:"template"` + DiskSize *int64 `mapstructure:"disk_size" cty:"disk_size" hcl:"disk_size"` + LinkedClone *bool `mapstructure:"linked_clone" cty:"linked_clone" hcl:"linked_clone"` + Network *string `mapstructure:"network" cty:"network" hcl:"network"` + Notes *string `mapstructure:"notes" cty:"notes" hcl:"notes"` + VAppConfig *FlatvAppConfig `mapstructure:"vapp" cty:"vapp" hcl:"vapp"` } // FlatMapstructure returns a new FlatCloneConfig. @@ -33,6 +34,30 @@ func (*FlatCloneConfig) HCL2Spec() map[string]hcldec.Spec { "linked_clone": &hcldec.AttrSpec{Name: "linked_clone", Type: cty.Bool, Required: false}, "network": &hcldec.AttrSpec{Name: "network", Type: cty.String, Required: false}, "notes": &hcldec.AttrSpec{Name: "notes", Type: cty.String, Required: false}, + "vapp": &hcldec.BlockSpec{TypeName: "vapp", Nested: hcldec.ObjectSpec((*FlatvAppConfig)(nil).HCL2Spec())}, + } + return s +} + +// FlatvAppConfig is an auto-generated flat version of vAppConfig. +// Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. +type FlatvAppConfig struct { + Properties map[string]string `mapstructure:"properties" cty:"properties" hcl:"properties"` +} + +// FlatMapstructure returns a new FlatvAppConfig. +// FlatvAppConfig is an auto-generated flat version of vAppConfig. +// Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. +func (*vAppConfig) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { + return new(FlatvAppConfig) +} + +// HCL2Spec returns the hcl spec of a vAppConfig. +// This spec is used by HCL to read the fields of vAppConfig. +// The decoded values from this spec will then be applied to a FlatvAppConfig. +func (*FlatvAppConfig) HCL2Spec() map[string]hcldec.Spec { + s := map[string]hcldec.Spec{ + "properties": &hcldec.AttrSpec{Name: "properties", Type: cty.Map(cty.String), Required: false}, } return s } diff --git a/builder/vsphere/common/step_ssh_key_pair.go b/builder/vsphere/common/step_ssh_key_pair.go new file mode 100644 index 000000000..d094a0cb5 --- /dev/null +++ b/builder/vsphere/common/step_ssh_key_pair.go @@ -0,0 +1,115 @@ +package common + +import ( + "context" + "fmt" + "io/ioutil" + "os" + + "github.com/hashicorp/packer/builder/vsphere/driver" + "github.com/hashicorp/packer/common/uuid" + "github.com/hashicorp/packer/helper/communicator" + "github.com/hashicorp/packer/helper/multistep" + "github.com/hashicorp/packer/helper/ssh" + "github.com/hashicorp/packer/packer" +) + +// StepSshKeyPair executes the business logic for setting the SSH key pair in +// the specified communicator.Config. +type StepSshKeyPair struct { + Debug bool + DebugKeyPath string + Comm *communicator.Config +} + +func (s *StepSshKeyPair) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { + if s.Comm.Type != "ssh" || s.Comm.SSHPassword != "" { + return multistep.ActionContinue + } + + ui := state.Get("ui").(packer.Ui) + + comment := fmt.Sprintf("packer_%s", uuid.TimeOrderedUUID()) + if s.Comm.SSHPrivateKeyFile != "" { + ui.Say("Using existing SSH private key for the communicator...") + privateKeyBytes, err := s.Comm.ReadSSHPrivateKeyFile() + if err != nil { + state.Put("error", err) + return multistep.ActionHalt + } + + kp, err := ssh.KeyPairFromPrivateKey(ssh.FromPrivateKeyConfig{ + RawPrivateKeyPemBlock: privateKeyBytes, + Comment: comment, + }) + if err != nil { + state.Put("error", err) + return multistep.ActionHalt + } + + s.Comm.SSHPrivateKey = privateKeyBytes + s.Comm.SSHKeyPairName = kp.Comment + s.Comm.SSHTemporaryKeyPairName = kp.Comment + s.Comm.SSHPublicKey = kp.PublicKeyAuthorizedKeysLine + + return multistep.ActionContinue + } + + if s.Comm.SSHAgentAuth { + ui.Say("Using local SSH Agent to authenticate connections for the communicator...") + return multistep.ActionContinue + } + + ui.Say("Creating ephemeral key pair for SSH communicator...") + + if s.Comm.SSHTemporaryKeyPairName != "" { + comment = s.Comm.SSHTemporaryKeyPairName + } + + kp, err := ssh.NewKeyPair(ssh.CreateKeyPairConfig{ + Comment: comment, + Type: ssh.Rsa, + }) + if err != nil { + state.Put("error", fmt.Errorf("Error creating temporary keypair: %s", err)) + return multistep.ActionHalt + } + + s.Comm.SSHKeyPairName = kp.Comment + s.Comm.SSHTemporaryKeyPairName = kp.Comment + s.Comm.SSHPrivateKey = kp.PrivateKeyPemBlock + s.Comm.SSHPublicKey = kp.PublicKeyAuthorizedKeysLine + s.Comm.SSHClearAuthorizedKeys = true + + vm := state.Get("vm").(*driver.VirtualMachine) + err = vm.AddPublicKeys(ctx, string(s.Comm.SSHPublicKey)) + if err != nil { + state.Put("error", fmt.Errorf("error saving temporary keypair in the vm: %s", err)) + return multistep.ActionHalt + } + + ui.Say("Created ephemeral SSH key pair for communicator") + + // If we're in debug mode, output the private key to the working + // directory. + if s.Debug { + ui.Message(fmt.Sprintf("Saving communicator private key for debug purposes: %s", s.DebugKeyPath)) + // Write the key out + if err := ioutil.WriteFile(s.DebugKeyPath, kp.PrivateKeyPemBlock, 0600); err != nil { + state.Put("error", fmt.Errorf("Error saving debug key: %s", err)) + return multistep.ActionHalt + } + } + + return multistep.ActionContinue +} + +func (s *StepSshKeyPair) Cleanup(state multistep.StateBag) { + if s.Debug { + if err := os.Remove(s.DebugKeyPath); err != nil { + ui := state.Get("ui").(packer.Ui) + ui.Error(fmt.Sprintf( + "Error removing debug key '%s': %s", s.DebugKeyPath, err)) + } + } +} diff --git a/builder/vsphere/driver/vm.go b/builder/vsphere/driver/vm.go index 8d1372282..cae885e1e 100644 --- a/builder/vsphere/driver/vm.go +++ b/builder/vsphere/driver/vm.go @@ -6,6 +6,7 @@ import ( "fmt" "log" "net" + "reflect" "strings" "time" @@ -26,15 +27,16 @@ type VirtualMachine struct { } type CloneConfig struct { - Name string - Folder string - Cluster string - Host string - ResourcePool string - Datastore string - LinkedClone bool - Network string - Annotation string + Name string + Folder string + Cluster string + Host string + ResourcePool string + Datastore string + LinkedClone bool + Network string + Annotation string + VAppProperties map[string]string } type HardwareConfig struct { @@ -315,6 +317,12 @@ func (vm *VirtualMachine) Clone(ctx context.Context, config *CloneConfig) (*Virt configSpec.DeviceChange = append(configSpec.DeviceChange, config) } + vAppConfig, err := vm.updateVAppConfig(ctx, config.VAppProperties) + if err != nil { + return nil, err + } + configSpec.VAppConfig = vAppConfig + task, err := vm.vm.Clone(vm.driver.ctx, folder.folder, config.Name, cloneSpec) if err != nil { return nil, err @@ -339,6 +347,80 @@ func (vm *VirtualMachine) Clone(ctx context.Context, config *CloneConfig) (*Virt return created, nil } +func (vm *VirtualMachine) updateVAppConfig(ctx context.Context, newProps map[string]string) (*types.VmConfigSpec, error) { + if len(newProps) == 0 { + return nil, nil + } + + vProps, _ := vm.Properties(ctx) + if vProps.Config.VAppConfig == nil { + return nil, fmt.Errorf("this VM lacks a vApp configuration and cannot have vApp properties set on it") + } + + allProperties := vProps.Config.VAppConfig.GetVmConfigInfo().Property + + var props []types.VAppPropertySpec + for _, p := range allProperties { + userValue, setByUser := newProps[p.Id] + if !setByUser { + continue + } + + if *p.UserConfigurable == false { + return nil, fmt.Errorf("vApp property with userConfigurable=false specified in vapp.properties: %+v", reflect.ValueOf(newProps).MapKeys()) + } + + prop := types.VAppPropertySpec{ + ArrayUpdateSpec: types.ArrayUpdateSpec{ + Operation: types.ArrayUpdateOperationEdit, + }, + Info: &types.VAppPropertyInfo{ + Key: p.Key, + Id: p.Id, + Value: userValue, + UserConfigurable: p.UserConfigurable, + }, + } + props = append(props, prop) + + delete(newProps, p.Id) + } + + if len(newProps) > 0 { + return nil, fmt.Errorf("unsupported vApp properties in vapp.properties: %+v", reflect.ValueOf(newProps).MapKeys()) + } + + return &types.VmConfigSpec{ + Property: props, + }, nil +} + +func (vm *VirtualMachine) AddPublicKeys(ctx context.Context, publicKeys string) error { + newProps := map[string]string{"public-keys": publicKeys} + config, err := vm.updateVAppConfig(ctx, newProps) + if err != nil { + return fmt.Errorf("not possible to save temporary public key: %s", err.Error()) + } + + confSpec := types.VirtualMachineConfigSpec{VAppConfig: config} + task, err := vm.vm.Reconfigure(vm.driver.ctx, confSpec) + if err != nil { + return err + } + + _, err = task.WaitForResult(vm.driver.ctx, nil) + return err +} + +func (vm *VirtualMachine) Properties(ctx context.Context) (*mo.VirtualMachine, error) { + log.Printf("fetching properties for VM %q", vm.vm.InventoryPath) + var props mo.VirtualMachine + if err := vm.vm.Properties(ctx, vm.vm.Reference(), nil, &props); err != nil { + return nil, err + } + return &props, nil +} + func (vm *VirtualMachine) Destroy() error { task, err := vm.vm.Destroy(vm.driver.ctx) if err != nil { diff --git a/website/pages/docs/builders/vmware/vsphere-clone.mdx b/website/pages/docs/builders/vmware/vsphere-clone.mdx index 361300eb1..e22e7a5d4 100644 --- a/website/pages/docs/builders/vmware/vsphere-clone.mdx +++ b/website/pages/docs/builders/vmware/vsphere-clone.mdx @@ -42,6 +42,43 @@ necessary for this build to succeed and can be found further down the page. @include 'builder/vsphere/clone/CloneConfig-not-required.mdx' +### vApp Options Configuration + +@include 'builder/vsphere/clone/vAppConfig-not-required.mdx' + +Example of usage: + + + + +```json + "vapp": { + "properties": { + "hostname": "{{ user `hostname`}}", + "user-data": "{{ env `USERDATA`}}" + } + } +``` + +A `user-data` field requires the content of a yaml file to be encoded with base64. This +can be done via environment variable: +`export USERDATA=$(gzip -c9 /dev/null || base64; })` + + + + +```hcl + vapp { + properties = { + hostname = var.hostname + user-data = base64encode(var.user_data) + } + } +``` + + + + ### Extra Configuration Parameters @include 'builder/vsphere/common/ConfigParamsConfig-not-required.mdx' @@ -98,6 +135,23 @@ necessary for this build to succeed and can be found further down the page. @include 'helper/communicator/SSH-not-required.mdx' +@include 'helper/communicator/SSH-Temporary-Key-Pair-not-required.mdx' + +@include 'helper/communicator/SSH-Key-Pair-Name-not-required.mdx' + +@include 'helper/communicator/SSH-Private-Key-File-not-required.mdx' + +@include 'helper/communicator/SSH-Agent-Auth-not-required.mdx' + +-> **NOTE:** Packer uses vApp Options to inject ssh public keys to the Virtual Machine. + The [temporary_key_pair_name](/docs/builders/vmware/vsphere-clone#temporary_key_pair_name) will only work + if the template being cloned contains the vApp property `public-keys`. + If using [ssh_private_key_file](/docs/builders/vmware/vsphere-clone#ssh_private_key_file), provide + the public key via [configuration_parameters](/docs/builders/vmware/vsphere-clone#configuration_parameters) or + [vApp Options Configuration](/docs/builders/vmware/vsphere-clone#vapp-options-configuration) whenever the `guestinto.userdata` + is available. See [VMware Guestinfo datasource](https://github.com/vmware/cloud-init-vmware-guestinfo) for more information + about the key. + #### Optional WinRM fields: @include 'helper/communicator/WinRM-not-required.mdx' diff --git a/website/pages/partials/builder/vsphere/clone/CloneConfig-not-required.mdx b/website/pages/partials/builder/vsphere/clone/CloneConfig-not-required.mdx index 8e07b5e05..83a3a3f00 100644 --- a/website/pages/partials/builder/vsphere/clone/CloneConfig-not-required.mdx +++ b/website/pages/partials/builder/vsphere/clone/CloneConfig-not-required.mdx @@ -10,4 +10,8 @@ must be specified to allow Packer to look for the available network. - `notes` (string) - VM notes. + +- `vapp` (vAppConfig) - Set the vApp Options to a virtual machine. + See the [vApp Options Configuration](/docs/builders/vmware/vsphere-clone#vapp-options-configuration) + to know the available options and how to use it. \ No newline at end of file diff --git a/website/pages/partials/builder/vsphere/clone/vAppConfig-not-required.mdx b/website/pages/partials/builder/vsphere/clone/vAppConfig-not-required.mdx new file mode 100644 index 000000000..fb4b3a3b0 --- /dev/null +++ b/website/pages/partials/builder/vsphere/clone/vAppConfig-not-required.mdx @@ -0,0 +1,10 @@ + + +- `properties` (map[string]string) - Set values for the available vApp Properties to supply configuration parameters to a virtual machine cloned from + a template that came from an imported OVF or OVA file. + + -> **Note:** The only supported usage path for vApp properties is for existing user-configurable keys. + These generally come from an existing template that was created from an imported OVF or OVA file. + You cannot set values for vApp properties on virtual machines created from scratch, + virtual machines lacking a vApp configuration, or on property keys that do not exist. + \ No newline at end of file From d4a7dd24d997e3d90abc16124887a63146fe60fa Mon Sep 17 00:00:00 2001 From: Megan Marsh Date: Wed, 8 Jul 2020 02:59:39 -0700 Subject: [PATCH 35/38] fix link in deprecation warning (#9544) --- builder/azure/arm/builder.go | 2 +- builder/azure/dtl/builder.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/builder/azure/arm/builder.go b/builder/azure/arm/builder.go index cda50d861..d7626a2f0 100644 --- a/builder/azure/arm/builder.go +++ b/builder/azure/arm/builder.go @@ -134,7 +134,7 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack } } else { // User is not using Managed Images to build, warning message here that this path is being deprecated - ui.Error("Warning: You are using Azure Packer Builder to create VHDs which is being deprecated, consider using Managed Images. Learn more http://aka.ms/packermanagedimage") + ui.Error("Warning: You are using Azure Packer Builder to create VHDs which is being deprecated, consider using Managed Images. Learn more https://www.packer.io/docs/builders/azure/arm#azure-arm-builder-specific-options") } if b.config.BuildResourceGroupName != "" { diff --git a/builder/azure/dtl/builder.go b/builder/azure/dtl/builder.go index 3e4160eab..02334ba36 100644 --- a/builder/azure/dtl/builder.go +++ b/builder/azure/dtl/builder.go @@ -123,7 +123,7 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack } else { // User is not using Managed Images to build, warning message here that this path is being deprecated - ui.Error("Warning: You are using Azure Packer Builder to create VHDs which is being deprecated, consider using Managed Images. Learn more http://aka.ms/packermanagedimage") + ui.Error("Warning: You are using Azure Packer Builder to create VHDs which is being deprecated, consider using Managed Images. Learn more https://www.packer.io/docs/builders/azure/arm#azure-arm-builder-specific-options") } b.config.validateLocationZoneResiliency(ui.Say) From e5606d483dcb8efece8f8d2db6454d7cb5abe2f6 Mon Sep 17 00:00:00 2001 From: Wei Cheng Date: Wed, 8 Jul 2020 18:30:25 +0800 Subject: [PATCH 36/38] builder/googlecompute: add support for oslogin (#9339) * feat: add support for oslogin Signed-off-by: Wei Cheng Co-authored-by: Wilken Rivera --- builder/googlecompute/builder.go | 3 + builder/googlecompute/config.go | 44 + builder/googlecompute/config.hcl2spec.go | 2 + builder/googlecompute/driver.go | 7 + builder/googlecompute/driver_gce.go | 42 +- builder/googlecompute/driver_mock.go | 13 + builder/googlecompute/startup.go | 1 + builder/googlecompute/step_create_instance.go | 6 + .../step_import_os_login_ssh_key.go | 132 ++ .../step_import_os_login_ssh_key_test.go | 152 ++ go.sum | 35 - .../api/oauth2/v2/oauth2-api.json | 246 ++++ .../api/oauth2/v2/oauth2-gen.go | 701 +++++++++ .../api/oslogin/v1/oslogin-api.json | 446 ++++++ .../api/oslogin/v1/oslogin-gen.go | 1276 +++++++++++++++++ vendor/modules.txt | 2 + .../googlecompute/Config-not-required.mdx | 44 + 17 files changed, 3111 insertions(+), 41 deletions(-) create mode 100644 builder/googlecompute/step_import_os_login_ssh_key.go create mode 100644 builder/googlecompute/step_import_os_login_ssh_key_test.go create mode 100644 vendor/google.golang.org/api/oauth2/v2/oauth2-api.json create mode 100644 vendor/google.golang.org/api/oauth2/v2/oauth2-gen.go create mode 100644 vendor/google.golang.org/api/oslogin/v1/oslogin-api.json create mode 100644 vendor/google.golang.org/api/oslogin/v1/oslogin-gen.go diff --git a/builder/googlecompute/builder.go b/builder/googlecompute/builder.go index f083066c4..60b5ac551 100644 --- a/builder/googlecompute/builder.go +++ b/builder/googlecompute/builder.go @@ -56,6 +56,9 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack Debug: b.config.PackerDebug, DebugKeyPath: fmt.Sprintf("gce_%s.pem", b.config.PackerBuildName), }, + &StepImportOSLoginSSHKey{ + Debug: b.config.PackerDebug, + }, &StepCreateInstance{ Debug: b.config.PackerDebug, }, diff --git a/builder/googlecompute/config.go b/builder/googlecompute/config.go index 8d8ccfb04..c7fd17aeb 100644 --- a/builder/googlecompute/config.go +++ b/builder/googlecompute/config.go @@ -220,6 +220,50 @@ type Config struct { // If true, use the instance's internal IP instead of its external IP // during building. UseInternalIP bool `mapstructure:"use_internal_ip" required:"false"` + // If true, OSLogin will be used to manage SSH access to the compute instance by + // dynamically importing a temporary SSH key to the Google account's login profile, + // and setting the `enable-oslogin` to `TRUE` in the instance metadata. + // Optionally, `use_os_login` can be used with an existing `ssh_username` and `ssh_private_key_file` + // if a SSH key has already been added to the Google account's login profile - See [Adding SSH Keys](https://cloud.google.com/compute/docs/instances/managing-instance-access#add_oslogin_keys). + // + // SSH keys can be added to an individual user account + // + //```shell-session + // $ gcloud compute os-login ssh-keys add --key-file=/home/user/.ssh/my-key.pub + // + // $ gcloud compute os-login describe-profile + //PosixAccounts: + //- accountId: + // gid: '34567890754' + // homeDirectory: /home/user_example_com + // ... + // primary: true + // uid: '2504818925' + // username: /home/user_example_com + //sshPublicKeys: + // 000000000000000000000000000000000000000000000000000000000000000a: + // fingerprint: 000000000000000000000000000000000000000000000000000000000000000a + //``` + // + // Or SSH keys can be added to an associated service account + //```shell-session + // $ gcloud auth activate-service-account --key-file= + // $ gcloud compute os-login ssh-keys add --key-file=/home/user/.ssh/my-key.pub + // + // $ gcloud compute os-login describe-profile + //PosixAccounts: + //- accountId: + // gid: '34567890754' + // homeDirectory: /home/sa_000000000000000000000 + // ... + // primary: true + // uid: '2504818925' + // username: sa_000000000000000000000 + //sshPublicKeys: + // 000000000000000000000000000000000000000000000000000000000000000a: + // fingerprint: 000000000000000000000000000000000000000000000000000000000000000a + //``` + UseOSLogin bool `mapstructure:"use_os_login" required:"false"` // Can be set instead of account_file. If set, this builder will use // HashiCorp Vault to generate an Oauth token for authenticating against // Google's cloud. The value should be the path of the token generator diff --git a/builder/googlecompute/config.hcl2spec.go b/builder/googlecompute/config.hcl2spec.go index bf1defda0..7e2fcdae0 100644 --- a/builder/googlecompute/config.hcl2spec.go +++ b/builder/googlecompute/config.hcl2spec.go @@ -106,6 +106,7 @@ type FlatConfig struct { Subnetwork *string `mapstructure:"subnetwork" required:"false" cty:"subnetwork" hcl:"subnetwork"` Tags []string `mapstructure:"tags" required:"false" cty:"tags" hcl:"tags"` UseInternalIP *bool `mapstructure:"use_internal_ip" required:"false" cty:"use_internal_ip" hcl:"use_internal_ip"` + UseOSLogin *bool `mapstructure:"use_os_login" required:"false" cty:"use_os_login" hcl:"use_os_login"` VaultGCPOauthEngine *string `mapstructure:"vault_gcp_oauth_engine" cty:"vault_gcp_oauth_engine" hcl:"vault_gcp_oauth_engine"` Zone *string `mapstructure:"zone" required:"true" cty:"zone" hcl:"zone"` } @@ -219,6 +220,7 @@ func (*FlatConfig) HCL2Spec() map[string]hcldec.Spec { "subnetwork": &hcldec.AttrSpec{Name: "subnetwork", Type: cty.String, Required: false}, "tags": &hcldec.AttrSpec{Name: "tags", Type: cty.List(cty.String), Required: false}, "use_internal_ip": &hcldec.AttrSpec{Name: "use_internal_ip", Type: cty.Bool, Required: false}, + "use_os_login": &hcldec.AttrSpec{Name: "use_os_login", Type: cty.Bool, Required: false}, "vault_gcp_oauth_engine": &hcldec.AttrSpec{Name: "vault_gcp_oauth_engine", Type: cty.String, Required: false}, "zone": &hcldec.AttrSpec{Name: "zone", Type: cty.String, Required: false}, } diff --git a/builder/googlecompute/driver.go b/builder/googlecompute/driver.go index 2e0224230..65243250b 100644 --- a/builder/googlecompute/driver.go +++ b/builder/googlecompute/driver.go @@ -5,6 +5,7 @@ import ( "time" compute "google.golang.org/api/compute/v1" + oslogin "google.golang.org/api/oslogin/v1" ) // Driver is the interface that has to be implemented to communicate @@ -62,6 +63,12 @@ type Driver interface { // CreateOrResetWindowsPassword creates or resets the password for a user on an Windows instance. CreateOrResetWindowsPassword(zone, name string, config *WindowsPasswordConfig) (<-chan error, error) + + // ImportOSLoginSSHKey imports SSH public key for OSLogin. + ImportOSLoginSSHKey(user, sshPublicKey string) (*oslogin.LoginProfile, error) + + // DeleteOSLoginSSHKey deletes the SSH public key for OSLogin with the given key. + DeleteOSLoginSSHKey(user, fingerprint string) error } type InstanceConfig struct { diff --git a/builder/googlecompute/driver_gce.go b/builder/googlecompute/driver_gce.go index 3110081c5..3fca1f6b1 100644 --- a/builder/googlecompute/driver_gce.go +++ b/builder/googlecompute/driver_gce.go @@ -15,6 +15,7 @@ import ( "time" compute "google.golang.org/api/compute/v1" + oslogin "google.golang.org/api/oslogin/v1" "github.com/hashicorp/packer/common/retry" "github.com/hashicorp/packer/helper/useragent" @@ -29,9 +30,10 @@ import ( // driverGCE is a Driver implementation that actually talks to GCE. // Create an instance using NewDriverGCE. type driverGCE struct { - projectId string - service *compute.Service - ui packer.Ui + projectId string + service *compute.Service + osLoginService *oslogin.Service + ui packer.Ui } var DriverScopes = []string{"https://www.googleapis.com/auth/compute", "https://www.googleapis.com/auth/devstorage.full_control"} @@ -127,13 +129,19 @@ func NewDriverGCE(ui packer.Ui, p string, conf *jwt.Config, vaultOauth string) ( return nil, err } + osLoginService, err := oslogin.New(client) + if err != nil { + return nil, err + } + // Set UserAgent service.UserAgent = useragent.String() return &driverGCE{ - projectId: p, - service: service, - ui: ui, + projectId: p, + service: service, + osLoginService: osLoginService, + ui: ui, }, nil } @@ -605,6 +613,28 @@ func (d *driverGCE) getPasswordResponses(zone, instance string) ([]windowsPasswo return passwordResponses, nil } +func (d *driverGCE) ImportOSLoginSSHKey(user, sshPublicKey string) (*oslogin.LoginProfile, error) { + parent := fmt.Sprintf("users/%s", user) + resp, err := d.osLoginService.Users.ImportSshPublicKey(parent, &oslogin.SshPublicKey{ + Key: sshPublicKey, + }).Do() + if err != nil { + return nil, err + } + + return resp.LoginProfile, nil +} + +func (d *driverGCE) DeleteOSLoginSSHKey(user, fingerprint string) error { + name := fmt.Sprintf("users/%s/sshPublicKeys/%s", user, fingerprint) + _, err := d.osLoginService.Users.SshPublicKeys.Delete(name).Do() + if err != nil { + return err + } + + return nil +} + func (d *driverGCE) WaitForInstance(state, zone, name string) <-chan error { errCh := make(chan error, 1) go waitForState(errCh, state, d.refreshInstanceState(zone, name)) diff --git a/builder/googlecompute/driver_mock.go b/builder/googlecompute/driver_mock.go index e01ffe058..da5599bc9 100644 --- a/builder/googlecompute/driver_mock.go +++ b/builder/googlecompute/driver_mock.go @@ -4,6 +4,7 @@ import ( "fmt" compute "google.golang.org/api/compute/v1" + oslogin "google.golang.org/api/oslogin/v1" ) // DriverMock is a Driver implementation that is a mocked out so that @@ -275,3 +276,15 @@ func (d *DriverMock) CreateOrResetWindowsPassword(instance, zone string, c *Wind return resultCh, d.CreateOrResetWindowsPasswordErr } + +func (d *DriverMock) ImportOSLoginSSHKey(user, key string) (*oslogin.LoginProfile, error) { + account := oslogin.PosixAccount{Primary: true, Username: "testing_packer_io"} + profile := oslogin.LoginProfile{ + PosixAccounts: []*oslogin.PosixAccount{&account}, + } + return &profile, nil +} + +func (d *DriverMock) DeleteOSLoginSSHKey(user, fingerprint string) error { + return nil +} diff --git a/builder/googlecompute/startup.go b/builder/googlecompute/startup.go index 18d6961ef..743778a2c 100644 --- a/builder/googlecompute/startup.go +++ b/builder/googlecompute/startup.go @@ -7,6 +7,7 @@ import ( const StartupScriptKey string = "startup-script" const StartupScriptStatusKey string = "startup-script-status" const StartupWrappedScriptKey string = "packer-wrapped-startup-script" +const EnableOSLoginKey string = "enable-oslogin" const StartupScriptStatusDone string = "done" const StartupScriptStatusError string = "error" diff --git a/builder/googlecompute/step_create_instance.go b/builder/googlecompute/step_create_instance.go index 4eb86ad08..6c892da60 100644 --- a/builder/googlecompute/step_create_instance.go +++ b/builder/googlecompute/step_create_instance.go @@ -64,6 +64,12 @@ func (c *Config) createInstanceMetadata(sourceImage *Image, sshPublicKey string) instanceMetadata[StartupScriptStatusKey] = StartupScriptStatusDone } + // If UseOSLogin is true, force `enable-oslogin` in metadata + // In the event that `enable-oslogin` is not enabled at project level + if c.UseOSLogin { + instanceMetadata[EnableOSLoginKey] = "TRUE" + } + for key, value := range c.MetadataFiles { var content []byte content, err = ioutil.ReadFile(value) diff --git a/builder/googlecompute/step_import_os_login_ssh_key.go b/builder/googlecompute/step_import_os_login_ssh_key.go new file mode 100644 index 000000000..0d064bfb0 --- /dev/null +++ b/builder/googlecompute/step_import_os_login_ssh_key.go @@ -0,0 +1,132 @@ +package googlecompute + +import ( + "context" + "crypto/sha256" + "encoding/hex" + "fmt" + + "github.com/hashicorp/packer/helper/multistep" + "github.com/hashicorp/packer/packer" + "google.golang.org/api/oauth2/v2" +) + +// StepImportOSLoginSSHKey imports a temporary SSH key pair into a GCE login profile. +type StepImportOSLoginSSHKey struct { + Debug bool + TokeninfoFunc func(context.Context) (*oauth2.Tokeninfo, error) + accountEmail string +} + +// Run executes the Packer build step that generates SSH key pairs. +// The key pairs are added to the ssh config +func (s *StepImportOSLoginSSHKey) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { + config := state.Get("config").(*Config) + driver := state.Get("driver").(Driver) + ui := state.Get("ui").(packer.Ui) + + if !config.UseOSLogin { + return multistep.ActionContinue + } + + // If no public key information is available chances are that a private key was provided + // or that the user is using a SSH agent for authentication. + if config.Comm.SSHPublicKey == nil { + ui.Say("No public SSH key found; skipping SSH public key import for OSLogin...") + return multistep.ActionContinue + } + + if s.TokeninfoFunc == nil { + s.TokeninfoFunc = tokeninfo + } + + ui.Say("Importing SSH public key for OSLogin...") + // Generate SHA256 fingerprint of SSH public key + // Put it into state to clean up later + sha256sum := sha256.Sum256(config.Comm.SSHPublicKey) + state.Put("ssh_key_public_sha256", hex.EncodeToString(sha256sum[:])) + + if config.account != nil { + s.accountEmail = config.account.Email + } + + if s.accountEmail == "" { + info, err := s.TokeninfoFunc(ctx) + if err != nil { + err := fmt.Errorf("Error obtaining token information needed for OSLogin: %s", err) + state.Put("error", err) + ui.Error(err.Error()) + return multistep.ActionHalt + } + + s.accountEmail = info.Email + } + + loginProfile, err := driver.ImportOSLoginSSHKey(s.accountEmail, string(config.Comm.SSHPublicKey)) + if err != nil { + err := fmt.Errorf("Error importing SSH public key for OSLogin: %s", err) + state.Put("error", err) + ui.Error(err.Error()) + return multistep.ActionHalt + } + + // Replacing `SSHUsername` as the username have to be from OSLogin + if len(loginProfile.PosixAccounts) == 0 { + err := fmt.Errorf("Error importing SSH public key for OSLogin: no PosixAccounts available") + state.Put("error", err) + ui.Error(err.Error()) + return multistep.ActionHalt + } + + // Let's obtain the `Primary` account username + ui.Say("Obtaining SSH Username for OSLogin...") + var username string + for _, account := range loginProfile.PosixAccounts { + if account.Primary { + username = account.Username + break + } + } + + if s.Debug { + ui.Message(fmt.Sprintf("ssh_username: %s", username)) + } + config.Comm.SSHUsername = username + + return multistep.ActionContinue +} + +// Cleanup the SSH Key that we added to the POSIX account +func (s *StepImportOSLoginSSHKey) Cleanup(state multistep.StateBag) { + config := state.Get("config").(*Config) + driver := state.Get("driver").(Driver) + ui := state.Get("ui").(packer.Ui) + + if !config.UseOSLogin { + return + } + + fingerprint, ok := state.Get("ssh_key_public_sha256").(string) + if !ok || fingerprint == "" { + return + } + + ui.Say("Deleting SSH public key for OSLogin...") + err := driver.DeleteOSLoginSSHKey(s.accountEmail, fingerprint) + if err != nil { + ui.Error(fmt.Sprintf("Error deleting SSH public key for OSLogin. Please delete it manually.\n\nError: %s", err)) + return + } + + ui.Message("SSH public key for OSLogin has been deleted!") +} + +func tokeninfo(ctx context.Context) (*oauth2.Tokeninfo, error) { + svc, err := oauth2.NewService(ctx) + if err != nil { + err := fmt.Errorf("Error initializing oauth service needed for OSLogin: %s", err) + return nil, err + } + + return svc.Tokeninfo().Context(ctx).Do() +} diff --git a/builder/googlecompute/step_import_os_login_ssh_key_test.go b/builder/googlecompute/step_import_os_login_ssh_key_test.go new file mode 100644 index 000000000..f31df1b0d --- /dev/null +++ b/builder/googlecompute/step_import_os_login_ssh_key_test.go @@ -0,0 +1,152 @@ +package googlecompute + +import ( + "context" + "crypto/sha256" + "encoding/hex" + "testing" + + "github.com/hashicorp/packer/helper/multistep" + "google.golang.org/api/oauth2/v2" +) + +func TestStepImportOSLoginSSHKey_impl(t *testing.T) { + var _ multistep.Step = new(StepImportOSLoginSSHKey) +} + +func TestStepImportOSLoginSSHKey(t *testing.T) { + tt := []struct { + Name string + UseOSLogin bool + ExpectedEmail string + ExpectedAction multistep.StepAction + PubKeyExpected bool + }{ + { + Name: "UseOSLoginDisabled", + ExpectedAction: multistep.ActionContinue, + }, + { + Name: "UseOSLoginWithAccountFile", + UseOSLogin: true, + ExpectedAction: multistep.ActionContinue, + ExpectedEmail: "raffi-compute@developer.gserviceaccount.com", + PubKeyExpected: true, + }, + } + + for _, tc := range tt { + tc := tc + state := testState(t) + step := new(StepImportOSLoginSSHKey) + defer step.Cleanup(state) + + config := state.Get("config").(*Config) + config.UseOSLogin = tc.UseOSLogin + + if tc.PubKeyExpected { + config.Comm.SSHPublicKey = []byte{'k', 'e', 'y'} + } + + if action := step.Run(context.Background(), state); action != multistep.ActionContinue { + t.Fatalf("bad action: %#v", action) + } + + if step.accountEmail != tc.ExpectedEmail { + t.Fatalf("expected accountEmail to be %q but got %q", tc.ExpectedEmail, step.accountEmail) + } + + if _, ok := state.GetOk("ssh_key_public_sha256"); !ok && tc.PubKeyExpected { + t.Fatal("expected to see a public key") + } + } +} + +func TestStepImportOSLoginSSHKey_withAccountFile(t *testing.T) { + // default teststate contains an account file + state := testState(t) + step := new(StepImportOSLoginSSHKey) + defer step.Cleanup(state) + + config := state.Get("config").(*Config) + config.UseOSLogin = true + config.Comm.SSHPublicKey = []byte{'k', 'e', 'y'} + + if action := step.Run(context.Background(), state); action != multistep.ActionContinue { + t.Fatalf("bad action: %#v", action) + } + + fakeAccountEmail := "raffi-compute@developer.gserviceaccount.com" + if step.accountEmail != fakeAccountEmail { + t.Fatalf("expected accountEmail to be %q but got %q", fakeAccountEmail, step.accountEmail) + } + + pubKey, ok := state.GetOk("ssh_key_public_sha256") + if !ok { + t.Fatal("expected to see a public key") + } + + sha256sum := sha256.Sum256(config.Comm.SSHPublicKey) + if pubKey != hex.EncodeToString(sha256sum[:]) { + t.Errorf("expected to see a matching public key, but got %q", pubKey) + } +} + +func TestStepImportOSLoginSSHKey_withNoAccountFile(t *testing.T) { + state := testState(t) + fakeAccountEmail := "testing@packer.io" + step := &StepImportOSLoginSSHKey{ + TokeninfoFunc: func(ctx context.Context) (*oauth2.Tokeninfo, error) { + return &oauth2.Tokeninfo{Email: fakeAccountEmail}, nil + }, + } + defer step.Cleanup(state) + + config := state.Get("config").(*Config) + config.account = nil + config.UseOSLogin = true + config.Comm.SSHPublicKey = []byte{'k', 'e', 'y'} + + if action := step.Run(context.Background(), state); action != multistep.ActionContinue { + t.Fatalf("bad action: %#v", action) + } + + if step.accountEmail != fakeAccountEmail { + t.Fatalf("expected accountEmail to be %q but got %q", fakeAccountEmail, step.accountEmail) + } + + pubKey, ok := state.GetOk("ssh_key_public_sha256") + if !ok { + t.Fatal("expected to see a public key") + } + + sha256sum := sha256.Sum256(config.Comm.SSHPublicKey) + if pubKey != hex.EncodeToString(sha256sum[:]) { + t.Errorf("expected to see a matching public key, but got %q", pubKey) + } +} + +func TestStepImportOSLoginSSHKey_withPrivateSSHKey(t *testing.T) { + // default teststate contains an account file + state := testState(t) + step := new(StepImportOSLoginSSHKey) + defer step.Cleanup(state) + + config := state.Get("config").(*Config) + config.UseOSLogin = true + config.Comm.SSHPrivateKey = []byte{'k', 'e', 'y'} + config.Comm.SSHPublicKey = nil + + if action := step.Run(context.Background(), state); action != multistep.ActionContinue { + t.Fatalf("bad action: %#v", action) + } + + if step.accountEmail != "" { + t.Fatalf("expected accountEmail to be unset but got %q", step.accountEmail) + } + + pubKey, ok := state.GetOk("ssh_key_public_sha256") + if ok { + t.Errorf("expected to not see a public key when using a dedicated private key, but got %q", pubKey) + } +} diff --git a/go.sum b/go.sum index 9bd7b11ed..dbfde231c 100644 --- a/go.sum +++ b/go.sum @@ -727,21 +727,15 @@ golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/ golang.org/x/net v0.0.0-20200602114024-627f9648deb9 h1:pNX+40auqi2JqRfOP1akLGtYcn15TUbkhwuCO3foqqM= golang.org/x/net v0.0.0-20200602114024-627f9648deb9/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421 h1:Wo7BWFiOk0QRFMLYMqJGFMd9CgUAcGx7V+qEg/h5IBI= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 h1:SVwTIAaPC2U/AvvLNZ2a7OVsmBpC8L5BlwK1whH3hm0= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6 h1:pE8b58s1HRDMi8RDc79m0HISf9D4TzseP40cEA6IGfs= golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d h1:TzXSXBo42m9gQenoE3b9BGiEpg5IG2JkU5FkPIawgtw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4 h1:YUO/7uOKsKeq9UokNS62b8FYywz3ker1l1vDZRCRefw= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6 h1:bjcUS9ztw9kFmmIxJInhon/0Is3p+EHBKNgquIzo1OI= golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190423024810-112230192c58 h1:8gQV6CLnAEikrhgkHFbMAEhagSSnXWGV915qUMm9mrU= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a h1:WXEvlFVvvGxCJLG6REjsT03iWnKLEWinaScsxF2Vm2o= @@ -749,11 +743,9 @@ golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5 h1:x6r4Jo0KNzOOzYd8lbcRsqjuqEASK6ob3auvWYM4/8U= golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190129075346-302c3dd5f1cc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190209173611-3b5209105503/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a h1:1BGLXjeY4akVXGgbC9HugT3Jv3hCI0z56oJR5vAMgBU= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -764,7 +756,6 @@ golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190502175342-a43fa875dd82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0 h1:HyfiK1WMnHj5FXFXatD+Qs1A/xC2Run6RzeW1SyHxpc= golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190922100055-0a153f010e69/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -781,23 +772,17 @@ golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd h1:xhmwyvizuTgC2qz7ZlMluP20uW+C3Rm0FD/WLDX8884= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1 h1:ogLJMz+qpzav7lGMh10LMvAkM/fAoGlaiiHYiFYdm80= golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2 h1:z99zHgr7hKfrUcX/KsoJk5FJfjTceCKIp96+biqP4To= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20181227161524-e6919f6577db/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= -golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/time v0.0.0-20181108054448-85acf8d2951c h1:fqgJT0MGcGpPgpWU7VRdRjuArfcOvC4AoJmILihzhDg= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20190308202827-9d24e82272b4 h1:SvFZT6jyqRaOeXpc5h/JSfZenJ2O330aBsf7JfSUXmQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0 h1:/5xXl8Y5W96D+TtHSlonuFqGHIWVuyCkGJLwGh9JJFs= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -807,14 +792,12 @@ golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGm golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312170243-e65039ee4138 h1:H3uGjxCR/6Ds0Mjgyp7LMK81+LvmbvWWEnJhzk1Pi9E= golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0 h1:Dh6fw+p6FyRl5x/FvNswO1ji0lIGzm3KP8Y9VkS9PTE= golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190907020128-2ca718005c18/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -832,24 +815,19 @@ golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapK golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa h1:5E4dL8+NgFOgjwbTKz+OOEGGhP+ectTmF842l6KjupQ= golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200224181240-023911ca70b2 h1:L/G4KZvrQn7FWLN/LlulBtBzrLUhqjiGfTWWDmrh+IQ= golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898 h1:/atklqdjdhuosWIl6AIbOeHJjicWYPqR9bpxqxYG2pA= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/api v0.4.0 h1:KKgc1aqhV8wDPbDzlDtpvyjZFY3vjz85FP7p4wcQUyI= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.9.0 h1:jbyannxz0XFD3zdjgrSUsaJbgpH4eTrkdhRChkHPfO8= google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.14.0 h1:uMf5uLi4eQMRrMKhCplNik4U4H8Z6C1br3zOtAa/aDE= google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= @@ -857,22 +835,18 @@ google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/ google.golang.org/api v0.21.0 h1:zS+Q/CJJnVlXpXQVIz+lH0ZT2lBuT2ac7XD8Y/3w6hY= google.golang.org/api v0.21.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.6.1 h1:QzqyMA1tlu6CgqCDUtU9V+ZKhLFT2dkJuANu5QaxI3I= google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= google.golang.org/appengine v1.6.5 h1:tycE03LOZYQNhDpS27tcQdAzLCVMaj7QT2SXxebnpCM= google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19 h1:Lj2SnHtxkRGJDqnGaSjo+CCdIieEnwVazbOXILwQemk= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190404172233-64821d5d2107/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55 h1:gSJIx1SDwno+2ElGhA4+qG2zF97qiUzTM+rQ0klBOcE= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= @@ -890,18 +864,14 @@ google.golang.org/genproto v0.0.0-20200617032506-f1bdc9086088 h1:XXo4PvhJkaWYIkw google.golang.org/genproto v0.0.0-20200617032506-f1bdc9086088/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.20.1 h1:Hz2g2wirWK7H0qIIhGIqRGTuMwTE8HEKFnDZZ7lm9NU= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= -google.golang.org/grpc v1.21.1 h1:j6XxA85m/6txkUCHvzlV5f+HBNl/1r5cZ2A/3IEFOO8= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.22.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.25.1 h1:wdKvqQk7IttEw92GoRyKG2IDrUIpgpj6H6m81yfeMW0= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.28.0 h1:bO/TA4OxCOummhSf10siHuG7vJOiwh7SpRpFZDkOgl4= google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= google.golang.org/grpc v1.29.1 h1:EC2SB8S04d2r73uptxphDSUG+kTKVgjRPF+N3xpxRB4= google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= @@ -916,9 +886,7 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD google.golang.org/protobuf v1.24.0 h1:UhZDfRO8JRQru4/+LlLE0BRKGF8L+PICnvYZmx/fEGA= google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d/go.mod h1:cuepJuh7vyXfUyUwEgHQXw849cJrilpS5NeIjOWESAw= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -932,9 +900,7 @@ gopkg.in/jarcoal/httpmock.v1 v1.0.0-20181117152235-275e9df93516/go.mod h1:d3R+Nl gopkg.in/square/go-jose.v2 v2.3.1 h1:SK5KegNXmKmqE342YYN2qPHEnUYeoMiXXl1poUlI+o4= gopkg.in/square/go-jose.v2 v2.3.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= @@ -942,7 +908,6 @@ honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.1-2019.2.3 h1:3JgtbtFHMiCmsznwGVTUWbgGov+pVqnlf1dEJTNAXeM= honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3 h1:sXmLre5bzIR6ypkjXCDI3jHPssRhc8KD/Ome589sc3U= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= diff --git a/vendor/google.golang.org/api/oauth2/v2/oauth2-api.json b/vendor/google.golang.org/api/oauth2/v2/oauth2-api.json new file mode 100644 index 000000000..1e7653fde --- /dev/null +++ b/vendor/google.golang.org/api/oauth2/v2/oauth2-api.json @@ -0,0 +1,246 @@ +{ + "auth": { + "oauth2": { + "scopes": { + "https://www.googleapis.com/auth/plus.me": { + "description": "Associate you with your personal info on Google" + }, + "https://www.googleapis.com/auth/userinfo.email": { + "description": "View your email address" + }, + "https://www.googleapis.com/auth/userinfo.profile": { + "description": "See your personal info, including any personal info you've made publicly available" + } + } + } + }, + "basePath": "/", + "baseUrl": "https://www.googleapis.com/", + "batchPath": "batch/oauth2/v2", + "description": "Obtains end-user authorization grants for use with other Google APIs.", + "discoveryVersion": "v1", + "documentationLink": "https://developers.google.com/accounts/docs/OAuth2", + "etag": "\"u9GIe6H63LSGq-9_t39K2Zx_EAc/zG8qVEU9Oex8Y_g8HrcHwAALOOo\"", + "icons": { + "x16": "https://www.gstatic.com/images/branding/product/1x/googleg_16dp.png", + "x32": "https://www.gstatic.com/images/branding/product/1x/googleg_32dp.png" + }, + "id": "oauth2:v2", + "kind": "discovery#restDescription", + "methods": { + "tokeninfo": { + "httpMethod": "POST", + "id": "oauth2.tokeninfo", + "parameters": { + "access_token": { + "location": "query", + "type": "string" + }, + "id_token": { + "location": "query", + "type": "string" + }, + "token_handle": { + "location": "query", + "type": "string" + } + }, + "path": "oauth2/v2/tokeninfo", + "response": { + "$ref": "Tokeninfo" + } + } + }, + "name": "oauth2", + "ownerDomain": "google.com", + "ownerName": "Google", + "parameters": { + "alt": { + "default": "json", + "description": "Data format for the response.", + "enum": [ + "json" + ], + "enumDescriptions": [ + "Responses with Content-Type of application/json" + ], + "location": "query", + "type": "string" + }, + "fields": { + "description": "Selector specifying which fields to include in a partial response.", + "location": "query", + "type": "string" + }, + "key": { + "description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.", + "location": "query", + "type": "string" + }, + "oauth_token": { + "description": "OAuth 2.0 token for the current user.", + "location": "query", + "type": "string" + }, + "prettyPrint": { + "default": "true", + "description": "Returns response with indentations and line breaks.", + "location": "query", + "type": "boolean" + }, + "quotaUser": { + "description": "An opaque string that represents a user for quota purposes. Must not exceed 40 characters.", + "location": "query", + "type": "string" + }, + "userIp": { + "description": "Deprecated. Please use quotaUser instead.", + "location": "query", + "type": "string" + } + }, + "protocol": "rest", + "resources": { + "userinfo": { + "methods": { + "get": { + "httpMethod": "GET", + "id": "oauth2.userinfo.get", + "path": "oauth2/v2/userinfo", + "response": { + "$ref": "Userinfoplus" + }, + "scopes": [ + "https://www.googleapis.com/auth/plus.me", + "https://www.googleapis.com/auth/userinfo.email", + "https://www.googleapis.com/auth/userinfo.profile" + ] + } + }, + "resources": { + "v2": { + "resources": { + "me": { + "methods": { + "get": { + "httpMethod": "GET", + "id": "oauth2.userinfo.v2.me.get", + "path": "userinfo/v2/me", + "response": { + "$ref": "Userinfoplus" + }, + "scopes": [ + "https://www.googleapis.com/auth/plus.me", + "https://www.googleapis.com/auth/userinfo.email", + "https://www.googleapis.com/auth/userinfo.profile" + ] + } + } + } + } + } + } + } + }, + "revision": "20200213", + "rootUrl": "https://www.googleapis.com/", + "schemas": { + "Tokeninfo": { + "id": "Tokeninfo", + "properties": { + "access_type": { + "description": "The access type granted with this token. It can be offline or online.", + "type": "string" + }, + "audience": { + "description": "Who is the intended audience for this token. In general the same as issued_to.", + "type": "string" + }, + "email": { + "description": "The email address of the user. Present only if the email scope is present in the request.", + "type": "string" + }, + "expires_in": { + "description": "The expiry time of the token, as number of seconds left until expiry.", + "format": "int32", + "type": "integer" + }, + "issued_to": { + "description": "To whom was the token issued to. In general the same as audience.", + "type": "string" + }, + "scope": { + "description": "The space separated list of scopes granted to this token.", + "type": "string" + }, + "token_handle": { + "description": "The token handle associated with this token.", + "type": "string" + }, + "user_id": { + "description": "The obfuscated user id.", + "type": "string" + }, + "verified_email": { + "description": "Boolean flag which is true if the email address is verified. Present only if the email scope is present in the request.", + "type": "boolean" + } + }, + "type": "object" + }, + "Userinfoplus": { + "id": "Userinfoplus", + "properties": { + "email": { + "description": "The user's email address.", + "type": "string" + }, + "family_name": { + "description": "The user's last name.", + "type": "string" + }, + "gender": { + "description": "The user's gender.", + "type": "string" + }, + "given_name": { + "description": "The user's first name.", + "type": "string" + }, + "hd": { + "description": "The hosted domain e.g. example.com if the user is Google apps user.", + "type": "string" + }, + "id": { + "description": "The obfuscated ID of the user.", + "type": "string" + }, + "link": { + "description": "URL of the profile page.", + "type": "string" + }, + "locale": { + "description": "The user's preferred locale.", + "type": "string" + }, + "name": { + "description": "The user's full name.", + "type": "string" + }, + "picture": { + "description": "URL of the user's picture image.", + "type": "string" + }, + "verified_email": { + "default": "true", + "description": "Boolean flag which is true if the email address is verified. Always verified because we only return the user's primary email address.", + "type": "boolean" + } + }, + "type": "object" + } + }, + "servicePath": "", + "title": "Google OAuth2 API", + "version": "v2" +} \ No newline at end of file diff --git a/vendor/google.golang.org/api/oauth2/v2/oauth2-gen.go b/vendor/google.golang.org/api/oauth2/v2/oauth2-gen.go new file mode 100644 index 000000000..c3ace0bb5 --- /dev/null +++ b/vendor/google.golang.org/api/oauth2/v2/oauth2-gen.go @@ -0,0 +1,701 @@ +// Copyright 2020 Google LLC. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Code generated file. DO NOT EDIT. + +// Package oauth2 provides access to the Google OAuth2 API. +// +// For product documentation, see: https://developers.google.com/accounts/docs/OAuth2 +// +// Creating a client +// +// Usage example: +// +// import "google.golang.org/api/oauth2/v2" +// ... +// ctx := context.Background() +// oauth2Service, err := oauth2.NewService(ctx) +// +// In this example, Google Application Default Credentials are used for authentication. +// +// For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. +// +// Other authentication options +// +// By default, all available scopes (see "Constants") are used to authenticate. To restrict scopes, use option.WithScopes: +// +// oauth2Service, err := oauth2.NewService(ctx, option.WithScopes(oauth2.UserinfoProfileScope)) +// +// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey: +// +// oauth2Service, err := oauth2.NewService(ctx, option.WithAPIKey("AIza...")) +// +// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource: +// +// config := &oauth2.Config{...} +// // ... +// token, err := config.Exchange(ctx, ...) +// oauth2Service, err := oauth2.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) +// +// See https://godoc.org/google.golang.org/api/option/ for details on options. +package oauth2 // import "google.golang.org/api/oauth2/v2" + +import ( + "bytes" + "context" + "encoding/json" + "errors" + "fmt" + "io" + "net/http" + "net/url" + "strconv" + "strings" + + googleapi "google.golang.org/api/googleapi" + gensupport "google.golang.org/api/internal/gensupport" + option "google.golang.org/api/option" + internaloption "google.golang.org/api/option/internaloption" + htransport "google.golang.org/api/transport/http" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = gensupport.MarshalJSON +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = context.Canceled +var _ = internaloption.WithDefaultEndpoint + +const apiId = "oauth2:v2" +const apiName = "oauth2" +const apiVersion = "v2" +const basePath = "https://www.googleapis.com/" + +// OAuth2 scopes used by this API. +const ( + // Associate you with your personal info on Google + PlusMeScope = "https://www.googleapis.com/auth/plus.me" + + // View your email address + UserinfoEmailScope = "https://www.googleapis.com/auth/userinfo.email" + + // See your personal info, including any personal info you've made + // publicly available + UserinfoProfileScope = "https://www.googleapis.com/auth/userinfo.profile" +) + +// NewService creates a new Service. +func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) { + scopesOption := option.WithScopes( + "https://www.googleapis.com/auth/plus.me", + "https://www.googleapis.com/auth/userinfo.email", + "https://www.googleapis.com/auth/userinfo.profile", + ) + // NOTE: prepend, so we don't override user-specified scopes. + opts = append([]option.ClientOption{scopesOption}, opts...) + opts = append(opts, internaloption.WithDefaultEndpoint(basePath)) + client, endpoint, err := htransport.NewClient(ctx, opts...) + if err != nil { + return nil, err + } + s, err := New(client) + if err != nil { + return nil, err + } + if endpoint != "" { + s.BasePath = endpoint + } + return s, nil +} + +// New creates a new Service. It uses the provided http.Client for requests. +// +// Deprecated: please use NewService instead. +// To provide a custom HTTP client, use option.WithHTTPClient. +// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client, BasePath: basePath} + s.Userinfo = NewUserinfoService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + UserAgent string // optional additional User-Agent fragment + + Userinfo *UserinfoService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +func NewUserinfoService(s *Service) *UserinfoService { + rs := &UserinfoService{s: s} + rs.V2 = NewUserinfoV2Service(s) + return rs +} + +type UserinfoService struct { + s *Service + + V2 *UserinfoV2Service +} + +func NewUserinfoV2Service(s *Service) *UserinfoV2Service { + rs := &UserinfoV2Service{s: s} + rs.Me = NewUserinfoV2MeService(s) + return rs +} + +type UserinfoV2Service struct { + s *Service + + Me *UserinfoV2MeService +} + +func NewUserinfoV2MeService(s *Service) *UserinfoV2MeService { + rs := &UserinfoV2MeService{s: s} + return rs +} + +type UserinfoV2MeService struct { + s *Service +} + +type Tokeninfo struct { + // AccessType: The access type granted with this token. It can be + // offline or online. + AccessType string `json:"access_type,omitempty"` + + // Audience: Who is the intended audience for this token. In general the + // same as issued_to. + Audience string `json:"audience,omitempty"` + + // Email: The email address of the user. Present only if the email scope + // is present in the request. + Email string `json:"email,omitempty"` + + // ExpiresIn: The expiry time of the token, as number of seconds left + // until expiry. + ExpiresIn int64 `json:"expires_in,omitempty"` + + // IssuedTo: To whom was the token issued to. In general the same as + // audience. + IssuedTo string `json:"issued_to,omitempty"` + + // Scope: The space separated list of scopes granted to this token. + Scope string `json:"scope,omitempty"` + + // TokenHandle: The token handle associated with this token. + TokenHandle string `json:"token_handle,omitempty"` + + // UserId: The obfuscated user id. + UserId string `json:"user_id,omitempty"` + + // VerifiedEmail: Boolean flag which is true if the email address is + // verified. Present only if the email scope is present in the request. + VerifiedEmail bool `json:"verified_email,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccessType") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "AccessType") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *Tokeninfo) MarshalJSON() ([]byte, error) { + type NoMethod Tokeninfo + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +type Userinfoplus struct { + // Email: The user's email address. + Email string `json:"email,omitempty"` + + // FamilyName: The user's last name. + FamilyName string `json:"family_name,omitempty"` + + // Gender: The user's gender. + Gender string `json:"gender,omitempty"` + + // GivenName: The user's first name. + GivenName string `json:"given_name,omitempty"` + + // Hd: The hosted domain e.g. example.com if the user is Google apps + // user. + Hd string `json:"hd,omitempty"` + + // Id: The obfuscated ID of the user. + Id string `json:"id,omitempty"` + + // Link: URL of the profile page. + Link string `json:"link,omitempty"` + + // Locale: The user's preferred locale. + Locale string `json:"locale,omitempty"` + + // Name: The user's full name. + Name string `json:"name,omitempty"` + + // Picture: URL of the user's picture image. + Picture string `json:"picture,omitempty"` + + // VerifiedEmail: Boolean flag which is true if the email address is + // verified. Always verified because we only return the user's primary + // email address. + // + // Default: true + VerifiedEmail *bool `json:"verified_email,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Email") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Email") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *Userinfoplus) MarshalJSON() ([]byte, error) { + type NoMethod Userinfoplus + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// method id "oauth2.tokeninfo": + +type TokeninfoCall struct { + s *Service + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Tokeninfo: +func (s *Service) Tokeninfo() *TokeninfoCall { + c := &TokeninfoCall{s: s, urlParams_: make(gensupport.URLParams)} + return c +} + +// AccessToken sets the optional parameter "access_token": +func (c *TokeninfoCall) AccessToken(accessToken string) *TokeninfoCall { + c.urlParams_.Set("access_token", accessToken) + return c +} + +// IdToken sets the optional parameter "id_token": +func (c *TokeninfoCall) IdToken(idToken string) *TokeninfoCall { + c.urlParams_.Set("id_token", idToken) + return c +} + +// TokenHandle sets the optional parameter "token_handle": +func (c *TokeninfoCall) TokenHandle(tokenHandle string) *TokeninfoCall { + c.urlParams_.Set("token_handle", tokenHandle) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TokeninfoCall) Fields(s ...googleapi.Field) *TokeninfoCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *TokeninfoCall) Context(ctx context.Context) *TokeninfoCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *TokeninfoCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *TokeninfoCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200317") + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "oauth2/v2/tokeninfo") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "oauth2.tokeninfo" call. +// Exactly one of *Tokeninfo or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Tokeninfo.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *TokeninfoCall) Do(opts ...googleapi.CallOption) (*Tokeninfo, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Tokeninfo{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "httpMethod": "POST", + // "id": "oauth2.tokeninfo", + // "parameters": { + // "access_token": { + // "location": "query", + // "type": "string" + // }, + // "id_token": { + // "location": "query", + // "type": "string" + // }, + // "token_handle": { + // "location": "query", + // "type": "string" + // } + // }, + // "path": "oauth2/v2/tokeninfo", + // "response": { + // "$ref": "Tokeninfo" + // } + // } + +} + +// method id "oauth2.userinfo.get": + +type UserinfoGetCall struct { + s *Service + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// Get: +func (r *UserinfoService) Get() *UserinfoGetCall { + c := &UserinfoGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UserinfoGetCall) Fields(s ...googleapi.Field) *UserinfoGetCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *UserinfoGetCall) IfNoneMatch(entityTag string) *UserinfoGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *UserinfoGetCall) Context(ctx context.Context) *UserinfoGetCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *UserinfoGetCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *UserinfoGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200317") + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "oauth2/v2/userinfo") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "oauth2.userinfo.get" call. +// Exactly one of *Userinfoplus or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Userinfoplus.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *UserinfoGetCall) Do(opts ...googleapi.CallOption) (*Userinfoplus, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Userinfoplus{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "httpMethod": "GET", + // "id": "oauth2.userinfo.get", + // "path": "oauth2/v2/userinfo", + // "response": { + // "$ref": "Userinfoplus" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/plus.me", + // "https://www.googleapis.com/auth/userinfo.email", + // "https://www.googleapis.com/auth/userinfo.profile" + // ] + // } + +} + +// method id "oauth2.userinfo.v2.me.get": + +type UserinfoV2MeGetCall struct { + s *Service + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// Get: +func (r *UserinfoV2MeService) Get() *UserinfoV2MeGetCall { + c := &UserinfoV2MeGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UserinfoV2MeGetCall) Fields(s ...googleapi.Field) *UserinfoV2MeGetCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *UserinfoV2MeGetCall) IfNoneMatch(entityTag string) *UserinfoV2MeGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *UserinfoV2MeGetCall) Context(ctx context.Context) *UserinfoV2MeGetCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *UserinfoV2MeGetCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *UserinfoV2MeGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200317") + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "userinfo/v2/me") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "oauth2.userinfo.v2.me.get" call. +// Exactly one of *Userinfoplus or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Userinfoplus.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *UserinfoV2MeGetCall) Do(opts ...googleapi.CallOption) (*Userinfoplus, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Userinfoplus{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "httpMethod": "GET", + // "id": "oauth2.userinfo.v2.me.get", + // "path": "userinfo/v2/me", + // "response": { + // "$ref": "Userinfoplus" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/plus.me", + // "https://www.googleapis.com/auth/userinfo.email", + // "https://www.googleapis.com/auth/userinfo.profile" + // ] + // } + +} diff --git a/vendor/google.golang.org/api/oslogin/v1/oslogin-api.json b/vendor/google.golang.org/api/oslogin/v1/oslogin-api.json new file mode 100644 index 000000000..1c6ef44e9 --- /dev/null +++ b/vendor/google.golang.org/api/oslogin/v1/oslogin-api.json @@ -0,0 +1,446 @@ +{ + "auth": { + "oauth2": { + "scopes": { + "https://www.googleapis.com/auth/cloud-platform": { + "description": "View and manage your data across Google Cloud Platform services" + }, + "https://www.googleapis.com/auth/compute": { + "description": "View and manage your Google Compute Engine resources" + } + } + } + }, + "basePath": "", + "baseUrl": "https://oslogin.googleapis.com/", + "batchPath": "batch", + "canonicalName": "Cloud OS Login", + "description": "You can use OS Login to manage access to your VM instances using IAM roles.", + "discoveryVersion": "v1", + "documentationLink": "https://cloud.google.com/compute/docs/oslogin/", + "fullyEncodeReservedExpansion": true, + "icons": { + "x16": "http://www.google.com/images/icons/product/search-16.gif", + "x32": "http://www.google.com/images/icons/product/search-32.gif" + }, + "id": "oslogin:v1", + "kind": "discovery#restDescription", + "mtlsRootUrl": "https://oslogin.mtls.googleapis.com/", + "name": "oslogin", + "ownerDomain": "google.com", + "ownerName": "Google", + "parameters": { + "$.xgafv": { + "description": "V1 error format.", + "enum": [ + "1", + "2" + ], + "enumDescriptions": [ + "v1 error format", + "v2 error format" + ], + "location": "query", + "type": "string" + }, + "access_token": { + "description": "OAuth access token.", + "location": "query", + "type": "string" + }, + "alt": { + "default": "json", + "description": "Data format for response.", + "enum": [ + "json", + "media", + "proto" + ], + "enumDescriptions": [ + "Responses with Content-Type of application/json", + "Media download with context-dependent Content-Type", + "Responses with Content-Type of application/x-protobuf" + ], + "location": "query", + "type": "string" + }, + "callback": { + "description": "JSONP", + "location": "query", + "type": "string" + }, + "fields": { + "description": "Selector specifying which fields to include in a partial response.", + "location": "query", + "type": "string" + }, + "key": { + "description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.", + "location": "query", + "type": "string" + }, + "oauth_token": { + "description": "OAuth 2.0 token for the current user.", + "location": "query", + "type": "string" + }, + "prettyPrint": { + "default": "true", + "description": "Returns response with indentations and line breaks.", + "location": "query", + "type": "boolean" + }, + "quotaUser": { + "description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.", + "location": "query", + "type": "string" + }, + "uploadType": { + "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", + "location": "query", + "type": "string" + }, + "upload_protocol": { + "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", + "location": "query", + "type": "string" + } + }, + "protocol": "rest", + "resources": { + "users": { + "methods": { + "getLoginProfile": { + "description": "Retrieves the profile information used for logging in to a virtual machine\non Google Compute Engine.", + "flatPath": "v1/users/{usersId}/loginProfile", + "httpMethod": "GET", + "id": "oslogin.users.getLoginProfile", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The unique ID for the user in format `users/{user}`.", + "location": "path", + "pattern": "^users/[^/]+$", + "required": true, + "type": "string" + }, + "projectId": { + "description": "The project ID of the Google Cloud Platform project.", + "location": "query", + "type": "string" + }, + "systemId": { + "description": "A system ID for filtering the results of the request.", + "location": "query", + "type": "string" + } + }, + "path": "v1/{+name}/loginProfile", + "response": { + "$ref": "LoginProfile" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "importSshPublicKey": { + "description": "Adds an SSH public key and returns the profile information. Default POSIX\naccount information is set when no username and UID exist as part of the\nlogin profile.", + "flatPath": "v1/users/{usersId}:importSshPublicKey", + "httpMethod": "POST", + "id": "oslogin.users.importSshPublicKey", + "parameterOrder": [ + "parent" + ], + "parameters": { + "parent": { + "description": "Required. The unique ID for the user in format `users/{user}`.", + "location": "path", + "pattern": "^users/[^/]+$", + "required": true, + "type": "string" + }, + "projectId": { + "description": "The project ID of the Google Cloud Platform project.", + "location": "query", + "type": "string" + } + }, + "path": "v1/{+parent}:importSshPublicKey", + "request": { + "$ref": "SshPublicKey" + }, + "response": { + "$ref": "ImportSshPublicKeyResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + } + }, + "resources": { + "projects": { + "methods": { + "delete": { + "description": "Deletes a POSIX account.", + "flatPath": "v1/users/{usersId}/projects/{projectsId}", + "httpMethod": "DELETE", + "id": "oslogin.users.projects.delete", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. A reference to the POSIX account to update. POSIX accounts are identified\nby the project ID they are associated with. A reference to the POSIX\naccount is in format `users/{user}/projects/{project}`.", + "location": "path", + "pattern": "^users/[^/]+/projects/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+name}", + "response": { + "$ref": "Empty" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + } + } + }, + "sshPublicKeys": { + "methods": { + "delete": { + "description": "Deletes an SSH public key.", + "flatPath": "v1/users/{usersId}/sshPublicKeys/{sshPublicKeysId}", + "httpMethod": "DELETE", + "id": "oslogin.users.sshPublicKeys.delete", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The fingerprint of the public key to update. Public keys are identified by\ntheir SHA-256 fingerprint. The fingerprint of the public key is in format\n`users/{user}/sshPublicKeys/{fingerprint}`.", + "location": "path", + "pattern": "^users/[^/]+/sshPublicKeys/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+name}", + "response": { + "$ref": "Empty" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "get": { + "description": "Retrieves an SSH public key.", + "flatPath": "v1/users/{usersId}/sshPublicKeys/{sshPublicKeysId}", + "httpMethod": "GET", + "id": "oslogin.users.sshPublicKeys.get", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The fingerprint of the public key to retrieve. Public keys are identified\nby their SHA-256 fingerprint. The fingerprint of the public key is in\nformat `users/{user}/sshPublicKeys/{fingerprint}`.", + "location": "path", + "pattern": "^users/[^/]+/sshPublicKeys/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+name}", + "response": { + "$ref": "SshPublicKey" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "patch": { + "description": "Updates an SSH public key and returns the profile information. This method\nsupports patch semantics.", + "flatPath": "v1/users/{usersId}/sshPublicKeys/{sshPublicKeysId}", + "httpMethod": "PATCH", + "id": "oslogin.users.sshPublicKeys.patch", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The fingerprint of the public key to update. Public keys are identified by\ntheir SHA-256 fingerprint. The fingerprint of the public key is in format\n`users/{user}/sshPublicKeys/{fingerprint}`.", + "location": "path", + "pattern": "^users/[^/]+/sshPublicKeys/[^/]+$", + "required": true, + "type": "string" + }, + "updateMask": { + "description": "Mask to control which fields get updated. Updates all if not present.", + "format": "google-fieldmask", + "location": "query", + "type": "string" + } + }, + "path": "v1/{+name}", + "request": { + "$ref": "SshPublicKey" + }, + "response": { + "$ref": "SshPublicKey" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + } + } + } + } + } + }, + "revision": "20200215", + "rootUrl": "https://oslogin.googleapis.com/", + "schemas": { + "Empty": { + "description": "A generic empty message that you can re-use to avoid defining duplicated\nempty messages in your APIs. A typical example is to use it as the request\nor the response type of an API method. For instance:\n\n service Foo {\n rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);\n }\n\nThe JSON representation for `Empty` is empty JSON object `{}`.", + "id": "Empty", + "properties": {}, + "type": "object" + }, + "ImportSshPublicKeyResponse": { + "description": "A response message for importing an SSH public key.", + "id": "ImportSshPublicKeyResponse", + "properties": { + "loginProfile": { + "$ref": "LoginProfile", + "description": "The login profile information for the user." + } + }, + "type": "object" + }, + "LoginProfile": { + "description": "The user profile information used for logging in to a virtual machine on\nGoogle Compute Engine.", + "id": "LoginProfile", + "properties": { + "name": { + "description": "Required. A unique user ID.", + "type": "string" + }, + "posixAccounts": { + "description": "The list of POSIX accounts associated with the user.", + "items": { + "$ref": "PosixAccount" + }, + "type": "array" + }, + "sshPublicKeys": { + "additionalProperties": { + "$ref": "SshPublicKey" + }, + "description": "A map from SSH public key fingerprint to the associated key object.", + "type": "object" + } + }, + "type": "object" + }, + "PosixAccount": { + "description": "The POSIX account information associated with a Google account.", + "id": "PosixAccount", + "properties": { + "accountId": { + "description": "Output only. A POSIX account identifier.", + "type": "string" + }, + "gecos": { + "description": "The GECOS (user information) entry for this account.", + "type": "string" + }, + "gid": { + "description": "The default group ID.", + "format": "int64", + "type": "string" + }, + "homeDirectory": { + "description": "The path to the home directory for this account.", + "type": "string" + }, + "name": { + "description": "Output only. The canonical resource name.", + "type": "string" + }, + "operatingSystemType": { + "description": "The operating system type where this account applies.", + "enum": [ + "OPERATING_SYSTEM_TYPE_UNSPECIFIED", + "LINUX", + "WINDOWS" + ], + "enumDescriptions": [ + "The operating system type associated with the user account information is\nunspecified.", + "Linux user account information.", + "Windows user account information." + ], + "type": "string" + }, + "primary": { + "description": "Only one POSIX account can be marked as primary.", + "type": "boolean" + }, + "shell": { + "description": "The path to the logic shell for this account.", + "type": "string" + }, + "systemId": { + "description": "System identifier for which account the username or uid applies to.\nBy default, the empty value is used.", + "type": "string" + }, + "uid": { + "description": "The user ID.", + "format": "int64", + "type": "string" + }, + "username": { + "description": "The username of the POSIX account.", + "type": "string" + } + }, + "type": "object" + }, + "SshPublicKey": { + "description": "The SSH public key information associated with a Google account.", + "id": "SshPublicKey", + "properties": { + "expirationTimeUsec": { + "description": "An expiration time in microseconds since epoch.", + "format": "int64", + "type": "string" + }, + "fingerprint": { + "description": "Output only. The SHA-256 fingerprint of the SSH public key.", + "type": "string" + }, + "key": { + "description": "Public key text in SSH format, defined by\n\u003ca href=\"https://www.ietf.org/rfc/rfc4253.txt\" target=\"_blank\"\u003eRFC4253\u003c/a\u003e\nsection 6.6.", + "type": "string" + }, + "name": { + "description": "Output only. The canonical resource name.", + "type": "string" + } + }, + "type": "object" + } + }, + "servicePath": "", + "title": "Cloud OS Login API", + "version": "v1", + "version_module": true +} \ No newline at end of file diff --git a/vendor/google.golang.org/api/oslogin/v1/oslogin-gen.go b/vendor/google.golang.org/api/oslogin/v1/oslogin-gen.go new file mode 100644 index 000000000..71dc70843 --- /dev/null +++ b/vendor/google.golang.org/api/oslogin/v1/oslogin-gen.go @@ -0,0 +1,1276 @@ +// Copyright 2020 Google LLC. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Code generated file. DO NOT EDIT. + +// Package oslogin provides access to the Cloud OS Login API. +// +// This package is DEPRECATED. Use package cloud.google.com/go/oslogin/apiv1 instead. +// +// For product documentation, see: https://cloud.google.com/compute/docs/oslogin/ +// +// Creating a client +// +// Usage example: +// +// import "google.golang.org/api/oslogin/v1" +// ... +// ctx := context.Background() +// osloginService, err := oslogin.NewService(ctx) +// +// In this example, Google Application Default Credentials are used for authentication. +// +// For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. +// +// Other authentication options +// +// By default, all available scopes (see "Constants") are used to authenticate. To restrict scopes, use option.WithScopes: +// +// osloginService, err := oslogin.NewService(ctx, option.WithScopes(oslogin.ComputeScope)) +// +// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey: +// +// osloginService, err := oslogin.NewService(ctx, option.WithAPIKey("AIza...")) +// +// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource: +// +// config := &oauth2.Config{...} +// // ... +// token, err := config.Exchange(ctx, ...) +// osloginService, err := oslogin.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) +// +// See https://godoc.org/google.golang.org/api/option/ for details on options. +package oslogin // import "google.golang.org/api/oslogin/v1" + +import ( + "bytes" + "context" + "encoding/json" + "errors" + "fmt" + "io" + "net/http" + "net/url" + "strconv" + "strings" + + googleapi "google.golang.org/api/googleapi" + gensupport "google.golang.org/api/internal/gensupport" + option "google.golang.org/api/option" + internaloption "google.golang.org/api/option/internaloption" + htransport "google.golang.org/api/transport/http" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = gensupport.MarshalJSON +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = context.Canceled +var _ = internaloption.WithDefaultEndpoint + +const apiId = "oslogin:v1" +const apiName = "oslogin" +const apiVersion = "v1" +const basePath = "https://oslogin.googleapis.com/" + +// OAuth2 scopes used by this API. +const ( + // View and manage your data across Google Cloud Platform services + CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform" + + // View and manage your Google Compute Engine resources + ComputeScope = "https://www.googleapis.com/auth/compute" +) + +// NewService creates a new Service. +func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) { + scopesOption := option.WithScopes( + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + ) + // NOTE: prepend, so we don't override user-specified scopes. + opts = append([]option.ClientOption{scopesOption}, opts...) + opts = append(opts, internaloption.WithDefaultEndpoint(basePath)) + client, endpoint, err := htransport.NewClient(ctx, opts...) + if err != nil { + return nil, err + } + s, err := New(client) + if err != nil { + return nil, err + } + if endpoint != "" { + s.BasePath = endpoint + } + return s, nil +} + +// New creates a new Service. It uses the provided http.Client for requests. +// +// Deprecated: please use NewService instead. +// To provide a custom HTTP client, use option.WithHTTPClient. +// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client, BasePath: basePath} + s.Users = NewUsersService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + UserAgent string // optional additional User-Agent fragment + + Users *UsersService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +func NewUsersService(s *Service) *UsersService { + rs := &UsersService{s: s} + rs.Projects = NewUsersProjectsService(s) + rs.SshPublicKeys = NewUsersSshPublicKeysService(s) + return rs +} + +type UsersService struct { + s *Service + + Projects *UsersProjectsService + + SshPublicKeys *UsersSshPublicKeysService +} + +func NewUsersProjectsService(s *Service) *UsersProjectsService { + rs := &UsersProjectsService{s: s} + return rs +} + +type UsersProjectsService struct { + s *Service +} + +func NewUsersSshPublicKeysService(s *Service) *UsersSshPublicKeysService { + rs := &UsersSshPublicKeysService{s: s} + return rs +} + +type UsersSshPublicKeysService struct { + s *Service +} + +// Empty: A generic empty message that you can re-use to avoid defining +// duplicated +// empty messages in your APIs. A typical example is to use it as the +// request +// or the response type of an API method. For instance: +// +// service Foo { +// rpc Bar(google.protobuf.Empty) returns +// (google.protobuf.Empty); +// } +// +// The JSON representation for `Empty` is empty JSON object `{}`. +type Empty struct { + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` +} + +// ImportSshPublicKeyResponse: A response message for importing an SSH +// public key. +type ImportSshPublicKeyResponse struct { + // LoginProfile: The login profile information for the user. + LoginProfile *LoginProfile `json:"loginProfile,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "LoginProfile") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "LoginProfile") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *ImportSshPublicKeyResponse) MarshalJSON() ([]byte, error) { + type NoMethod ImportSshPublicKeyResponse + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// LoginProfile: The user profile information used for logging in to a +// virtual machine on +// Google Compute Engine. +type LoginProfile struct { + // Name: Required. A unique user ID. + Name string `json:"name,omitempty"` + + // PosixAccounts: The list of POSIX accounts associated with the user. + PosixAccounts []*PosixAccount `json:"posixAccounts,omitempty"` + + // SshPublicKeys: A map from SSH public key fingerprint to the + // associated key object. + SshPublicKeys map[string]SshPublicKey `json:"sshPublicKeys,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Name") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Name") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *LoginProfile) MarshalJSON() ([]byte, error) { + type NoMethod LoginProfile + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// PosixAccount: The POSIX account information associated with a Google +// account. +type PosixAccount struct { + // AccountId: Output only. A POSIX account identifier. + AccountId string `json:"accountId,omitempty"` + + // Gecos: The GECOS (user information) entry for this account. + Gecos string `json:"gecos,omitempty"` + + // Gid: The default group ID. + Gid int64 `json:"gid,omitempty,string"` + + // HomeDirectory: The path to the home directory for this account. + HomeDirectory string `json:"homeDirectory,omitempty"` + + // Name: Output only. The canonical resource name. + Name string `json:"name,omitempty"` + + // OperatingSystemType: The operating system type where this account + // applies. + // + // Possible values: + // "OPERATING_SYSTEM_TYPE_UNSPECIFIED" - The operating system type + // associated with the user account information is + // unspecified. + // "LINUX" - Linux user account information. + // "WINDOWS" - Windows user account information. + OperatingSystemType string `json:"operatingSystemType,omitempty"` + + // Primary: Only one POSIX account can be marked as primary. + Primary bool `json:"primary,omitempty"` + + // Shell: The path to the logic shell for this account. + Shell string `json:"shell,omitempty"` + + // SystemId: System identifier for which account the username or uid + // applies to. + // By default, the empty value is used. + SystemId string `json:"systemId,omitempty"` + + // Uid: The user ID. + Uid int64 `json:"uid,omitempty,string"` + + // Username: The username of the POSIX account. + Username string `json:"username,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "AccountId") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *PosixAccount) MarshalJSON() ([]byte, error) { + type NoMethod PosixAccount + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// SshPublicKey: The SSH public key information associated with a Google +// account. +type SshPublicKey struct { + // ExpirationTimeUsec: An expiration time in microseconds since epoch. + ExpirationTimeUsec int64 `json:"expirationTimeUsec,omitempty,string"` + + // Fingerprint: Output only. The SHA-256 fingerprint of the SSH public + // key. + Fingerprint string `json:"fingerprint,omitempty"` + + // Key: Public key text in SSH format, defined by + // RFC4253 + // section 6.6. + Key string `json:"key,omitempty"` + + // Name: Output only. The canonical resource name. + Name string `json:"name,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "ExpirationTimeUsec") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "ExpirationTimeUsec") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *SshPublicKey) MarshalJSON() ([]byte, error) { + type NoMethod SshPublicKey + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// method id "oslogin.users.getLoginProfile": + +type UsersGetLoginProfileCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// GetLoginProfile: Retrieves the profile information used for logging +// in to a virtual machine +// on Google Compute Engine. +func (r *UsersService) GetLoginProfile(name string) *UsersGetLoginProfileCall { + c := &UsersGetLoginProfileCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + return c +} + +// ProjectId sets the optional parameter "projectId": The project ID of +// the Google Cloud Platform project. +func (c *UsersGetLoginProfileCall) ProjectId(projectId string) *UsersGetLoginProfileCall { + c.urlParams_.Set("projectId", projectId) + return c +} + +// SystemId sets the optional parameter "systemId": A system ID for +// filtering the results of the request. +func (c *UsersGetLoginProfileCall) SystemId(systemId string) *UsersGetLoginProfileCall { + c.urlParams_.Set("systemId", systemId) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UsersGetLoginProfileCall) Fields(s ...googleapi.Field) *UsersGetLoginProfileCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *UsersGetLoginProfileCall) IfNoneMatch(entityTag string) *UsersGetLoginProfileCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *UsersGetLoginProfileCall) Context(ctx context.Context) *UsersGetLoginProfileCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *UsersGetLoginProfileCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *UsersGetLoginProfileCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200317") + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/loginProfile") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "oslogin.users.getLoginProfile" call. +// Exactly one of *LoginProfile or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *LoginProfile.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *UsersGetLoginProfileCall) Do(opts ...googleapi.CallOption) (*LoginProfile, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &LoginProfile{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the profile information used for logging in to a virtual machine\non Google Compute Engine.", + // "flatPath": "v1/users/{usersId}/loginProfile", + // "httpMethod": "GET", + // "id": "oslogin.users.getLoginProfile", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Required. The unique ID for the user in format `users/{user}`.", + // "location": "path", + // "pattern": "^users/[^/]+$", + // "required": true, + // "type": "string" + // }, + // "projectId": { + // "description": "The project ID of the Google Cloud Platform project.", + // "location": "query", + // "type": "string" + // }, + // "systemId": { + // "description": "A system ID for filtering the results of the request.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "v1/{+name}/loginProfile", + // "response": { + // "$ref": "LoginProfile" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "oslogin.users.importSshPublicKey": + +type UsersImportSshPublicKeyCall struct { + s *Service + parent string + sshpublickey *SshPublicKey + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// ImportSshPublicKey: Adds an SSH public key and returns the profile +// information. Default POSIX +// account information is set when no username and UID exist as part of +// the +// login profile. +func (r *UsersService) ImportSshPublicKey(parent string, sshpublickey *SshPublicKey) *UsersImportSshPublicKeyCall { + c := &UsersImportSshPublicKeyCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.sshpublickey = sshpublickey + return c +} + +// ProjectId sets the optional parameter "projectId": The project ID of +// the Google Cloud Platform project. +func (c *UsersImportSshPublicKeyCall) ProjectId(projectId string) *UsersImportSshPublicKeyCall { + c.urlParams_.Set("projectId", projectId) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UsersImportSshPublicKeyCall) Fields(s ...googleapi.Field) *UsersImportSshPublicKeyCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *UsersImportSshPublicKeyCall) Context(ctx context.Context) *UsersImportSshPublicKeyCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *UsersImportSshPublicKeyCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *UsersImportSshPublicKeyCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200317") + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.sshpublickey) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}:importSshPublicKey") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "parent": c.parent, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "oslogin.users.importSshPublicKey" call. +// Exactly one of *ImportSshPublicKeyResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *ImportSshPublicKeyResponse.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *UsersImportSshPublicKeyCall) Do(opts ...googleapi.CallOption) (*ImportSshPublicKeyResponse, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ImportSshPublicKeyResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Adds an SSH public key and returns the profile information. Default POSIX\naccount information is set when no username and UID exist as part of the\nlogin profile.", + // "flatPath": "v1/users/{usersId}:importSshPublicKey", + // "httpMethod": "POST", + // "id": "oslogin.users.importSshPublicKey", + // "parameterOrder": [ + // "parent" + // ], + // "parameters": { + // "parent": { + // "description": "Required. The unique ID for the user in format `users/{user}`.", + // "location": "path", + // "pattern": "^users/[^/]+$", + // "required": true, + // "type": "string" + // }, + // "projectId": { + // "description": "The project ID of the Google Cloud Platform project.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "v1/{+parent}:importSshPublicKey", + // "request": { + // "$ref": "SshPublicKey" + // }, + // "response": { + // "$ref": "ImportSshPublicKeyResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "oslogin.users.projects.delete": + +type UsersProjectsDeleteCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Delete: Deletes a POSIX account. +func (r *UsersProjectsService) Delete(name string) *UsersProjectsDeleteCall { + c := &UsersProjectsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UsersProjectsDeleteCall) Fields(s ...googleapi.Field) *UsersProjectsDeleteCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *UsersProjectsDeleteCall) Context(ctx context.Context) *UsersProjectsDeleteCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *UsersProjectsDeleteCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *UsersProjectsDeleteCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200317") + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("DELETE", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "oslogin.users.projects.delete" call. +// Exactly one of *Empty or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Empty.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *UsersProjectsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Empty{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes a POSIX account.", + // "flatPath": "v1/users/{usersId}/projects/{projectsId}", + // "httpMethod": "DELETE", + // "id": "oslogin.users.projects.delete", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Required. A reference to the POSIX account to update. POSIX accounts are identified\nby the project ID they are associated with. A reference to the POSIX\naccount is in format `users/{user}/projects/{project}`.", + // "location": "path", + // "pattern": "^users/[^/]+/projects/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+name}", + // "response": { + // "$ref": "Empty" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "oslogin.users.sshPublicKeys.delete": + +type UsersSshPublicKeysDeleteCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Delete: Deletes an SSH public key. +func (r *UsersSshPublicKeysService) Delete(name string) *UsersSshPublicKeysDeleteCall { + c := &UsersSshPublicKeysDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UsersSshPublicKeysDeleteCall) Fields(s ...googleapi.Field) *UsersSshPublicKeysDeleteCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *UsersSshPublicKeysDeleteCall) Context(ctx context.Context) *UsersSshPublicKeysDeleteCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *UsersSshPublicKeysDeleteCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *UsersSshPublicKeysDeleteCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200317") + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("DELETE", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "oslogin.users.sshPublicKeys.delete" call. +// Exactly one of *Empty or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Empty.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *UsersSshPublicKeysDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Empty{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes an SSH public key.", + // "flatPath": "v1/users/{usersId}/sshPublicKeys/{sshPublicKeysId}", + // "httpMethod": "DELETE", + // "id": "oslogin.users.sshPublicKeys.delete", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Required. The fingerprint of the public key to update. Public keys are identified by\ntheir SHA-256 fingerprint. The fingerprint of the public key is in format\n`users/{user}/sshPublicKeys/{fingerprint}`.", + // "location": "path", + // "pattern": "^users/[^/]+/sshPublicKeys/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+name}", + // "response": { + // "$ref": "Empty" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "oslogin.users.sshPublicKeys.get": + +type UsersSshPublicKeysGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// Get: Retrieves an SSH public key. +func (r *UsersSshPublicKeysService) Get(name string) *UsersSshPublicKeysGetCall { + c := &UsersSshPublicKeysGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UsersSshPublicKeysGetCall) Fields(s ...googleapi.Field) *UsersSshPublicKeysGetCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *UsersSshPublicKeysGetCall) IfNoneMatch(entityTag string) *UsersSshPublicKeysGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *UsersSshPublicKeysGetCall) Context(ctx context.Context) *UsersSshPublicKeysGetCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *UsersSshPublicKeysGetCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *UsersSshPublicKeysGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200317") + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "oslogin.users.sshPublicKeys.get" call. +// Exactly one of *SshPublicKey or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *SshPublicKey.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *UsersSshPublicKeysGetCall) Do(opts ...googleapi.CallOption) (*SshPublicKey, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &SshPublicKey{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves an SSH public key.", + // "flatPath": "v1/users/{usersId}/sshPublicKeys/{sshPublicKeysId}", + // "httpMethod": "GET", + // "id": "oslogin.users.sshPublicKeys.get", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Required. The fingerprint of the public key to retrieve. Public keys are identified\nby their SHA-256 fingerprint. The fingerprint of the public key is in\nformat `users/{user}/sshPublicKeys/{fingerprint}`.", + // "location": "path", + // "pattern": "^users/[^/]+/sshPublicKeys/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+name}", + // "response": { + // "$ref": "SshPublicKey" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "oslogin.users.sshPublicKeys.patch": + +type UsersSshPublicKeysPatchCall struct { + s *Service + name string + sshpublickey *SshPublicKey + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Patch: Updates an SSH public key and returns the profile information. +// This method +// supports patch semantics. +func (r *UsersSshPublicKeysService) Patch(name string, sshpublickey *SshPublicKey) *UsersSshPublicKeysPatchCall { + c := &UsersSshPublicKeysPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.sshpublickey = sshpublickey + return c +} + +// UpdateMask sets the optional parameter "updateMask": Mask to control +// which fields get updated. Updates all if not present. +func (c *UsersSshPublicKeysPatchCall) UpdateMask(updateMask string) *UsersSshPublicKeysPatchCall { + c.urlParams_.Set("updateMask", updateMask) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UsersSshPublicKeysPatchCall) Fields(s ...googleapi.Field) *UsersSshPublicKeysPatchCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *UsersSshPublicKeysPatchCall) Context(ctx context.Context) *UsersSshPublicKeysPatchCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *UsersSshPublicKeysPatchCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *UsersSshPublicKeysPatchCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200317") + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.sshpublickey) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("PATCH", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "oslogin.users.sshPublicKeys.patch" call. +// Exactly one of *SshPublicKey or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *SshPublicKey.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *UsersSshPublicKeysPatchCall) Do(opts ...googleapi.CallOption) (*SshPublicKey, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &SshPublicKey{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an SSH public key and returns the profile information. This method\nsupports patch semantics.", + // "flatPath": "v1/users/{usersId}/sshPublicKeys/{sshPublicKeysId}", + // "httpMethod": "PATCH", + // "id": "oslogin.users.sshPublicKeys.patch", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Required. The fingerprint of the public key to update. Public keys are identified by\ntheir SHA-256 fingerprint. The fingerprint of the public key is in format\n`users/{user}/sshPublicKeys/{fingerprint}`.", + // "location": "path", + // "pattern": "^users/[^/]+/sshPublicKeys/[^/]+$", + // "required": true, + // "type": "string" + // }, + // "updateMask": { + // "description": "Mask to control which fields get updated. Updates all if not present.", + // "format": "google-fieldmask", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "v1/{+name}", + // "request": { + // "$ref": "SshPublicKey" + // }, + // "response": { + // "$ref": "SshPublicKey" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} diff --git a/vendor/modules.txt b/vendor/modules.txt index 618910dd0..bc9f7b1b9 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -800,8 +800,10 @@ google.golang.org/api/internal google.golang.org/api/internal/gensupport google.golang.org/api/internal/third_party/uritemplates google.golang.org/api/iterator +google.golang.org/api/oauth2/v2 google.golang.org/api/option google.golang.org/api/option/internaloption +google.golang.org/api/oslogin/v1 google.golang.org/api/storage/v1 google.golang.org/api/transport/cert google.golang.org/api/transport/http diff --git a/website/pages/partials/builder/googlecompute/Config-not-required.mdx b/website/pages/partials/builder/googlecompute/Config-not-required.mdx index d33a72d04..a2d267c91 100644 --- a/website/pages/partials/builder/googlecompute/Config-not-required.mdx +++ b/website/pages/partials/builder/googlecompute/Config-not-required.mdx @@ -176,6 +176,50 @@ - `use_internal_ip` (bool) - If true, use the instance's internal IP instead of its external IP during building. +- `use_os_login` (bool) - If true, OSLogin will be used to manage SSH access to the compute instance by + dynamically importing a temporary SSH key to the Google account's login profile, + and setting the `enable-oslogin` to `TRUE` in the instance metadata. + Optionally, `use_os_login` can be used with an existing `ssh_username` and `ssh_private_key_file` + if a SSH key has already been added to the Google account's login profile - See [Adding SSH Keys](https://cloud.google.com/compute/docs/instances/managing-instance-access#add_oslogin_keys). + + SSH keys can be added to an individual user account + + ```shell-session + $ gcloud compute os-login ssh-keys add --key-file=/home/user/.ssh/my-key.pub + + $ gcloud compute os-login describe-profile + PosixAccounts: + - accountId: + gid: '34567890754' + homeDirectory: /home/user_example_com + ... + primary: true + uid: '2504818925' + username: /home/user_example_com + sshPublicKeys: + 000000000000000000000000000000000000000000000000000000000000000a: + fingerprint: 000000000000000000000000000000000000000000000000000000000000000a + ``` + + Or SSH keys can be added to an associated service account + ```shell-session + $ gcloud auth activate-service-account --key-file= + $ gcloud compute os-login ssh-keys add --key-file=/home/user/.ssh/my-key.pub + + $ gcloud compute os-login describe-profile + PosixAccounts: + - accountId: + gid: '34567890754' + homeDirectory: /home/sa_000000000000000000000 + ... + primary: true + uid: '2504818925' + username: sa_000000000000000000000 + sshPublicKeys: + 000000000000000000000000000000000000000000000000000000000000000a: + fingerprint: 000000000000000000000000000000000000000000000000000000000000000a + ``` + - `vault_gcp_oauth_engine` (string) - Can be set instead of account_file. If set, this builder will use HashiCorp Vault to generate an Oauth token for authenticating against Google's cloud. The value should be the path of the token generator From 29ce80439230a146647897940d79a8f6afda6491 Mon Sep 17 00:00:00 2001 From: Wilken Rivera Date: Wed, 8 Jul 2020 08:00:24 -0400 Subject: [PATCH 37/38] update CHANGELOG --- CHANGELOG.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d6e3236d5..fc41c37ba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,14 +3,20 @@ ### IMPROVEMENTS: * builder/file: Create parent directories of target file, if they don't exist. [GH-9452] +* builder/google: Add support for oslogin via the `use_os_login` configuration + option [GH-9339] +* builder/googlecompute: Add `wrap_startup_script` configuration option to + allow the disabling of Packer's startup script wrapper [GH-9505] * builder/hyperone: Add support for custom username in vm creation. [GH-9497] * builder/hyperone: Skip chroot device discovery. [GH-9489] * builder/proxmox: Enable Proxmox builder to toggle the firewall parameter for network interfaces. [GH-9487] * builder/proxmox: Update Proxmox storagePoolTypes [GH-9418] +* builder/qemu: Add 'cdrom_interface' option to QEMU builder [GH-9483] * builder/ucloud: New access config options and run config options. [GH-9466] * builder/vsphere-clone: Add `boot_command` support to vsphere-clone builder, including support for starting an HTTP server +* builder/vsphere-clone: Add `vapp` configuration option [GH-9507] * builder/vsphere: Add boot_command support to vsphere-clone builder. [GH-9397] * builder/vsphere: Create vm output folders if they don't exist [GH-9402] * builder/vsphere: Look at all available IPs in the waiting for IP loop. @@ -31,7 +37,7 @@ types. [GH-9454] * core/hcl: Allow use of `keep_input_artifact` in post processors. [GH-9477] * core/hcl: Share build info with Provisioner and Post-Processor via HCL2 - variables [GH-9444] + variables [GH-9444] [GH-9534] * core: Add on-error flag option to run error-cleanup-provisioner [GH-9429] * post-processor/yandex-export: Support Authentication by Service Account Key file [GH-9379] @@ -55,12 +61,16 @@ [GH-9387] * builder/vmware: update vendor library, enabling retries on 502 errors [GH-9391] +* builder/vsphere-clone: Fix SSH public key injection for cloned templates + [GH-9507] * builder/vsphere: Fix vsphere ToolsSyncTime and ToolsUpgradePolicy [GH-9515] * communicator/winrm: add the "no_proxy" environment variable option to have winrm bypass the proxy set by the http_proxy or https_proxy environment vars, when connecting to the remote instance. [GH-9267] * core: Do not print download progress bar if a machine-readable UI is chosen. [GH-9448] +* post-processor/amazon-import: Add support for retrying RequestLimitExceeded + errors when importing an image [GH-9537] * provisioner/ansible: Correct check for whether PackerHttpAddr is implemented or not [GH-9498] From 371be8775df4654c7bb0579f4c849b2a28a024fa Mon Sep 17 00:00:00 2001 From: Wilken Rivera Date: Wed, 8 Jul 2020 08:03:19 -0400 Subject: [PATCH 38/38] update CHANGELOG * Adds backwards incompatibility note to 1.5.5 for variable interpolation fix of undefined variables. --- CHANGELOG.md | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fc41c37ba..f58563f12 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -271,6 +271,11 @@ ## 1.5.5 (March 25,2020) +### BACKWARDS INCOMPATIBILITIES: +* core: Interpolation of undefined variables will now error as expected, in + previous versions variables were allowed to be set as a command line + argument but that was because the validation was being ignored + ### IMPROVEMENTS: * builder/azure: Add support for configurable KeyVault SKU [GH-8879] * builder/hyperv: Add `first_boot_device` setting to allow the selection of the @@ -305,8 +310,6 @@ strings [GH-8829] ### Bug Fixes: -* bilder/proxmox: Bump proxmox-api-go to fix upstream bug where users hit open - file limit. [GH-8800] * builder/azure: Fix `winrm_password` attribution and allow users to set `winrm_username` [GH-8928] * builder/azure: Fix azure key vault cleanup failure [GH-8905] @@ -317,6 +320,8 @@ to fix SSH authentication issue [GH-8942] * builder/proxmox: Add new validation to catch that template_name cannot contain spaces. [GH-8799] +* builder/proxmox: Bump proxmox-api-go to fix upstream bug where users hit open + file limit. [GH-8800] * builder/vagrant: Fix path validation in ssh config step. [GH-8826] * builder/virtualbox-vm: Fix crash when VM has no snapshots. [GH-8906] * builder/virtualbox: Remove all floppy controllers before adding a new one. @@ -333,10 +338,12 @@ provisioners. [GH-8771] * core: Fix bug where user var recursion could fail intermittently when used with env vars [GH-8875] +* core: Interpolation of undefined variables will now error as expected * plugins: Make plugin discovery stricter with respect to periods so that users can disable plugins by renaming the extension [GH-8735] +* provisioner/salt: Fix `no_exit_on_failure` config to work correctly as + expected. [GH-9119] * provisioner/shell: "inline" config option is now a template engine. [GH-8883] -* provisioner/salt: Fix `no_exit_on_failure` config to work correctly as expected. [GH-9119] ## 1.5.4 (February 14, 2020) no-change release to fix code-signing on OSX binaries. Since checksums for these