13761 Commits

Author SHA1 Message Date
nywilken
1eb55c2ae3 builder/azure: Remove double override of GalleryImageVersionsClient.PollDuration
This change fixes an issues where custom timeouts set for the
GalleryImagesVersionClient was being over written by the default client
poll duration.
2019-12-17 10:47:32 -05:00
Adrien Delorme
ee2d74ce9e
hcl2template/common_test.go: make testParse a helper (#8495)
so that when an error happens we see the real calling function
2019-12-17 16:46:36 +01:00
Adrien Delorme
bc49234930 remove old untrue comment 2019-12-17 16:45:20 +01:00
Adrien Delorme
65cc5fe823
fix missing typo correction (#8494)
I left this change on my local branch
2019-12-17 11:31:57 +01:00
Adrien Delorme
0785c2f6fc
build using HCL2 (#8423)
This follows #8232 which added the code to generate the code required to parse
HCL files for each packer component.

All old config files of packer will keep on working the same. Packer takes one
argument. When a directory is passed, all files in the folder with a name
ending with  “.pkr.hcl” or “.pkr.json” will be parsed using the HCL2 format.
When a file ending with “.pkr.hcl” or “.pkr.json” is passed it will be parsed
using the HCL2 format. For every other case; the old packer style will be used.

## 1. the hcl2template pkg can create a packer.Build from a set of HCL (v2) files

I had to make the packer.coreBuild (which is our one and only packer.Build ) a public struct with public fields

## 2. Components interfaces get a new ConfigSpec Method to read a file from an HCL file.

  This is a breaking change for packer plugins.

a packer component can be a: builder/provisioner/post-processor

each component interface now gets a `ConfigSpec() hcldec.ObjectSpec`
which allows packer to tell what is the layout of the hcl2 config meant
to configure that specific component.

This ObjectSpec is sent through the wire (RPC) and a cty.Value is now
sent through the already existing configuration entrypoints:

 Provisioner.Prepare(raws ...interface{}) error
 Builder.Prepare(raws ...interface{}) ([]string, error)
 PostProcessor.Configure(raws ...interface{}) error

close #1768


Example hcl files:

```hcl
// file amazon-ebs-kms-key/run.pkr.hcl
build {
    sources = [
        "source.amazon-ebs.first",
    ]

    provisioner "shell" {
        inline = [
            "sleep 5"
        ]
    }

    post-processor "shell-local" {
        inline = [
            "sleep 5"
        ]
    }
}

// amazon-ebs-kms-key/source.pkr.hcl

source "amazon-ebs" "first" {

    ami_name = "hcl2-test"
    region = "us-east-1"
    instance_type = "t2.micro"

    kms_key_id = "c729958f-c6ba-44cd-ab39-35ab68ce0a6c"
    encrypt_boot = true
    source_ami_filter {
        filters {
          virtualization-type = "hvm"
          name =  "amzn-ami-hvm-????.??.?.????????-x86_64-gp2"
          root-device-type = "ebs"
        }
        most_recent = true
        owners = ["amazon"]
    }
    launch_block_device_mappings {
        device_name = "/dev/xvda"
        volume_size = 20
        volume_type = "gp2"
        delete_on_termination = "true"
    }
    launch_block_device_mappings {
        device_name = "/dev/xvdf"
        volume_size = 500
        volume_type = "gp2"
        delete_on_termination = true
        encrypted = true
    }

    ami_regions = ["eu-central-1"]
    run_tags {
        Name = "packer-solr-something"
        stack-name = "DevOps Tools"
    }
    
    communicator = "ssh"
    ssh_pty = true
    ssh_username = "ec2-user"
    associate_public_ip_address = true
}
```
2019-12-17 11:25:56 +01:00
Sylvia Moss
c57f093efe
Remove unnecessary source_path validation for virtualbox-ovf (#8489) 2019-12-16 16:50:21 +01:00
Sylvia Moss
0a8b172bf9 Remove duplicated retry mechanism when deleting VM ffrom virtual box (#8485)
This retry was also added to fix a locked by session error reported in #5501 and fixed in #5512.
2019-12-16 14:31:15 +01:00
Kris Hicks
40357e2534 docs/builder/azure-arm: Remove errant html comment (#8484)
* Remove errant html comment from source

* make generate
2019-12-13 10:35:24 -05:00
Sylvia Moss
2ee3311082
Retry command execution when VM session is locked (#8483) 2019-12-13 10:47:19 +01:00
nywilken
1933e7acbe Update CHANGELOG.md 2019-12-12 13:20:11 -05:00
Megan Marsh
fbd1958ca5
Merge pull request #8462 from mkaczanowski/master
update documentation for arm images builder
2019-12-12 09:21:54 -08:00
Sylvia Moss
c6b9efb522 Fix virtualbox-iso TestBuilderAcc_basic (#8481)
make sure the test works for later usage
2019-12-12 10:43:51 +01:00
Mateusz Kaczanowski
f1765dfd79
Update _community_builders.html.md 2019-12-11 15:25:23 +01:00
Megan Marsh
822aa02500
Merge pull request #8468 from pfuender/master
Add version selection for chef-client provisioner
2019-12-10 12:29:32 -08:00
Mateusz Kaczanowski
a645b1d48e
Update _community_builders.html.md 2019-12-10 20:41:00 +01:00
Wilken Rivera
01e0ab5c0b
Merge pull request #8474 from alrs/prune-dead-do-test-code
post-processor/digitalocean-import: drop unused test functions
2019-12-10 11:33:45 -08:00
Megan Marsh
2b4a6f0479
Merge pull request #8442 from borgstrom/patch-1
iam:GetInstanceProfile is now required
2019-12-10 10:56:39 -08:00
Megan Marsh
2118fe72b0
Merge pull request #8471 from hashicorp/cleanup_logs
Cleanup logs
2019-12-10 10:55:55 -08:00
Megan Marsh
8073a5381c
Merge pull request #8475 from hashicorp/fix_8472
Return exit code 1 when builder type is not found
2019-12-10 10:42:33 -08:00
Moss
a0329ef196 Simplify testing template 2019-12-10 18:59:56 +01:00
Moss
7466c4fdca Return exit code 1 when builder type is not found 2019-12-10 18:55:18 +01:00
Lars Lehtonen
20d375f705
post-processor/digitalocean-import: drop unused test functions 2019-12-10 06:59:24 -08:00
Oded Priva
5e81c6f44e added the option to skip IAM instance profile validation (#8457) 2019-12-10 09:17:38 +01:00
Wilken Rivera
a828a6a4e0
Merge pull request #8469 from hashicorp/td-prepare_changlog-linux-updates
prepare_changelog: Update regex to work with GNU grep
2019-12-09 12:46:00 -08:00
Megan Marsh
2447c9b280 typo 2019-12-09 12:30:14 -08:00
Megan Marsh
8b50f03056 Only log min and max port when connecting via TCP; move port determination inside of the TCP function 2019-12-09 12:21:45 -08:00
Megan Marsh
a02a95e992 Move port logging to inside of appropriate functions; log the actual plugin being called if it is part of the main packer binary, rather than the meaningless information 'packer'. 2019-12-09 12:17:23 -08:00
Megan Marsh
a14498ff00 remove timestamps from logger inside of subprocesses to prevent double logging; also remove some cruft and fix spelling in some logs 2019-12-09 12:13:18 -08:00
Megan Marsh
5d5189a9a2 only log when external plugin is used, since this is the much rarer event 2019-12-09 12:10:07 -08:00
nywilken
89ad8ae4fa prepare_changelog: Update regex to work with GNU grep 2019-12-09 15:05:39 -05:00
pfuender
ffb9272fb2 adding version-override for chef-client provisioner 2019-12-09 20:58:04 +01:00
Wilken Rivera
b79986c3c5
Merge pull request #8411 from kevingunn-wk/fix_8410
rename galaxy_command to galaxycommand
2019-12-09 11:16:20 -08:00
Lars Lehtonen
d7eee558a6 post-processor/docker-import: drop unused test functions (#8465) 2019-12-09 16:05:03 +01:00
Kaczanowski Mateusz
9d3c718c2e update documentation for arm images builder 2019-12-07 10:44:32 +01:00
Sylvia Moss
096cab9b48 Fix floppy doc markdown typo (#8458) 2019-12-06 14:12:11 +01:00
Sylvia Moss
2f63c581a0
Remove unnecessary 1 sec sleep (#8453) 2019-12-06 11:43:28 +01:00
Lars Lehtonen
4fe34a5dc3 post-processor/docker-push: drop unused test helper functions (#8456) 2019-12-06 11:07:51 +01:00
Sylvia Moss
5ff5623433
Add disable_shutdown option to VirtualBox builder (#8449) 2019-12-05 14:34:56 +01:00
Lars Lehtonen
8146b39986 post-processor/docker-save: remove unused test functions (#8447) 2019-12-05 11:28:38 +01:00
deisenzimmer
2b3935778e amazon-ebssurrogate plugin: StepSnapshotVolumes: Added mutex to synchronise map access across threads. (#8432) 2019-12-04 15:13:07 +01:00
Megan Marsh
de9f391a1c
Merge pull request #8430 from hashicorp/fix_8359
Fix request retry mechanism  to launch aws instance
2019-12-03 16:03:03 -08:00
Megan Marsh
05b972e550
Merge pull request #8444 from ad-m/hyperone-builder
Fix tags & modernize config for HyperOne builder
2019-12-03 10:30:26 -08:00
Megan Marsh
9fc37f9456
Merge pull request #8438 from hashicorp/fix_qemu_sizes
make sure we continue to default to Megabytes for qemu disk size to p…
2019-12-03 09:58:21 -08:00
Adam Dobrawy
e1160cc955 test: Generalize README to avoid AWS 2019-12-03 14:57:41 +01:00
Adam Dobrawy
a97ff7ce8b builder/hyperone: Update schema for cli config 2019-12-03 14:57:41 +01:00
Adam Dobrawy
3b091e6046 builder/hyperone: fix & add tests for tags 2019-12-03 14:57:40 +01:00
Megan Marsh
7d8f1c01c4 Revert "fix: persist default drive/device" (#8440)
This reverts commit 30ccab4 which introduced the issue 8436.
2019-12-03 13:42:11 +01:00
Megan Marsh
fcda07ee6a clarify docs by removing unclear string (#8439)
the docs generator from code PR #7724  mis scrapped it
2019-12-03 10:07:46 +01:00
Borgstrom ♕
5be5cc146b
iam:GetInstanceProfile is now required 2019-12-03 10:06:01 +08:00
Megan Marsh
0bea6022ec update changelog 2019-12-02 16:39:26 -08:00