Commit Graph

4927 Commits

Author SHA1 Message Date
Megan Marsh dfb45e86cc remove unused file, set up prepare() properly to work with HCL2 in vsphere-clone builder 2020-01-13 12:33:56 -08:00
Megan Marsh 9459e2233b fix config loading to work with HCL2 2020-01-13 11:51:36 -08:00
Megan Marsh f84634aff3 small log line improvements 2020-01-13 11:43:53 -08:00
Moss 6a2d73a0e9 Add missing doc variable description 2020-01-08 15:28:53 -08:00
Megan Marsh e87aa237dd Get plugin up to parity with v1.5.0. Remove custom jetbrains-internal testing logic; disable acceptance tests (for now) until we can set up a test rig inside of HashiCorp. Regenerate code based on vendoring changes. 2020-01-08 14:41:51 -08:00
Megan Marsh 073eda76aa remove extraneous files from when vsphere builder was a plugin, and move README into packer website as separated docs for vsphere-clone and vsphere-iso. Move option descriptions into struct code, and generate documentation directly from those structs as we do inside of the other builders 2020-01-07 16:59:31 -08:00
Megan Marsh 8cb1f7b1c1 Merge branch 'master' into merge-vsphere-builder 2020-01-07 14:23:38 -08:00
Megan Marsh eeac289fa5
Merge pull request #8535 from alexyueer/master
fix issue #8534
2020-01-07 12:47:23 -08:00
Megan Marsh 21edd085c7
Merge pull request #8560 from alexyueer/feature/support_aliyun_profile_20200103
support aliyun profile
2020-01-07 12:45:54 -08:00
Megan Marsh e9bb81a440
Merge pull request #8578 from hashicorp/unstick_vmware_shutdown_tests
bump the timeout to a very high level to protect against laggy CI mac…
2020-01-07 12:44:48 -08:00
Megan Marsh 7d789a1483
Merge pull request #8579 from hashicorp/do_8562
step_download: return without error if Urls is empty
2020-01-07 12:01:24 -08:00
Megan Marsh c446bf07c5
Merge pull request #8574 from hashicorp/fix_8541
Fix 8541
2020-01-07 12:00:27 -08:00
Megan Marsh 90bdcf58bd update step_download to return an ActionContinue if the URls field is empty. this allows us to simplify the hyperv builder, and is still safe because all other builders and uses of step_download already validate that the iso url is not empty if that's what they need, most of them inside of the IsoConfig prepare function. 2020-01-07 10:45:24 -08:00
Megan Marsh be3c1ef106 bump the timeout to a very high level to protect against laggy CI machines 2020-01-07 09:59:25 -08:00
Megan Marsh af2c4346f8
Merge pull request #8561 from ata18/ata18-end-of-life
Set expiry for image versions in SIG
2020-01-07 09:53:14 -08:00
Adrien Delorme 7b5a868de2 virtualbox/vm.Builder: use config as a non pointer to avoid a panic
this is a continuation to #8513
2020-01-07 16:55:50 +01:00
Adrien Delorme 13ea97a1df mapstructure-to-hcl2: make basic named types pointers ( optional ) 2020-01-07 12:46:27 +01:00
Adrien Delorme 731904d3d2 mapstructure-to-hcl2: use accessor for named types and not named type + go genrate + tests 2020-01-07 11:44:22 +01:00
Megan Marsh be97507088 delete qmp socket path. Also, clean up unnecessary use of statebag to recieve step values. (#8572) 2020-01-07 11:18:01 +01:00
Aishwarya Thangappa 9f24869e36 Update the error handling for end-of-life-date parsing 2020-01-06 22:58:26 -08:00
Aishwarya Thangappa 9569d35d14 Set expiry for image versions in SIG
Updates azure builder to support setting end-of-life-date for
image versions in shared image gallery. In addition, this change adds
the ability to set the global replica count for the image version
and allows the vms deployed from the latest version of the Image
Definition to exclude this Image Version.
2020-01-06 22:58:26 -08:00
Megan Marsh b7ee807cf1
Merge pull request #8571 from hashicorp/fix_8565
fix ssh interface docs for amazon builders
2020-01-06 14:34:40 -08:00
Megan Marsh 6655f93b59 fix typo and regenerate code 2020-01-06 14:12:29 -08:00
Megan Marsh 7411a8a6ef
Merge pull request #8550 from tpounds/add-ami-owner-to-template
Add source AMI owner ID/name to build template
2020-01-06 13:38:49 -08:00
Megan Marsh 76251e5fd2 fix ssh interface docs for amazon builders 2020-01-06 12:01:30 -08:00
Lars Lehtonen 8098ba9cdf builder/virtualbox/common: remove unused url variable (#8559) 2020-01-06 16:45:05 +01:00
alexyueer ec4a7b6af0 support aliyun profile 2020-01-03 12:17:34 +08:00
Trevor Pounds 47e48ebc24 Add source AMI owner ID/name to build template. 2019-12-30 14:04:49 -05:00
wujin 2e2f197bc3 add SecurityGroupId when DescribeSecurityGroups if user specify SecurityGroupId 2019-12-24 09:47:52 +08:00
Megan Marsh 348e00422e
Merge pull request #8509 from hashicorp/fix_step_import_panic
Remove config dependency from inside StepImport
2019-12-20 09:19:30 -08:00
Moss 7912e496aa Remove config dependency inside StepImport 2019-12-20 11:58:28 +01:00
Megan Marsh 127905e855 remove time flaky time limited tests (#8522)
* remove flaky test. It isn't very useful anyway given that we're slowly adding retries to the checks for lockfiles

* remove time-component from retry test; in underpowered CI builds, this can flake fairly often.
2019-12-20 08:16:18 +01:00
zhuzhih2017 66445ecd2d
Merge pull request #8425 from haoshuwei/master
add show expired arg when describe image
2019-12-20 13:33:55 +08:00
haoshuwei 37dc411f30 add skip_image_validation arg to use an expired image as the soure image
Signed-off-by: haoshuwei <haoshuwei24@gmail.com>
2019-12-20 11:28:31 +08:00
Wilken Rivera f45d315be4
Merge pull request #8518 from hashicorp/update_jdcloud_config_pointer
update jdcloud statebag to use pointers for config, to bring in line …
2019-12-19 15:45:40 -05:00
Megan Marsh f47d9f1b1f
Merge pull request #8514 from hashicorp/fix_5821
Configure NAT interface before forwarded port mapping
2019-12-19 11:30:33 -08:00
Megan Marsh 09489da149 update jdcloud statebag to use pointers for config, to bring in line with other implementations 2019-12-19 11:17:04 -08:00
Adrien Delorme f1e6f8eac1 removed unused config puts 2019-12-19 18:06:39 +01:00
Adrien Delorme a67948f155 fix config pointers 2019-12-19 17:51:57 +01:00
Moss 9216f43463 Configure NAT interface before forwarded port mapping 2019-12-19 17:03:31 +01:00
Moss 42cf9ef064 Remove pointer fixing panic on interface conversion 2019-12-19 13:30:54 +01:00
Wilken Rivera a72242cd70
Merge pull request #8498 from hashicorp/f-builder_docker-typeassertion-check
builder/docker: Fix interface conversion issue when getting config from state bag
2019-12-17 18:08:00 -05:00
Megan Marsh dca2c03cdb
Merge pull request #7866 from hashicorp/sharing_info
Add new struct to Provision() method signature, allowing us to share connection and credential info generated at build time with provisioners.
2019-12-17 14:55:20 -08:00
nywilken 9403d55549 builder/docker: Add type assertion check when reading config from state bag 2019-12-17 17:48:35 -05:00
nywilken 0ba6b22fee builder/docker: Update type of config stored in state bag 2019-12-17 17:48:35 -05:00
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 4b7132c87c Merge remote-tracking branch 'origin/master' into sharing_info 2019-12-17 11:57:09 +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
Megan Marsh 0f6d1beccf add an extra string array to the Prepare() return values in the builder interfaces; this sets up the ability for builders to give the provisioners custom user-accessible build-time variables. 2019-12-16 21:23:05 -08:00
Sylvia Moss c57f093efe
Remove unnecessary source_path validation for virtualbox-ovf (#8489) 2019-12-16 16:50:21 +01:00