Commit Graph

15400 Commits

Author SHA1 Message Date
Megan Marsh 5552c35e4f
Merge pull request #9099 from overdrive3000/template-secretsmanager
Add template function aws_secretsmanager
2020-04-21 11:19:05 -07:00
Megan Marsh 50823e2573
Merge pull request #9093 from Hakujou/osc-bsu-fix
Compliance with oAPI spec for Outscale osc-bsu builder
2020-04-21 10:49:46 -07:00
Juan Mesa e6dbbe454e Fix linting issues 2020-04-21 19:20:45 +02:00
Juan Mesa 0fca4a8ba8 Add template function aws_secretsmanager
Allow users to read secrets from AWS Secrets Manager via
packer template functions
2020-04-21 18:37:29 +02:00
Wilken Rivera fdd2c023c6 update changelog
* Update changelog format slightly
2020-04-21 06:43:28 -04:00
Adrien Delorme c5c3585df1 make docs a bit more readable for KeyValues too 2020-04-21 12:22:37 +02:00
Matthew Sanabria 761abdda4e
Updating documentation for azure-arm builder (#9097) 2020-04-21 10:47:48 +02:00
GennadySpb 1155ab8e3c
Add 'target_image_folder_id' for builder/yandex (#9080)
Add 'target_image_folder_id' for builder/yandex

Closes #9079
2020-04-20 15:20:05 +02:00
Romain Lecat 1f4e8785f3 Compliance with oAPI spec for Outscale OSC-BSU 2020-04-20 15:00:51 +02:00
vijayrajah 5d2fee04b2
builder/azure: enable boot Diagnostics (#9053)
* enable boot Diagnostics
2020-04-20 07:29:13 -04:00
Wilken Rivera cc367bd0b7
Merge pull request #9045 from lausser/cloud-init
feat(proxmox): add ability to add a cloud-init drive
2020-04-17 14:09:02 -04:00
Paul Meyer 89f3aa0bd6
[builder/azure-arm] Use VM/build location for image location (#9068)
* [builder/azure-arm] Use VM/build location for image locationThe builder was using the location of the containing resource group asthe image location, but the API call can only create images in the samelocation as the source VM that is being captured.
2020-04-17 05:43:03 -04:00
Matt Kotsenas fe55494207
Add `debug_mode` to PowerShell provisioner (#8996) 2020-04-17 11:39:39 +02:00
Megan Marsh 855808ec6f
Merge pull request #8970 from szamfirov/shielded_vm_support
Adding custom shielded images support (GCP)
2020-04-16 16:32:04 -07:00
Svetlin Zamfirov b706f02408 Fixing auto-generated code errors 2020-04-16 16:22:42 -07:00
Svetlin Zamfirov 31f0b0201a Remove changes from auto-generated code 2020-04-16 16:22:41 -07:00
Svetlin Zamfirov d827f4f757 Adding custom shielded images support (GCP)
Adds `enable_secure_boot`, `enable_vtpm` and `enable_integrity_monitoring`
config options to enable building of custom Shielded GCP Compute images.

Feedback on this is more than welcome as this is my first attempt in
contributing to anything Packer related.

Packer is great for us to build custom images on top of GCP but we would
like to enhance that to support Shielded VM images. This will allow us
to have more secure and trusted images which our team(s) will be using.
2020-04-16 16:22:41 -07:00
Megan Marsh 08787ba31f
Merge pull request #9028 from vijayrajah/set_azure_custom_res_names
Set Custom Resource Names for Azure-Arm builds
2020-04-16 15:58:41 -07:00
Megan Marsh 774f77f0a2
Merge pull request #9077 from hashicorp/remove-freebsd-builds
scripts/build: Remove unsupported Freebsd/arm builds from build chain
2020-04-16 15:55:47 -07:00
Vijay Rajah da7382980a Fix failing test & format code 2020-04-17 00:17:39 +05:30
vijayrajah fff06353b7
Update builder/azure/arm/tempname.go
refactor the code.. thanks for the suggestion @sylviamoss

Co-Authored-By: Sylvia Moss <sylviamoss.m@gmail.com>
2020-04-17 00:04:39 +05:30
Adrien Delorme 73242e8de4 make sure keyvalue and namevalue filters are using the same naming as the service being used 2020-04-16 17:22:13 +02:00
Wilken Rivera 951cd0f55e scripts/build: Remove unsupported Freebsd/arm builds from build chain
Builds before change
```
⇶  make bin
WARN: 'make bin' is for debug / test builds only. Use 'make release' for
release builds.
==> Checking for necessary tools...
==> Entering Packer source dir...
==> Ensuring output directories are present...
==> Removing old builds...
==> Building...
Number of parallel builds: 3

-->     linux/s390x: github.com/hashicorp/packer
-->     linux/amd64: github.com/hashicorp/packer
-->       linux/arm: github.com/hashicorp/packer
-->   solaris/amd64: github.com/hashicorp/packer
-->      linux/mips: github.com/hashicorp/packer
-->     freebsd/386: github.com/hashicorp/packer
-->     linux/arm64: github.com/hashicorp/packer
-->    linux/mips64: github.com/hashicorp/packer
-->    linux/mipsle: github.com/hashicorp/packer
-->    darwin/amd64: github.com/hashicorp/packer
-->       linux/386: github.com/hashicorp/packer
-->      darwin/386: github.com/hashicorp/packer
-->     windows/386: github.com/hashicorp/packer
-->   windows/amd64: github.com/hashicorp/packer
-->   linux/ppc64le: github.com/hashicorp/packer
-->     openbsd/386: github.com/hashicorp/packer
-->     freebsd/arm: github.com/hashicorp/packer
-->   openbsd/amd64: github.com/hashicorp/packer
-->   freebsd/amd64: github.com/hashicorp/packer

1 errors occurred:
--> freebsd/arm error: exit status 2
Stderr: # github.com/shirou/gopsutil/cpu
../go/pkg/mod/github.com/shirou/gopsutil@v2.18.12+incompatible/cpu/cpu_freebsd.go:25:16:
undefined: cpuTimes
../go/pkg/mod/github.com/shirou/gopsutil@v2.18.12+incompatible/cpu/cpu_freebsd.go:42:31:
undefined: cpuTimes
../go/pkg/mod/github.com/shirou/gopsutil@v2.18.12+incompatible/cpu/cpu_freebsd.go:66:38:
undefined: cpuTimes
../go/pkg/mod/github.com/shirou/gopsutil@v2.18.12+incompatible/cpu/cpu_freebsd.go:72:15:
undefined: cpuTimes
../go/pkg/mod/github.com/shirou/gopsutil@v2.18.12+incompatible/cpu/cpu_freebsd.go:87:13:
undefined: cpuTimes

==> Copying binaries for this platform...
'./pkg/linux_amd64/packer' -> 'bin/packer'
'./pkg/linux_amd64/packer' -> '/home/wilken/Development/go/bin/packer'

==> Results:
total 111M
-rwxr-xr-x 1 wilken wilken 111M Apr 14 22:02 packer
```

Builds after change
```
⇶  make bin
WARN: 'make bin' is for debug / test builds only. Use 'make release' for
release builds.
==> Checking for necessary tools...
==> Entering Packer source dir...
==> Ensuring output directories are present...
==> Removing old builds...
==> Building...
Number of parallel builds: 3

-->   solaris/amd64: github.com/hashicorp/packer
-->   windows/amd64: github.com/hashicorp/packer
-->     linux/s390x: github.com/hashicorp/packer
-->    darwin/amd64: github.com/hashicorp/packer
-->      darwin/386: github.com/hashicorp/packer
-->     windows/386: github.com/hashicorp/packer
-->   freebsd/amd64: github.com/hashicorp/packer
-->     freebsd/386: github.com/hashicorp/packer
-->     openbsd/386: github.com/hashicorp/packer
-->   openbsd/amd64: github.com/hashicorp/packer
-->     linux/arm64: github.com/hashicorp/packer
-->       linux/386: github.com/hashicorp/packer
-->     linux/amd64: github.com/hashicorp/packer
-->       linux/arm: github.com/hashicorp/packer
-->      linux/mips: github.com/hashicorp/packer
-->   linux/ppc64le: github.com/hashicorp/packer
-->    linux/mips64: github.com/hashicorp/packer
-->    linux/mipsle: github.com/hashicorp/packer
==> Copying binaries for this platform...
'./pkg/linux_amd64/packer' -> 'bin/packer'
'./pkg/linux_amd64/packer' ->
'/home/wilken/Development/golang/bin/packer'

==> Results:
total 111M
-rwxr-xr-x 1 wilken wilken 111M Apr 15 20:52 packer
```
2020-04-16 06:05:34 -04:00
Sylvia Moss 553b1fb9f8
Add RetriedProvisioner to allow retry provisioners (#9061) 2020-04-16 11:58:54 +02:00
Gerhard Lausser dc2813c8e2 feat(proxmox): add ability to add a cloud-init drive 2020-04-15 22:00:42 +02:00
Wilken Rivera d580ea7950
Merge pull request #9069 from tencentyun/master
builder/tencent: fixed InstanceOperationInProgress error #9054
2020-04-15 07:21:33 -04:00
Wilken Rivera 7ec55860e5
Revert golangci-lint to use new-from-rev pinned at 1.23.8 (#9072)
Turns out linting each file individually causes issues with the linter not being able to find the import types.
2020-04-15 06:53:51 -04:00
Thor K. Høgås ebfc5bcdcb
Merge branch 'master' into feature/vgpu-profiles 2020-04-15 12:02:37 +02:00
Wilken Rivera e8f8ebf132
builder/vmware: Add some additional debug logging to the driver version check (#9064) 2020-04-15 10:34:48 +02:00
Li Kexian 632610d9c0
fixed InstanceOperationInProgress error #9054 2020-04-15 12:38:50 +08:00
Megan Marsh f10ab4135a
Merge pull request #9065 from Charliekenney23/update-linode-codeowners
add linode codeowners
2020-04-14 15:02:05 -07:00
Wilken Rivera 57e49e8c34
Merge pull request #9066 from hashicorp/remove_appveyor_build
stop using redundant appveyor builds
2020-04-14 15:08:48 -04:00
Megan Marsh cf576d9b4e stop using redundant appveyor builds 2020-04-14 11:58:29 -07:00
Megan Marsh f12269f124
fix builds on linux (#9031)
* fix builds on linux

* Build: Move to CGO_ENABLED=0 (#9057)

After further investigation on cross-compiling Go bins on Linux. I found
that statically linking against GCC (for libc) failed to build for ARM
and introduced a possible licensing issue as our bins would essentially
be bundling libc into the bin. Diving further into cross compiling on Linux
I found that the defacto solution is to compile with CGO disabled - this
was also found to be the case for other HashiCorp products.

Disabling CGO has the limitation of not allowing the use of any pkg that
calls out to C (net, os), but in looking into the Packer code base and
the relevant Go code base it appears that the latest versions of Go have
pure Go implementations of the said packages so I believe we are good to
go. I should also point out that CGO is disabled by default when cross
compiling via `go build`. However, the GOX tool will enable it if it is
not explicitly disabled.

Below are three test cases executed to validate the compile bins work as
expected.

Build results after change
```
⇶  make bin
WARN: 'make bin' is for debug / test builds only. Use 'make release' for
release builds.
==> Checking for necessary tools...
==> Entering Packer source dir...
==> Ensuring output directories are present...
==> Removing old builds...
==> Building...
Number of parallel builds: 7

-->   windows/amd64: github.com/hashicorp/packer
-->     linux/arm64: github.com/hashicorp/packer
-->       linux/386: github.com/hashicorp/packer
-->       linux/arm: github.com/hashicorp/packer
-->    darwin/amd64: github.com/hashicorp/packer
-->     windows/386: github.com/hashicorp/packer
-->     linux/amd64: github.com/hashicorp/packer
-->      darwin/386: github.com/hashicorp/packer
==> Copying binaries for this platform...
'./pkg/linux_amd64/packer' -> 'bin/packer'
'./pkg/linux_amd64/packer' -> '/home/wilken/Development/go/bin/packer'

==> Results:
total 111M
-rwxr-xr-x 1 wilken wilken 111M Apr 13 12:29 packer
```

Packer executed on ARM based machine
```
ubuntu@ip-172-31-10-18:~$ ./packer version
Packer v1.5.6-dev (314ac5b65+CHANGES

ubuntu@ip-172-31-10-18:~$ uname -a
Linux ip-172-31-10-18 4.15.0-1054-aws #56-Ubuntu SMP Thu Nov 7 16:18:50 UTC 2019 aarch64 aarch64 aarch64 GNU/Linux

ubuntu@ip-172-31-10-18:~$ ./packer build build.json
null: output will be in this color.

==> null: Running local shell script: /tmp/packer-shell170248556
    null: UUID from Packer: 79cc8532-6114-925d-2a79-33ef6ce281cd
Build 'null' finished.

==> Builds finished. The artifacts of successful builds are:
--> null: Did not export anything. This is the null builder
```

Custom Docker image with updated bin
```
⇶  docker run packertest:latest version
Packer v1.5.6-dev (314ac5b65+CHANGES)

⇶  docker run packertest:latest build build.json
null: output will be in this color.

==> null: Running local shell script: /tmp/packer-shell065599452
    null: UUID from Packer: 852f0604-2be4-9e16-99af-6d7df972ac2e
Build 'null' finished.

==> Builds finished. The artifacts of successful builds are:
--> null: Did not export anything. This is the null builder
```

Windows AMI
```
[...]
==> amazon-ebs: Launching a source AWS instance...
==> amazon-ebs: Adding tags to source instance
    amazon-ebs: Adding tag: "Name": "Packer Builder"
    amazon-ebs: Instance ID: i-04387545cf3e2acd3
==> amazon-ebs: Waiting for instance (i-04387545cf3e2acd3) to become ready...
==> amazon-ebs: Skipping waiting for password since WinRM password set...
==> amazon-ebs: Using winrm communicator to connect: 18.206.100.104
==> amazon-ebs: Waiting for WinRM to become available...
    amazon-ebs: WinRM connected.
==> amazon-ebs: Connected to WinRM!
==> amazon-ebs: Uploading packertest => c:/Windows/Temp
==> amazon-ebs: Provisioning with Powershell...
==> amazon-ebs: Provisioning with powershell script: /tmp/powershell-provisioner173180945
    amazon-ebs: Packer v1.5.6-dev (314ac5b65+CHANGES)
    amazon-ebs: null: output will be in this color.
    amazon-ebs:
```

Co-authored-by: Wilken Rivera <dev@wilkenrivera.com>
2020-04-14 14:48:50 -04:00
Charles Kenney ba53a01405
add linode codeowners 2020-04-14 14:40:56 -04:00
Megan Marsh 3df20fc40b
Merge pull request #9018 from VladRassokhin/vsphere-efi-secure-boot
builder/vsphere-iso: support EFI Secure Boot
2020-04-14 10:47:05 -07:00
Megan Marsh 440f540e28 fix merge issues with generated code 2020-04-14 10:31:57 -07:00
Vladislav Rassokhin 5f2849b5b4 builder/vsphere-clone: support firmware changing 2020-04-14 10:28:43 -07:00
Vladislav Rassokhin 91a1ad63fa builder/vsphere-iso: support EFI Secure Boot using another value in `firmware` (#8873) 2020-04-14 10:28:22 -07:00
Megan Marsh 31946d551e
Merge pull request #9063 from hashicorp/codeowners-tencentcloud
CODEOWNERS: Add code owner for tencentcloud
2020-04-14 09:34:30 -07:00
Wilken Rivera 78642536b4 CODEOWNERS: Add code owner for tencentcloud 2020-04-14 11:02:04 -04:00
Adrien Delorme 840e67f775
HCL2: when we see a map generate an attribute spec instead of a block spec (#9035)
* mapstructure-to-hcl2: when we see a map generate an attribute spec and not a block spec

this will alow to do

tags = {
 key = "value"
}

instead of

tags {
  key = "value"
}

This will also enable using variables directly for those tags

* generate code

* update tests
2020-04-14 16:05:13 +02:00
Wilken Rivera 5075fc6ff7
Merge pull request #9059 from hashicorp/d-update-getting-started
docs/getting-started: Update PATH install instructions
2020-04-14 08:34:54 -04:00
Wilken Rivera 9eccbb4cfe docs/getting-started: Update PATH install instructions 2020-04-14 06:46:29 -04:00
Wilken Rivera c9c0ee65d3
circle-ci: update ci-lint steps (#9043)
* new-from-rev option is showing inconsistent results on circle and
locally. This change moves to a custom command `script/lint.sh` that gets a list of added
go files and pipes them to golangci-lint for testing.

* Add a git fetch as a step before retrieving merge-base changes to fix
the issue described at https://discuss.circleci.com/t/checkout-script-adds-commits-to-master-from-circle-branch/14194/2

* Moved source code out of GOPATH to ensure go mod support and reduce
the risk of having golangci-lint trying to scan all of the files within
GOPATH. This was an issue in the past, in changing it I found less OOM
issues on circle.
2020-04-14 12:03:22 +02:00
Wilken Rivera cc257387f1
Merge pull request #9056 from jhawk28/bug_9051
clean up documentation for new vsphere NIC and storage params
2020-04-13 14:44:10 -04:00
Joshua Foster 7f0dbdebb2 clean up documentation for new NIC and storage params
adding examples, updating .gitattributes so *.mdx files have LF endings for windows
2020-04-13 14:28:50 -04:00
Marc Carmier a1d14c75f4
Update vsphere documentation with link to the `vsphere-iso` builder (#9041) 2020-04-10 13:03:55 -04:00
Wilken Rivera 6b52df0c50 update changelog 2020-04-10 12:38:21 -04:00
Wilken Rivera be6fe60306
Merge pull request #9037 from hashicorp/fix_9032
golang 1.14 doesn't like calling NewFile on existing files. Port solution over from Terraform
2020-04-10 06:32:53 -04:00