Commit Graph

16077 Commits

Author SHA1 Message Date
Sylvia Moss 903deb9e6a
vSphere StepHardware tests (#9866) 2020-09-02 10:19:57 +02:00
Megan Marsh bddf3b03f7
Merge pull request #9832 from hashicorp/azr-inspect-allow-unsed-variables
Inspect allow unset variables in HCL2 and JSON
2020-09-01 11:16:54 -07:00
Megan Marsh e96cc07a1a
Merge pull request #9853 from remyleone/boottype_local
change default scaleway boottype to local
2020-09-01 10:44:42 -07:00
Wilken Rivera 79bc643c17
post-processor/digitalocean-import: Update documentation (#9865)
* Add a note to use the DigitialOcean Builder when working directly on Digital Ocean
* Add HCL2 example to the documentation
2020-09-01 11:08:06 -04:00
Wilken Rivera 10e74961d2
Add check for empty artifact.Files slice (#9857)
* Add check for empty artifact.Files slice

Tests before change
```
⇶  go test ./post-processor/digitalocean-import/... -run=TestPostProcsor_extractImageArtifact
2020/08/31 13:51:25 Looking for image in artifact
--- FAIL: TestPostProcsor_extractImageArtifact (0.00s)
panic: runtime error: index out of range [0] with length 0 [recovered]
        panic: runtime error: index out of range [0] with length 0

goroutine 7 [running]:
testing.tRunner.func1.1(0xfb0300, 0xc000456460)
        /usr/local/go/src/testing/testing.go:940 +0x2f5
testing.tRunner.func1(0xc0003ab560)
        /usr/local/go/src/testing/testing.go:943 +0x3f9
panic(0xfb0300, 0xc000456460)
        /usr/local/go/src/runtime/panic.go:969 +0x166
github.com/hashicorp/packer/post-processor/digitalocean-import.extractImageArtifact(0x0, 0x0, 0x0, 0x24, 0xc000060ea0, 0x453937, 0x1431250)
        /home/wilken/Development/packer/post-processor/digitalocean-import/post-processor.go:262 +0x36d
github.com/hashicorp/packer/post-processor/digitalocean-import.TestPostProcsor_extractImageArtifact(0xc0003ab560)
        /home/wilken/Development/packer/post-processor/digitalocean-import/post-processor_test.go:28 +0x2b0
testing.tRunner(0xc0003ab560, 0x1077208)
        /usr/local/go/src/testing/testing.go:991 +0xdc
created by testing.(*T).Run
        /usr/local/go/src/testing/testing.go:1042 +0x357
FAIL    github.com/hashicorp/packer/post-processor/digitalocean-import  0.009s
FAIL
```

Tests after change
```
[go-1.14.2] [1] wilken@automaton in ~/Development/packer/ on fix_9848 (ahead 1)
⇶  go test ./post-processor/digitalocean-import/... -run=TestPostProcsor_extractImageArtifact
ok      github.com/hashicorp/packer/post-processor/digitalocean-import  0.006s
```

* Update to reflect review feedback
2020-09-01 10:59:01 -04:00
Adrien Delorme bdf198594e hcl2 inspect: sort variables to have a consistent output 2020-09-01 15:28:16 +02:00
Adrien Delorme a25f057984 add tests for unknown values 2020-09-01 15:28:16 +02:00
Adrien Delorme 161879b98a test unknown variables and locals 2020-09-01 11:59:07 +02:00
Adrien Delorme 652878059c inspect command: ignore init errors as some value can be unset 2020-09-01 11:59:07 +02:00
Adrien Delorme eb4069a1b7 hcl variables: return an unknown value in when no default is set 2020-09-01 11:59:07 +02:00
Adrien Delorme 91c5a4613c HCL2 inspect remove debug values 2020-09-01 11:59:07 +02:00
Sylvia Moss 9eaa2e17f7
add netlify node option to increase old space size (#9859) 2020-09-01 11:24:30 +02:00
Sylvia Moss 24dbd0a28b
Fix iso_path validation regex (#9855) 2020-09-01 10:11:48 +02:00
Rémy Léone 05aecc56ea Fix 2020-09-01 09:14:07 +02:00
Wilken Rivera f4556fd3f1
Merge pull request #9831 from hashicorp/remedial_remote_export_config_tests
add tests to make sure prepare for export defaults properly
2020-08-31 15:47:05 -04:00
js-g f74a425661 feat (builder/oracle-oci): pass CreateVnicDetails to instance 2020-08-31 13:13:33 -04:00
Sylvia Moss 58a0bdd780
Look for a default resource pool when root resource pool is not found (#9809) 2020-08-31 16:26:48 +02:00
Wilken Rivera 03a374f4b6
Fix linting issues for SA6005 check (#9854)
Before change
```
⇶  golangci-lint run --disable-all --no-config --enable=staticcheck | ack SA6005
builder/profitbricks/step_create_server.go:254:22: SA6005: should use strings.EqualFold(a, b) instead of strings.ToLower(a) == strings.ToLower(b) (staticcheck)
builder/oneandone/config.go:97:7: SA6005: should use strings.EqualFold(a, b) instead of strings.ToLower(a) == strings.ToLower(b) (staticcheck)
builder/vmware/common/driver_parser.go:1199:7: SA6005: should use strings.EqualFold(a, b) instead of strings.ToLower(a) == strings.ToLower(b) (staticcheck)
```

After change
```
⇶  golangci-lint run --disable-all --no-config --enable=staticcheck | ack SA6005

```
2020-08-31 15:44:42 +02:00
GennadySpb 804fefef17
yandex-import: allow set custom API endpoint (#9850)
* Separate Access Config from yandex builder Config

* make use of Access Config explicit

* Move `MaxRetries` into AccessConfig

* NewDriverYC use AccessConfig instead Config

* yandex-import PP use common Access Config

Now support set custom API Endpoint

* yandex-export PP use common Access Config

Now support set custom API Endpoint too (as yandex-import)

* fix test

* Tiny doc updates.
2020-08-31 15:29:20 +02:00
Rémy Léone f578b93f7e
update scaleway code owners (#9852) 2020-08-31 14:41:45 +02:00
GennadySpb 0df2e15d9f
If proposed exit code not equal 0 set proper metadata key to expected 'cloud-init-error'. (#9849)
Last one checked at `StepWaitCloudInitScript`.
2020-08-31 14:38:22 +02:00
OblateSpheroid 0ad26cce01
Feat (oracle-oci): allow freeform and defined tags to be added instance (#9802)
* feat (oracle-oci): allow freeform and defined tags to be added to instance (#6313)

* docs (oracle-oci): add descriptions for instance_tags and instance_defined_tags (#6313)

* fix: fmt

* fix: generate hcl2spec
2020-08-31 14:36:09 +02:00
Rui Lopes 281af9a03d
prefer $APPDATA over $HOME in Windows (#9830) 2020-08-31 14:35:15 +02:00
Rémy Léone ecd1a49a35 change default scaleway boottype to local 2020-08-31 13:15:37 +02:00
Andreas Botzner e4f975fae1
Allows for the mounting of ISOs when a Proxmox VM s created. Same as … (#9653)
Allows the mounting of additional ISOs when the VM is created. The config option was taken from PR #9055 and slightly changed. Users can specify an array of bus names, bus numbers and filenames.

"cd_drive":[
{
"bus": "ide",
"bus_number": 3,
"filename": "isos:iso/virtio-win-0.1.187.iso"
},
{
"bus": "sata",
"bus_number": 3,
"filename": "isos:iso/someother.iso"
}
]

Closes: #7950
Co-authored-by: Calle Pettersson <carlpett@users.noreply.github.com>
2020-08-31 10:48:24 +02:00
Sylvia Moss 942bfbf221
Add driver mocks and write tests to steps Remote Upload and Create VM (#9833) 2020-08-31 10:34:41 +02:00
packer-ci cf622346ab Putting source back into Dev Mode 2020-08-28 18:23:03 +00:00
packer-ci e3ac7de965
Cut version 1.6.2 2020-08-28 15:06:28 +00:00
packer-ci 576e227e60 cut version 1.6.2 2020-08-28 15:06:26 +00:00
packer-ci 4565119694 update changelog 2020-08-28 15:06:26 +00:00
Wilken Rivera bd0cb85bb6 Reset change entries made by the packer-ci release bot
This reverts commit c35837ee49.
2020-08-28 10:55:55 -04:00
packer-ci a56acabe23
Cut version 1.6.2 2020-08-27 20:58:08 +00:00
packer-ci 10f34a3b12 cut version 1.6.2 2020-08-27 20:58:07 +00:00
packer-ci c35837ee49 update changelog 2020-08-27 20:58:07 +00:00
Jason Azze 9156563314
Update HardwareConfig-not-required.mdx
I've tested the behavior of CPUs and cpu_cores against both vSphere 5.5 and 6.7. In both cases, CPUs gives you virtual cores, not sockets.
For example, I want 6 cores per socket across 2 sockets for 12 total cores. Based on the wording of this doc, I set CPUs to 2 and cpu_cores to 6. The documentation implies that will give me 2 sockets with 6 cores each. The actual behavior is you get 2 cores, and when you crack open the VMs configuration, you see that cores per socket is set to 6 -- which is meaningless.

Setting CPUs to 12 and cpu_cores to 6 gives me what I wanted. So the wording I propose is 
```
- `CPUs` (int32) - Number of CPU cores.
```
2020-08-27 15:10:33 -04:00
Wilken Rivera c4b039391a update changelog 2020-08-27 14:36:22 -04:00
Megan Marsh 1c5bc41beb refactor ovftool validation into vmware driver 2020-08-27 10:55:57 -07:00
Megan Marsh bbc3a5b0d1 add tests to make sure prepare for export defaults properly 2020-08-27 10:55:57 -07:00
Wilken Rivera 67cd123d1c
Merge pull request #9834 from hashicorp/azr-fix-hcl2_upgrade_random_generate
hcl2_upgrade: fix a case where the generated type is wrong
2020-08-27 13:03:34 -04:00
Wilken Rivera e4a37c37b9
Merge pull request #9835 from hashicorp/b-hcl2_upgrade_command-description
command/hcl2_upgrade: Update description text for command
2020-08-27 13:03:04 -04:00
Wilken Rivera 0e2a3e1058 command/hcl2_upgrade: Update description text for command
Before change
```
Usage: packer [--version] [--help] <command> [<args>]

Available commands are:
    build           build image(s) from template
    console         creates a console for testing variable interpolation
    fix             fixes templates from old versions of packer
    hcl2_upgrade    build image(s) from template
    inspect         see components of a template
    validate        check that a template is valid
    version         Prints the Packer version
```

After change
```
Usage: packer [--version] [--help] <command> [<args>]

Available commands are:
    build           build image(s) from template
    console         creates a console for testing variable interpolation
    fix             fixes templates from old versions of packer
    hcl2_upgrade    transform a JSON template into a HCL2 configuration
    inspect         see components of a template
    validate        check that a template is valid
    version         Prints the Packer version

```
2020-08-27 11:52:09 -04:00
Adrien Delorme 0f00709fb6 hcl2_upgrade: fix a case where the generated type is wrong
when it encounters map[string]interface{} or []interface{} types,  hcl2_upgrade now takes the 'most complex' entry from those in order to tell wether this is going to be a body `body {}` or an attribute `attribute = {}`. Before that the hcl2_upgrade command could be a bit random there.

A way better ( but may be somewhat hard ) way to do this would be to use the actual plugins structs in order to generate the HCL2.
2020-08-27 16:47:14 +02:00
Wilken Rivera 279e44e51d upate changelog 2020-08-26 15:56:11 -04:00
Wilken Rivera fe94fae2b2
Merge pull request #9829 from hashicorp/fix_9789
add variable gotcha to the variables docs not just the from-json hcl …
2020-08-26 14:07:36 -04:00
Megan Marsh cf1a39a4e8 add variable gotcha to the variables docs not just the from-json hcl guides. 2020-08-26 10:54:39 -07:00
Megan Marsh df4ce6fd34
Merge pull request #9821 from homedepot/ansible_ssh_extra_args
Ansible ssh extra args
2020-08-26 10:44:51 -07:00
Megan Marsh 60d124dcaf
Merge pull request #9825 from hashicorp/do_7165
Allow "export" to ovf/ova for local vmware builds in addition to esx …
2020-08-26 10:43:49 -07:00
Megan Marsh b6e277fb05
Merge pull request #9828 from hashicorp/d-salt-masterless-HCL2-examples
provisioner/salt-masterless: Add HCL2 example to docs
2020-08-26 10:43:22 -07:00
Wilken Rivera 7e81e3fbda provisioner/salt-masterless: Add HCL2 example to docs 2020-08-26 13:17:59 -04:00
Megan Marsh a6d5106cd7 Allow "export" to ovf/ova for local vmware builds in addition to esx ones.
Refactor step_export and the driver interface to move the ovftool call
into the vmware driver. This refactor allows us to add meaningful tests
to step_export, which I have also added here.
2020-08-26 09:45:12 -07:00