Commit Graph

14450 Commits

Author SHA1 Message Date
Lars Lehtonen 74a94d8547
helper/builder/testing: prune unused functions (#8852) 2020-03-09 10:46:32 +01:00
Adrien Delorme 9e6c94e141
circleci: VersionPrerelease: show tag or branch name and hash when building binary (#8850)
VersionPrerelease=${CIRCLE_TAG:=${CIRCLE_BRANCH}}-${CIRCLE_SHA1:0:9}"
2020-03-06 14:03:18 -05:00
jnsc 764b4cb50a
updated link to GuestOsIdentifier (#8849)
Co-authored-by: Adrien Delorme <adrien.delorme@icloud.com>
2020-03-06 15:30:11 +01:00
Wilken Rivera 9403b48a52
hcl2template/types.variables: Update logic for parsing literal value variables (#8834)
* hcl2template/types.variables: Update logic for parsing literal value variables

In running tests via the CLI it was determined that when using the variable block with no explicit type assigned the type of the default
value was not being set within the map. This change updates the `decodeConfig` method so that a type is always set for any defined variable if not specified.

The second change is to properly handle the evaluation of basic variable types (e.g String, Number, Bool). Previously variables defined on the
CLI or via PKR_VAR required some additional quoting to for proper evaluation. This change fixes that issue so that it works like it does in Terraform :)

Build results before the change
```
⇶  PKR_VAR_example='["one","two"]' ~/bin/packer build -var 'foo=home' .
Error: Variables not allowed

  on <value for var.foo from arguments> line 1:
  (source code not available)

Variables may not be used here.

==> Builds finished but no artifacts were created.

```

Build results after the change
```
⇶  PKR_VAR_example='["one","two"]' ~/bin/packer build -var 'foo="home"' .
null: output will be in this color.

==> null: Running local shell script: /tmp/packer-shell885249462
    null: two
    null: home
Build 'null' finished.

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

⇶  ~/bin/packer build -var 'foo=home' -var 'example=["one","another variable"]' .
null: output will be in this color.

==> null: Running local shell script: /tmp/packer-shell123467506
    null: another variable
    null: home
Build 'null' finished.

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

```

* tests/hcl2template/types.variables: Update test to use Bool

Turns out a string value won't actually complain if it's given a non
string looking value. It will just covert the value to a string literal
so using a type Bool which should fail if given anything that is not
true or false.

* tests/hcl2template/types.variables: Update unit tests

During testing it was found that by default the variable stanza were defaulting to a cty.NilType, and not the Type of it's default value.
This change sets the default type of the defined variable to ensure variable evaluation behaviors correctly.

* Add a simple cty.Bool test case

* tests/hcl2template/types.variables:  Enable quoted_string test case

* Update hcl2template/types.variables.go

space

Co-authored-by: Adrien Delorme <azr@users.noreply.github.com>
2020-03-06 15:12:26 +01:00
Wilken Rivera 698924f246
vSphere ISO supports more common options (#8845)
The `convert_to_template` and `create_snapshot` are supported across
both builders, but currently only shown in the vSphere Clone docs, this adds
them to it.
2020-03-05 15:04:15 -05:00
Megan Marsh 7e382d0df7
Merge pull request #8828 from mvitaly/fix_8816
Remove all floppy controllers before adding a new one
2020-03-05 09:35:20 -08:00
Megan Marsh 8832b3e2ca
Merge pull request #8787 from jhawk28/vsphere_iso_multiple_disks
(vsphere-iso) add ability to define multiple disks
2020-03-04 15:17:54 -08:00
Wilken Rivera e1a46ec293
Fix gosimple S1025 linting errors (#8838)
Remove unneeded use of fmt.Sprintf for variables that are already strings.
2020-03-04 15:31:30 -05:00
Sylvia Moss 717b9047db
Fix boot command link in ssh communicator doc (#8839) 2020-03-04 16:28:39 +01:00
Joshua Foster 1dbe5abc14 update documentation based on feedback 2020-03-04 09:48:01 -05:00
Joshua Foster d7230827cd (vsphere-iso) add ability to define multiple disks
Closes #8749
2020-03-04 09:48:01 -05:00
Vitaly Polonetsky 25f59a1592 Add a simple test for the call to remove all floppy controllers 2020-03-03 20:58:09 -08:00
Noel Quiles 4ed896fc99
Update middleman-hashicorp to 0.3.44 (#8836) 2020-03-03 22:59:24 -05:00
Megan Marsh 5281740275
Merge pull request #8831 from rjhornsby/master
Clarify `expect_disconnect` behavior
2020-03-03 13:54:34 -08:00
rjhornsby b91c4d32cc
Additional clarity
Co-Authored-By: Megan Marsh <megan@hashicorp.com>
2020-03-03 15:19:13 -06:00
Megan Marsh e35a872414
Merge pull request #8830 from hashicorp/d-var-file-hcl2-not-yet
document that the `-var-file` option still expects JSON files for now
2020-03-03 13:13:05 -08:00
Megan Marsh fc110e747f
Merge pull request #8832 from alrs/post-processor-deprecated-session-new
post-processor/digitalocean-import/post-processor.go: Replace Deprecated session.New()
2020-03-03 13:11:54 -08:00
Lars Lehtonen db7a40d6ea
post-processor/digitalocean-import/post-processor.go: replace deprecated session.New() with session.NewSession() 2020-03-03 11:53:40 -08:00
Rick Hornsby 0a2fb8c383 Clarify `expect_disconnect` behavior 2020-03-03 12:44:58 -06:00
Adrien Delorme d2964d59e9 document that the `-var-file` option still expects JSON files for now 2020-03-03 17:19:51 +01:00
Sylvia Moss ce674ff272
Add exclude mapstructure tag to exclude from hcl2spec struct (#8785) 2020-03-03 17:13:39 +01:00
Megan Marsh 6dbe86fcf4
only re-set path name if it needs to be unquoted; otherwise unquote r… (#8826) 2020-03-03 11:17:48 +01:00
Vitaly Polonetsky 67c9c2a59a Remove all floppy controllers before adding a new one 2020-03-02 21:56:20 -08:00
Megan Marsh 6540891ca2
Merge pull request #8825 from alrs/fix-powershell-err
common/powershell: Fix Dropped Error
2020-03-02 16:32:43 -08:00
Megan Marsh d422d81dec
Merge pull request #8823 from hashicorp/d-provisioners-update-index
docs/provisioners/index: Add link to Template Provisioners section
2020-03-02 15:00:43 -08:00
Lars Lehtonen f808d1d968
common/powershell: fix dropped error 2020-03-02 14:45:22 -08:00
Wilken Rivera b8408c1c1a
Merge pull request #8824 from hashicorp/d-hcl2-guides-issues-note
guides/hcl: Add link to HCL2 issues tracked on the Packer repo
2020-03-02 17:41:10 -05:00
Wilken Rivera 5dfeddc3a4 guides/hcl: Add link to HCL2 issues tracked on the Packer repo
This change adds a partial that contains a link to the HCL2 issues currently being tracked on GitHub. The partial has been added to the majority of the HCL2 guide documents as a way to help users learn about any open or recently resolved issues pertaining to the HCL2 support in Packer.
2020-03-02 17:13:35 -05:00
Megan Marsh 0f9c3e2cb4
Merge pull request #8784 from kirannhegde/bugfix-4295
Citrix XenServer packer plugin-#4295
2020-03-02 12:53:11 -08:00
Megan Marsh 9c9826ee4b
Merge pull request #8714 from williamb1024/hyperv-gen1-boot-order
WIP: Add Hyper-V builder `first_boot_device` setting to allow the selection of the initial device or device class used for booting the VM.
2020-03-02 12:27:25 -08:00
Wilken Rivera 433c9e8276 docs/provisioners/index: Add link to Template Provisioners section 2020-03-02 15:05:00 -05:00
Megan Marsh 5eead20ae4
Merge pull request #8811 from benjamb/size-check
Fix Hyper-V compacted disk size comparison
2020-03-02 10:44:35 -08:00
Ben Brown 0936f8bc03 Fix Hyper-V compacted disk size comparison
Prior to this the code compares the length of the path, which of course
doesn't change.
2020-03-02 09:55:13 +00:00
Megan Marsh 0cfcbd66ca
execute_command in powershell wasn't interpolating build vars properly (#8771) 2020-03-02 04:20:32 -05:00
Larry Eichenbaum b45ed4c4f1
Update build-image-in-cicd.html.md (#8813)
typo
2020-03-02 04:10:51 -05:00
Megan Marsh 60d952033e
Merge pull request #8798 from EnMod/nq.add-x-frame-options-header
[Website] Set security-focused page headers
2020-02-28 11:42:24 -08:00
Megan Marsh 7d065d9030
Merge pull request #8793 from hashicorp/dependabot/bundler/website/nokogiri-1.10.8
Bump nokogiri from 1.10.4 to 1.10.8 in /website
2020-02-28 11:41:10 -08:00
Megan Marsh 66f01b6033
Merge pull request #8801 from andretorres-codurance/patch-1
Update ansible.html.md.erb
2020-02-28 11:20:13 -08:00
Megan Marsh 6d59cbd4b5
Merge pull request #8799 from carlpett/proxmox/validate-template-name
proxmox: template_name cannot contain spaces
2020-02-28 11:19:18 -08:00
Megan Marsh 36d574c9ec
Merge pull request #8800 from carlpett/proxmox/bump-api-dep
Bump proxmox-api-go
2020-02-28 10:19:16 -08:00
Megan Marsh f25dc1cf74
Merge pull request #8815 from hashicorp/generate_boot_commanmd
regenerate boot command code
2020-02-28 10:15:26 -08:00
Megan Marsh 66a1cdb8d2 regenerate boot command code 2020-02-28 09:50:50 -08:00
andretorres-codurance 5d4e9af9cd
Update ansible.html.md.erb 2020-02-26 10:38:40 +00:00
Calle Pettersson 81a65dac4f Bump proxmox-api-go 2020-02-26 08:47:44 +01:00
Calle Pettersson 17fa6a3e95 proxmox: template_name cannot contain spaces 2020-02-26 08:44:27 +01:00
Noel Quiles 806e799945
[Website] Set security-focused page headers
- Sets X-Frame-Options to SAMEORIGIN
- Sets Strict-Transport-Security to:
  max-age=31536000; includeSubDomains; preload
2020-02-25 19:11:47 -05:00
dependabot[bot] dbb884deb3
Bump nokogiri from 1.10.4 to 1.10.8 in /website
Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.10.4 to 1.10.8.
- [Release notes](https://github.com/sparklemotion/nokogiri/releases)
- [Changelog](https://github.com/sparklemotion/nokogiri/blob/master/CHANGELOG.md)
- [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.10.4...v1.10.8)

Signed-off-by: dependabot[bot] <support@github.com>
2020-02-25 08:03:20 +00:00
William Brooks 8e0ed66318 Fix raw string breaks escaping 2020-02-22 02:40:41 -06:00
William Brooks efa9d94d8e use raw string around regex to make go lint happy 2020-02-22 02:22:59 -06:00
William d246d0c82a
More testing (#4)
Additional testing for SetFirstBootDevice and checking configuration in config.Prepare()
2020-02-22 02:03:42 -06:00