packer-cn/builder/hyperv/common
Adrien Delorme 40947c2bf6
HCL2: generate hcl tags with go-cty tags too (#9306)
This will allow to generate the config files:

```go
package main

import (
	"fmt"

	"github.com/hashicorp/hcl/v2/gohcl"
	"github.com/hashicorp/hcl/v2/hclwrite"
	"github.com/hashicorp/packer/builder/alicloud/ecs"
)

func main() {
	name := "name"
	app := ecs.FlatConfig{
		AlicloudImageName: &name,
		ECSSystemDiskMapping: &ecs.FlatAlicloudDiskDevice{
			DiskName: &name,
		},
	}

	f := hclwrite.NewEmptyFile()
	block := gohcl.EncodeAsBlock(&app, `source "something" "something"`)
	f.Body().AppendBlock(block)
	fmt.Printf("%s", f.Bytes())
}

```

Will output:

```
source "something" "something" {
  packer_user_variables      = null
  packer_sensitive_variables = null
  image_name                 = "name"
  image_share_account        = null
  image_unshare_account      = null
  image_copy_regions         = null
  image_copy_names           = null
  tags                       = null
  tag                        = null
  system_disk_mapping        = { disk_category = null, disk_delete_with_instance = null, disk_descri
ption = null, disk_device = null, disk_encrypted = null, disk_name = "name", disk_size = null, disk_
snapshot_id = null }
  image_disk_mappings        = null
  ssh_remote_tunnels         = null
  ssh_local_tunnels          = null
  ssh_public_key             = null
  ssh_private_key            = null
}
```

This is a good first step for #9015 and #9282 

fix #9304
2020-05-28 11:19:00 +02:00
..
artifact.go Sharing info with post-processors via artifact (#8632) 2020-01-30 11:27:58 +01:00
artifact_test.go Sharing info with post-processors via artifact (#8632) 2020-01-30 11:27:58 +01:00
config.go hyperv: add support for setting the boot order (#9046) 2020-04-30 13:31:41 +02:00
driver.go hyperv: add support for setting the boot order (#9046) 2020-04-30 13:31:41 +02:00
driver_mock.go hyperv: add support for setting the boot order (#9046) 2020-04-30 13:31:41 +02:00
driver_ps_4.go hyperv: add support for setting the boot order (#9046) 2020-04-30 13:31:41 +02:00
output_config.go commit old code generation tool 2019-10-15 12:56:42 +02:00
output_config.hcl2spec.go HCL2: generate hcl tags with go-cty tags too (#9306) 2020-05-28 11:19:00 +02:00
output_config_test.go use interpolate.NewContext() instead of testConfigTemplate(t) 2019-06-14 12:17:28 +02:00
ssh.go allow user to set winrm_host override like we do ssh_host override 2020-01-30 15:22:22 -08:00
ssh_config.go move packer to hashicorp 2017-04-04 13:39:01 -07:00
step_clone_vm.go implement ID and Type values in the provisioner template info sharing 2019-12-13 11:57:01 -08:00
step_collate_artifacts.go rename interpolation context from ctx to ictx and contexts to ctx to avoid conflicts 2019-04-03 15:56:15 +02:00
step_collate_artifacts_test.go Change variable/statebag key name to better convey purpose 2018-07-20 02:12:45 +01:00
step_compact_disk.go rename interpolation context from ctx to ictx and contexts to ctx to avoid conflicts 2019-04-03 15:56:15 +02:00
step_compact_disk_test.go Change variable/statebag key name to better convey purpose 2018-07-20 02:12:45 +01:00
step_configure_ip.go rename interpolation context from ctx to ictx and contexts to ctx to avoid conflicts 2019-04-03 15:56:15 +02:00
step_configure_vlan.go rename interpolation context from ctx to ictx and contexts to ctx to avoid conflicts 2019-04-03 15:56:15 +02:00
step_create_build_dir.go rename interpolation context from ctx to ictx and contexts to ctx to avoid conflicts 2019-04-03 15:56:15 +02:00
step_create_build_dir_test.go Add tmp package that offers Dir & File funcs 2018-12-12 16:35:57 +01:00
step_create_external_switch.go Remove explicit err var declaration 2019-10-09 13:17:43 +02:00
step_create_switch.go rename interpolation context from ctx to ictx and contexts to ctx to avoid conflicts 2019-04-03 15:56:15 +02:00
step_create_vm.go implement ID and Type values in the provisioner template info sharing 2019-12-13 11:57:01 -08:00
step_create_vm_test.go add tests 2019-06-13 14:29:22 -07:00
step_disable_vlan.go rename interpolation context from ctx to ictx and contexts to ctx to avoid conflicts 2019-04-03 15:56:15 +02:00
step_enable_integration_service.go rename interpolation context from ctx to ictx and contexts to ctx to avoid conflicts 2019-04-03 15:56:15 +02:00
step_export_vm.go rename interpolation context from ctx to ictx and contexts to ctx to avoid conflicts 2019-04-03 15:56:15 +02:00
step_export_vm_test.go Fix up tests. Ensure export step stores the export path in state 2018-07-20 02:12:44 +01:00
step_mount_dvddrive.go fmt && generate 2020-02-21 01:07:58 -06:00
step_mount_floppydrive.go rename interpolation context from ctx to ictx and contexts to ctx to avoid conflicts 2019-04-03 15:56:15 +02:00
step_mount_guest_additions.go rename interpolation context from ctx to ictx and contexts to ctx to avoid conflicts 2019-04-03 15:56:15 +02:00
step_mount_secondary_dvd_images.go rename interpolation context from ctx to ictx and contexts to ctx to avoid conflicts 2019-04-03 15:56:15 +02:00
step_polling_installation.go rename interpolation context from ctx to ictx and contexts to ctx to avoid conflicts 2019-04-03 15:56:15 +02:00
step_reboot_vm.go rename interpolation context from ctx to ictx and contexts to ctx to avoid conflicts 2019-04-03 15:56:15 +02:00
step_run.go Replace file shared state by statebag (#9238) 2020-05-19 11:49:48 +02:00
step_set_boot_order.go hyperv: add support for setting the boot order (#9046) 2020-04-30 13:31:41 +02:00
step_set_boot_order_test.go hyperv: add support for setting the boot order (#9046) 2020-04-30 13:31:41 +02:00
step_set_first_boot_device.go Fix raw string breaks escaping 2020-02-22 02:40:41 -06:00
step_set_first_boot_device_test.go More testing (#4) 2020-02-22 02:03:42 -06:00
step_shutdown.go allow a provisioner to timeout 2019-04-08 20:09:21 +02:00
step_sleep.go rename interpolation context from ctx to ictx and contexts to ctx to avoid conflicts 2019-04-03 15:56:15 +02:00
step_test.go Tests for step to create build directory 2018-07-20 02:12:45 +01:00
step_type_boot_command.go Replace file shared state by statebag (#9238) 2020-05-19 11:49:48 +02:00
step_unmount_dvddrive.go rename interpolation context from ctx to ictx and contexts to ctx to avoid conflicts 2019-04-03 15:56:15 +02:00
step_unmount_floppydrive.go rename interpolation context from ctx to ictx and contexts to ctx to avoid conflicts 2019-04-03 15:56:15 +02:00
step_unmount_guest_additions.go rename interpolation context from ctx to ictx and contexts to ctx to avoid conflicts 2019-04-03 15:56:15 +02:00
step_unmount_secondary_dvd_images.go rename interpolation context from ctx to ictx and contexts to ctx to avoid conflicts 2019-04-03 15:56:15 +02:00
step_wait_for_install_to_complete.go rename interpolation context from ctx to ictx and contexts to ctx to avoid conflicts 2019-04-03 15:56:15 +02:00