Commit Graph

780 Commits

Author SHA1 Message Date
Pit d7d00d8069 Fix regression in docker-tag post-processor (#8593)
GH-8392 introduced the feature that multiple tags can be specified. This
(presumably inadvertently) broke the option to tag an image without the
actual tag specified -- Docker handles this by assuming `latest` as the
tag.

In addition, use-cases exist for the `repository` field containing the
tag already, which was also broken.
2020-01-13 11:41:52 +01:00
Hanjie Wang d9a128a375 In Vagrant post-processor, check whether the host system is able to create a dummy Vagrant box before processing (#8431) 2020-01-08 11:33:39 -08:00
Megan Marsh 49a33c04cd
Merge pull request #8511 from TJM/vsphere_template_markas
[post-processor/vsphere-template] Simplify method to use vm.MarkAsTemplate (optionally)
2020-01-08 09:41:43 -08:00
Tommy McNeely e469140678 workaround for mapstructure-to-hcl2 and booleans 2020-01-07 16:58:40 -07: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
Tommy McNeely 7f7b54ea31 Use vm.MarkAsTemplate, optionally reregister 2020-01-06 15:34:50 -07:00
Rui Lopes ec17b3d8fa correctly handle the diskSize property as a qemu size string 2020-01-05 15:44:01 +00:00
alexyueer ec4a7b6af0 support aliyun profile 2020-01-03 12:17:34 +08: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
Megan Marsh b23425f637 use pointer to config rather than config 2019-12-19 11:27:21 -08: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
Megan Marsh 39fd462b56 change all provision func signatures to use map[string]interface{} 2019-12-12 15:38:32 -08:00
Lars Lehtonen 20d375f705
post-processor/digitalocean-import: drop unused test functions 2019-12-10 06:59:24 -08:00
Lars Lehtonen d7eee558a6 post-processor/docker-import: drop unused test functions (#8465) 2019-12-09 16:05:03 +01:00
Lars Lehtonen 4fe34a5dc3 post-processor/docker-push: drop unused test helper functions (#8456) 2019-12-06 11:07:51 +01:00
Lars Lehtonen 8146b39986 post-processor/docker-save: remove unused test functions (#8447) 2019-12-05 11:28:38 +01:00
Adrien Delorme b4200c3590 go generate for the google compute export post processor after #8388 2019-12-02 11:32:16 +01:00
Taneli Leppä e1cb0c5f7e Added support for specifying Service Account in Google Compute exporter post-processor. (#8388) 2019-12-02 11:29:34 +01:00
henry-aj-jones d317d7f3d1 post-processor/docker-tag: Allow to tag an artifact with multiple tags (#8392) 2019-11-22 11:48:36 +01:00
Lars Lehtonen 2e7ba19d8c post-processor/vagrant-cloud: fix dropped test errors 2019-11-15 11:44:33 +01:00
Megan Marsh fcb65ee422
Merge pull request #8307 from hashicorp/fix_8116
delete amazon import post-processor intermediary snapshots
2019-11-01 14:55:22 -07:00
Megan Marsh e9e4c102e5 delete amazon import post-processor intermediary snapshots 2019-11-01 14:17:44 -07:00
Adrien Delorme 819329228a Change back to make sure all durations are a time.Duration
It is simply the best/simplest solution and trying to prevent users from passing and integer here would be like opening a can of worms. Because:

* we cannot make mapstructure validate our duration string ( with an UnmarshalJSON func etc.)
* we cannot make mapstructure spit a string instead of a duration and packer will decode-encode-decode config.
* the hcl2 generated code asks for a string, so this will be enforced by default.
2019-10-31 16:12:07 +01:00
Adrien Delorme bf3d9841c6 Force durations to be passed a strings
Before this commit it was possible to set a duration using an integer or a float. Go's time.Duration is an int64 internally an mapstructure will take advantage of this and load the number as a int64 but `1` means one ns which is unexpected/confusing. To avoid confusion and enforce readability this forces users to pass a string with a unit for a duration; ex "56s".
2019-10-31 11:47:19 +01:00
mingsheng.su 4f140d0071 fix docs of ucloud-uhost 2019-10-30 15:05:54 +08:00
mingsheng.su 545575b879 optimize code about ufile config 2019-10-29 16:11:44 -07:00
mingsheng.su 37e898e115 optimize code style 2019-10-29 16:11:44 -07:00
mingsheng.su 1099777978 update bucket about no create 2019-10-29 16:11:43 -07:00
mingsheng.su 083d7896f4 update message of ucloud import 2019-10-29 16:11:43 -07:00
mingsheng.su 2c513fce64 update ucloud packer 2019-10-29 16:11:43 -07:00
mingsheng.su 61f9d3a9fe add ucloud import 2019-10-29 16:11:43 -07:00
Lars Lehtonen 5edabfc849 post-processor/compress: fix dropped errors 2019-10-28 16:19:46 -07:00
Adrien Delorme 078ba7c8c3 commit old code generation tool
for history
2019-10-15 12:56:42 +02:00
Adrien Delorme 771a6e55ef pp.google.[import|export]: unexport Account field
so it doesnt temper with hcl2 cfg generation
2019-10-15 12:56:42 +02:00
Adrien Delorme af08e2a410 pp.alicloud-import: remove duplicate AlicloudImageName field
( already defined in packerecs.Config )
2019-10-15 12:56:42 +02:00
Andrew Starr-Bochicchio ae1bb856a3 digitalocean-import: Fix panic when 'image_regions' not set (Fixes: #7843). 2019-10-01 21:14:15 -04:00
Lars Lehtonen 21f2e67462
post-processor/vagrant-cloud: fix dropped errors 2019-09-26 09:23:09 -07:00
Megan Marsh 3c14c50aba Allow user to real oauth token from properly configured Vault instance 2019-09-23 13:26:03 -07:00
Megan Marsh 61b237b6f7
Merge pull request #8097 from onematchfox/vagrant-cloud
post-proc(vagrant-cloud) allow blank access_token (no auth) for private vagrant box hosting
2019-09-19 11:19:57 -07:00
Megan Marsh 9e28b2f5cf fix post-processor 2019-09-16 13:45:28 -07:00
Brian Fox 331babc2ce allow blank access_token (no auth) for private vagrant box hosting 2019-09-12 12:37:53 +02:00
Robbert Müller 9f972375ed
Removed whitelist check for builders
Fixes https://github.com/hashicorp/packer/issues/8060

Signed-off-by: Robbert Müller <spam.me@grols.ch>
2019-09-04 18:34:39 +02:00
DanHam ca9b500e76
Fix test output: Correct copy/paste errors and make message clearer 2019-08-22 09:48:32 +01:00
DanHam 7770ade74c
Clearer error message for artifice users. OCD nits and logging 2019-08-21 14:32:26 +01:00
DanHam e9ab2203ba
Should return provider correctly with artifacts from other builders or pp's 2019-08-21 14:32:25 +01:00
DanHam e8336039d9
Should return provider correctly with good box and artifice pp 2019-08-21 14:32:25 +01:00
DanHam aee400836f
Should return an error if the provider kv pair is not in the metadata file 2019-08-21 14:32:25 +01:00
DanHam a7603f63c7
Should return an error if the metadata file has badly formatted JSON 2019-08-21 14:32:25 +01:00
DanHam 57137c6e33
Should return an error if the value of the provider key is empty 2019-08-21 14:32:25 +01:00
DanHam d1327fe422
Should return an error if the metadata file is empty 2019-08-21 14:32:24 +01:00
DanHam a9e22a6bb2
Should return the provider by parsing the json in the box metadata file 2019-08-21 14:32:24 +01:00
DanHam 0bf0e7c078
Should return an error when the metadata file is not in the box tar archive
Split out box creation into new helper function
2019-08-21 14:32:24 +01:00
DanHam 063e4bd3e5
Should return an error if the box tar archive is empty 2019-08-21 14:32:24 +01:00
DanHam 9c6b355088
Should return an error if the box is a plain gzip file 2019-08-21 14:32:24 +01:00
DanHam 35d326de39
Add basic workings to function. Return an error if box file is empty 2019-08-21 14:32:23 +01:00
DanHam 6b5cf6dcb2
Should return an error when the box file is missing 2019-08-21 14:32:23 +01:00
DanHam e8c586175e
Intention: Allow use of artifice pp with vagrant-cloud pp
The Vagrant-Cloud and Vagrant provider (e.g. virtualbox, vmware_desktop
etc.) must be determined differently depending on the builder or
post-processor supplying the artifact.

Adds a wrapper function that:

* Uses the original method of determining the provider when the artifact
  is provided by either the Vagrant builder or Vagrant post-processor
* Uses a new (currently empty) function when the artifact is provided
  via the Artifice post-processor
2019-08-21 14:32:23 +01:00
DanHam 3f4f429c3d
Should return an error when artifact file does not have .box extension 2019-08-21 14:32:23 +01:00
DanHam 57308b0126
Should return an error with an invalid BuilderId 2019-08-21 14:32:23 +01:00
DanHam 1bffdd9bff
Add option to allow box Vagrantfile to be dynamically generated during build 2019-08-13 09:09:28 +01:00
DanHam 19f3a63ee1
Tests: Should not error when template is to be created during build 2019-08-13 09:09:28 +01:00
DanHam 4b042ac402
Tests: Should not error when `vagrantfile_template` exists 2019-08-13 09:09:27 +01:00
DanHam 8ddbb791a1
Fix typo 2019-08-05 17:25:21 +01:00
Megan Marsh a87ce366b3
Merge pull request #7835 from hashicorp/google_oauth
replace some bespoke google auth code with code from golang's oauth2 …
2019-07-08 09:48:27 -07:00
Megan Marsh 0dfb3cc56f replace some bespoke google auth code with code from golang's oauth2 library 2019-07-03 14:27:33 -07:00
Marc Falzon d82c4f0057 fixup! fixup! fixup! fixup! Add Exoscale Import post-processor 2019-07-03 09:28:42 +02:00
Marc Falzon 9ce5f5dcee fixup! fixup! fixup! Add Exoscale Import post-processor 2019-07-02 10:15:09 +02:00
Marc Falzon 00c2df24df Add Exoscale Import post-processor
This change adds a new `exoscale-import` post-processor allowing users
to create Private Templates on Exoscale.
2019-07-01 08:40:26 +02:00
chhaj5236 6b081cc41c
update alicloud builder to use official SDK (#7477) 2019-04-26 10:37:49 +08:00
Adrien Delorme aee73d745d update code after go mod update 2019-04-11 14:19:24 +02:00
Adrien Delorme d72040f4fa move retry code into the common/retry pkg and make retry context aware 2019-04-09 17:46:38 +02:00
Adrien Delorme f555e7a9f2 allow a provisioner to timeout
* I had to contextualise Communicator.Start and RemoteCmd.StartWithUi
NOTE: Communicator.Start starts a RemoteCmd but RemoteCmd.StartWithUi will run the cmd and wait for a return, so I renamed StartWithUi to RunWithUi so that the intent is clearer.
Ideally in the future RunWithUi will be named back to StartWithUi and the exit status or wait funcs of the command will allow to wait for a return. If you do so please read carrefully https://golang.org/pkg/os/exec/#Cmd.Stdout to avoid a deadlock
* cmd.ExitStatus to cmd.ExitStatus() is now blocking to avoid race conditions
* also had to simplify StartWithUi
2019-04-08 20:09:21 +02:00
Adrien Delorme a81abd297b Merge remote-tracking branch 'origin/master' into context_provisioner 2019-04-08 20:09:01 +02:00
Megan Marsh 9dafa310f3 remove redundant keep_input_artifact code from googlecompute-export and googlecompute-import pps. The behavior coded here was already enforced by the core postprocessor code in packer/build.go 2019-04-03 12:05:38 -07:00
Megan Marsh 1b77b05ce2 remove redundant keep_input_artifact from compress pp and clarify keep behavior in shell-local pp 2019-04-03 12:03:40 -07:00
Megan Marsh 056fcb7cea fix tests and add a few new ones 2019-04-03 11:32:49 -07:00
Adrien Delorme c4f3dccc14 rename interpolation context from ctx to ictx and contexts to ctx to avoid conflicts 2019-04-03 15:56:15 +02:00
Adrien Delorme e65115a7a0 contextualize post-processor 2019-04-03 15:55:55 +02:00
Megan Marsh 12fc1fa751 default_keep_input_artifact 2019-04-02 16:51:58 -07:00
Megan Marsh 2c67cd966b
Merge pull request #7396 from c0sco/amazon-import-encryption
Support S3 and AMI encryption in amazon-import post-processor
2019-03-25 17:24:49 -06:00
Megan Marsh 24c42e4a1f
Merge pull request #7397 from vhaidamaka/fix-7321
Add vagrant-cloud post-processor support for the vagrant builder
2019-03-15 16:00:05 -07:00
Adrien Delorme 9f82b75e57 Use the hashicorp/go-getter to download files
* removed packer.Cache and references since packer.Cache is never used except in the download step. The download step now uses the new func packer.CachePath(targetPath) for this, the behavior is the same.
* removed download code from packer that was reimplemented into the go-getter library: progress bar, http download restart, checksuming from file, skip already downloaded files, symlinking, make a download cancellable by context.
* on windows if packer is running without symlinking rights and we are getting a local file, the file will be copied instead to avoid errors.
* added unit tests for step_download that are now CI tested on windows, mac & linux.
* files are now downloaded under cache dir `sha1(filename + "?checksum=" + checksum) + file_extension`
* since the output dir is based on the source url and the checksum, when the checksum fails, the file is auto deleted.
* a download file is protected and locked by a file lock,
* updated docs
* updated go modules and vendors
2019-03-13 12:11:58 +01:00
Vadym Haidamaka 4855bc79c9 Add vagrant-cloud post-processor support for the vagrant builder 2019-03-12 05:33:46 +02:00
Matt Stofko ab4382360d Support S3 and AMI encryption 2019-03-11 13:21:47 -07:00
Megan Marsh 67fe820465
Merge pull request #7361 from hashicorp/fix_insecure_skip_tls_verify
fix proxy and tls
2019-03-07 09:21:06 -08:00
Davi Vidal b0e3128125 Improves test message 2019-03-05 14:39:50 +01:00
Davi Vidal 1a94ad14bd Adds test for insecure_skip_tls_verify 2019-03-05 14:37:37 +01:00
Davi Vidal a2fd287e56 Ignores SSL verification when on premise vagrant cloud 2019-03-05 10:57:11 +01:00
Megan Marsh 3ed9fe6dee remove unused imports
remove HttpClientWithEnvironmentProxy from amazon builders; let access config handle it
2019-03-04 16:42:33 -08:00
Arnaud Dezandee f9ae926d8f
googlecompute-export: set network project id to builder 2019-03-01 15:12:31 +01:00
Megan Marsh be21850e32
Merge pull request #7060 from andrewsomething/do-post-processor
Add digitalocean-import post-processor.
2019-02-14 11:58:00 -08:00
Andrew Starr-Bochicchio 37b3305301 Better varibable naming. 2019-02-13 18:55:27 -05:00
Andrew Starr-Bochicchio ee430d9a40 Only filter on suffix if more than one file. 2019-02-12 20:20:39 -05:00
Andrew Starr-Bochicchio 203b6ca8b4 Prefix env vars w/ 'DIGITALOCEAN_' 2019-02-11 18:20:35 -05:00
Megan Marsh 6cac03044f
Merge pull request #7248 from oceyral/oceyral/feat/add_user_data
Add "custom_data" key to packer manifest post-processor
2019-02-01 11:37:44 -08:00
Olivier Ceyral 4d10d668ee Add "custom_data" key to packer manifest 2019-02-01 10:41:34 +01:00
Megan Marsh eef4fc7a01
Merge pull request #7222 from Adezandee/gce-post-processors
googlecompute-postprocessors: service account and export configs
2019-01-31 16:58:42 -08:00
Megan Marsh 035c3506ba manually set proxyfromenvironment in default http client for ec2 sessions 2019-01-25 12:33:25 -08:00
Megan Marsh c63b54a1e7 move http with proxy call into a helper function 2019-01-25 12:32:52 -08:00
Arnaud Dezandee 8975f67901
googlecompute-export: add exporter instance configs 2019-01-25 11:36:18 +01:00
Arnaud Dezandee 91d2cb8c83
googlecompute-import: add service accounts 2019-01-25 11:36:18 +01:00
Arnaud Dezandee 3d41cdfacb
googlecompute-import: add guest os features 2019-01-22 18:42:38 +01:00
Rickard von Essen a02bd23f56
When import task fails show the StatusMessage
This will hopefully tell the user the reason of the failure.
2019-01-17 13:36:44 +01:00
Adrien Delorme 9f7b4ffc17
Merge branch 'master' into pr/6950 2019-01-09 10:11:18 +01:00
Ladar Levison 3cc83167c8 Added map structure type to config changes. 2018-12-18 00:48:58 -06:00
Ladar Levison 6ac5971288 Fixed cmd order for docker driver. Added config to post proc. 2018-12-17 22:59:41 -06:00
Adrien Delorme b7222d1f56 Add tmp package that offers Dir & File funcs
this regroups the calls of tmp func calls into one package.
the tmp pkg allows to store tmp files under a common directory for easier managment

Squashed commit of the following:
commit 74b674c01560c6b547e9cab5e8afb486f0fe7d6c
Merge: fc94b5714 66001525d
Author: Matthew Patton <mpatton@enquizit.com>
Date:   Fri Nov 2 02:02:38 2018 -0400

    Merge branch 'remove_TMPDIR_docs' of github.com:tb3088/packer into remove_TMPDIR_docs

commit fc94b571428447aaf2e5171967c95cdf9e5c73ff
Author: Matthew Patton <mpatton@enquizit.com>
Date:   Fri Nov 2 01:42:38 2018 -0400

    update tests to honor configured temporary directory

commit 5a562359f4937af506607dd96ed1c46426093f52
Author: Matthew Patton <mpatton@enquizit.com>
Date:   Thu Nov 1 18:52:38 2018 -0400

    sync straggler to refactor. implement tests at packer/configfile instead of buried in docker.

commit 9d5a4a0935bfd049e2f8f50ad73e4455b42c9410
Author: Matthew Patton <mpatton@enquizit.com>
Date:   Thu Nov 1 15:39:46 2018 -0400

    insert URL to GoLang API for os.TempDir()

commit fbae4c2e051898aecd8705e9d8a20353430ede23
Author: Matthew Patton <mpatton@enquizit.com>
Date:   Thu Nov 1 07:41:29 2018 -0400

    revise documentation to match code

commit 3590fae8bd0afa92a161a49ed794ee32e357d583
Author: Matthew Patton <mpatton@enquizit.com>
Date:   Thu Nov 1 07:21:59 2018 -0400

    refacter config_file. replace all hard-coded os.TempDir with wrapper

commit d5c5306a97b648ded06a8eb76ce728f07c9924f0
Author: Matthew Patton <mpatton@enquizit.com>
Date:   Wed Oct 31 20:11:36 2018 -0400

    close massive file overwrite hole with TempDir

commit 0a72297da86089fbd07e4f7d9472a92fa4d1c733
Author: Matthew Patton <mpatton@enquizit.com>
Date:   Wed Oct 31 01:06:00 2018 -0400

    adjust var declaration scope

commit 20f68228b6c372d984ea5b055cfc8bda9b110ac5
Author: Matthew Patton <mpatton@enquizit.com>
Date:   Wed Oct 31 00:54:35 2018 -0400

    use mktemp() equivalent to create temporary directory

commit c73ebe3d8321664a2685a0baa8e441dd895b0db4
Author: Matthew Patton <mpatton@enquizit.com>
Date:   Tue Oct 30 20:40:58 2018 -0400

    remove extraneous variable declaration, fix FOR loop

commit 63549b8bd745a0090b15ed0b0ebf644162db27db
Author: Matthew Patton <mpatton@enquizit.com>
Date:   Tue Oct 30 19:30:44 2018 -0400

    match styistic convension with rest of docs

commit 976101074942db36f10d3a686d6d29ddb7c01926
Author: Matthew Patton <mpatton@enquizit.com>
Date:   Tue Oct 30 19:08:39 2018 -0400

    revert dangling config file change

commit 95159afbc05eac96ed11c3183af5fb0abe2f2d5c
Author: Matthew Patton <matthew.patton@itgfirm.com>
Date:   Fri Dec 29 23:53:43 2017 -0500

    replace invalid TMPDIR variable wth PACKER_TMP_DIR.
    update ConfigTmpDir() to try common temporary paths first and
    only write to configDir() as a last resort.

commit 66001525d72de56a4cf9339b900c46f59bc6e91a
Author: Matthew Patton <mpatton@enquizit.com>
Date:   Fri Nov 2 01:42:38 2018 -0400

    update tests to honor configured temporary directory

commit e9b6adefeae8c65eb8aa47fef38cbf0aa424338c
Author: Matthew Patton <mpatton@enquizit.com>
Date:   Thu Nov 1 18:52:38 2018 -0400

    sync straggler to refactor. implement tests at packer/configfile instead of buried in docker.

commit 852113ed076e2d14e5dca6815ea680da1e2896bb
Author: Matthew Patton <mpatton@enquizit.com>
Date:   Thu Nov 1 15:39:46 2018 -0400

    insert URL to GoLang API for os.TempDir()

commit 54add38d1d1c6e283cd444b367ed8bd49a5f3699
Author: Matthew Patton <mpatton@enquizit.com>
Date:   Thu Nov 1 07:41:29 2018 -0400

    revise documentation to match code

commit 6b5b8f6d4edad0e187ca13d64ac4118f34eee643
Author: Matthew Patton <mpatton@enquizit.com>
Date:   Thu Nov 1 07:21:59 2018 -0400

    refacter config_file. replace all hard-coded os.TempDir with wrapper

commit c22092c601c33484327674f322c7379fa41506d7
Author: Matthew Patton <mpatton@enquizit.com>
Date:   Wed Oct 31 20:11:36 2018 -0400

    close massive file overwrite hole with TempDir

commit 7a730450916bf8e5dbc2a741ec233a49466ab7cc
Author: Matthew Patton <mpatton@enquizit.com>
Date:   Wed Oct 31 01:06:00 2018 -0400

    adjust var declaration scope

commit 0f2933adb6f6922dfeab78a95371a444ec8918ab
Author: Matthew Patton <mpatton@enquizit.com>
Date:   Wed Oct 31 00:54:35 2018 -0400

    use mktemp() equivalent to create temporary directory

commit d74839ede05dacf712b55a7bb48aec19fe6b007f
Author: Matthew Patton <mpatton@enquizit.com>
Date:   Tue Oct 30 20:40:58 2018 -0400

    remove extraneous variable declaration, fix FOR loop

commit eb65416619437e4a3dec90277770803dd5b2281c
Author: Matthew Patton <mpatton@enquizit.com>
Date:   Tue Oct 30 19:30:44 2018 -0400

    match styistic convension with rest of docs

commit acaa2b31ed463219c4ef099f351eec72406e2989
Author: Matthew Patton <mpatton@enquizit.com>
Date:   Tue Oct 30 19:08:39 2018 -0400

    revert dangling config file change

commit e573fde668dcb418561e61535c1d68b2888f5b0f
Author: Matthew Patton <matthew.patton@itgfirm.com>
Date:   Fri Dec 29 23:53:43 2017 -0500

    replace invalid TMPDIR variable wth PACKER_TMP_DIR.
    update ConfigTmpDir() to try common temporary paths first and
    only write to configDir() as a last resort.

commit 39a9874afc9dea71b36753375fb7feb61ffecf69
Merge: 8a413cfe8 3315812c2
Author: Matthew Patton <mpatton@enquizit.com>
Date:   Tue Oct 30 18:19:26 2018 -0400

    Merge branch 'master' of https://github.com/hashicorp/packer into prestine

commit 8a413cfe83b0a70dbd99c32d936334ca5788ca9b
Merge: e07491de5 4e14710a6
Author: Matthew Patton <mpatton@enquizit.com>
Date:   Mon Oct 1 20:18:10 2018 -0400

    Merge remote-tracking branch 'upstream/master' into prestine

commit e07491de59cead0b337a7f57f4a6c625e1f560ab
Merge: 42610a35d a1fa35dff
Author: Matthew Patton <mpatton@enquizit.com>
Date:   Tue Aug 21 13:26:19 2018 -0400

    Merge remote-tracking branch 'upstream/master' into prestine

commit 42610a35d5ef65af8844a58ad70e2ec75262da6a
Merge: 5298142da 0d63cf7bc
Author: Matthew Patton <matthew.patton@itgfirm.com>
Date:   Tue Jun 19 22:45:05 2018 -0400

    Merge remote-tracking branch 'upstream/master' into prestine

commit 5298142da6da95354844f201deeeef3c599e48b2
Merge: 7bb110bc7 9d9736552
Author: Matthew Patton <mpatton@enquizit.com>
Date:   Mon Jun 11 15:10:09 2018 -0400

    Merge remote-tracking branch 'upstream/master' into prestine

commit 7bb110bc744c9797fcaec25a265d9b85a22d6d6b
Merge: a61c869ca 6189d66e7
Author: Matthew Patton <matthew.patton@itgfirm.com>
Date:   Wed May 9 23:41:22 2018 -0400

    Merge remote-tracking branch 'upstream/master' into prestine

commit a61c869ca7268acf0e3b1e1fa7a8ee7feea65984
Merge: 098101dd9 4be5f072c
Author: Matthew Patton <matthew.patton@itgfirm.com>
Date:   Fri May 4 10:13:04 2018 -0400

    Merge remote-tracking branch 'upstream/master' into prestine

commit 098101dd99f08b0ca110d33eff6904537c6d21de
Merge: fefaf0fa6 554b2b4a5
Author: Matthew Patton <matthew.patton@itgfirm.com>
Date:   Tue May 1 20:52:30 2018 -0400

    Merge branch 'EOL-handling' into prestine

Co-Authored-By: Matthew Patton <pattonme@yahoo.com>
2018-12-12 16:35:57 +01:00
Megan Marsh 042e9ad14b Move logging about aws waiters to the access config prepare() so that it's only spit out once per builder. 2018-12-06 14:37:31 -08:00
Andrew Starr-Bochicchio c0c5c6afac Add DigitalOcean post-processor. 2018-11-29 21:00:57 -05:00
Julio Tain Sueiras 51053efad2 Docs changes & Removed memory and quiesce options from vsphere-template 2018-11-28 11:25:01 -05:00
Julio Tain Sueiras 7f7fee3e2b Added Creation of Snapshot to vSphere Template 2018-11-07 23:59:12 -05:00
Megan Marsh 8567be43d9
Merge pull request #6927 from hashicorp/rebased_4591
Extend vmware-vmx builder to allow esxi builds. (Rebase of PR #4591)
2018-11-06 09:59:26 -08:00
Henk e4c2216642 qemu: Add "hvf" as a libvirt driver
To prevent post-processing from failing when running on
macOS with the acceleratir set to "hvf".
2018-11-04 12:20:53 +01:00
Adrien Delorme b113518815
Use switch for readability
Co-Authored-By: c0sco <778087+c0sco@users.noreply.github.com>
2018-10-30 10:06:31 -07:00
Matt Stofko 029819b5d5 Support formats other than OVA. 2018-10-29 14:52:12 -07:00
Megan Marsh 290f4a7c4c cleanup to make it actually build after that monstrous rebase 2018-10-25 14:17:35 -07:00
Adrien Delorme 7b10079507 fail if the request could not be created 2018-10-25 10:28:12 +02:00
Adrien Delorme aa2ebec8fd remove duplicate error message from 2018-10-25 10:25:37 +02:00
Adrien Delorme ff4b6d4442 pass vagrant cloud auth token as http header
* stoped using url to pass the auth token and put it in the headers
* added newRequest method to VagrantCloudClient that sets json and auth headesr
* made VagrantCloudClient method pointers to avoid copies
2018-10-24 15:39:53 +02:00
Adrien Delorme 415b886f5b post-processor/vagrant-cloud: validate vagrant cloud auth token doing an auth request 2018-10-24 15:08:08 +02:00
dpolitis d1f5312253 fix recurring bug #3878, make destination ESXi host selectable in config, more informative error output 2018-09-10 08:40:03 +03:00
Megan Marsh f4a360bea9 remove unused argument 2018-08-24 14:19:01 -07:00
Megan Marsh 10c4aca521
Merge pull request #6534 from ChrisLundquist/clundquist/xz
add support for xz compression #6523
2018-08-24 14:15:55 -07:00
Megan Marsh d883dfe67a
Merge pull request #6566 from hashicorp/atlas-deprecation
Complete Atlas deprecation.
2018-08-23 14:35:33 -07:00
Megan Marsh ff6a039d5b replace scrubconfig with packer.LogSecretFilter.Set
filter winrm password from logs
Add new root-level packer template option, sensitive-variables, to tell us what user variables to mark sensitive.
2018-08-20 15:35:55 -07:00
Patrick Double d796edc783 Add to vagrant post-processor support for Azure 2018-08-08 10:04:28 -05:00
Matthew Hooker ddf23a2c46
Complete Atlas deprecation.
Removes the push command and the Atlas post-processor.  Please see our
guide on building immutable infrastructure with Packer on CI/CD for
ideas on implementing these features yourself.
https://www.packer.io/guides/packer-on-cicd/
2018-08-02 20:23:28 -07:00
Chris Lundquist ce1a5b7d7a Print why we are only using one core 2018-07-25 02:27:51 +00:00
Chris Lundquist 999a53ca76 add support for xz compression #6523 2018-07-24 19:46:21 +00:00
Megan Marsh 8f1eb5a61b fix crash caused by invalid datacenter url 2018-07-23 16:12:21 -07:00
Megan Marsh 66c45273fb
Merge pull request #6494 from double16/vagrant-docker
Vagrant post-processor for using a Docker image
2018-07-23 12:18:52 -07:00
Patrick Double 4f9a91012f Change docker-push to return docker-import artifact 2018-07-20 15:27:29 -05:00
Patrick Double 066b364873 Remove packer.docker from vagrant post processor builtins 2018-07-17 15:07:22 -05:00
Patrick Double a301145ae1 Allow docker build as input to vagrant, docs 2018-07-17 09:41:18 -05:00
Patrick Double 1781d352a5 Add Vagrantfile fragment with docker tag specified 2018-07-16 15:35:02 -05:00
Megan Marsh f657ca39c9 refactored env var code and tests so that I don't have to set env vars during tests to check logic 2018-07-11 10:36:21 -07:00
Megan Marsh bfbe318727 fix the homegrown waiters
fix image import; issue was with wait options not being evaluated
2018-07-11 10:36:21 -07:00
Megan Marsh f49a2d8aed move UI call to before the wait; add context to these steps 2018-07-11 10:36:21 -07:00
Megan Marsh cf63dd10bf replace AMIStateRefreshFunc, InstanceStateRefreshFunc, our spot instance waiter, our chroot volume waiter, and our snapshot waiters with waiters form AWS's SDK. 2018-07-11 10:34:20 -07:00
Patrick Double e7fc651f60 First cut at vagrant post-processor for docker 2018-07-06 17:11:24 -05:00
Sean Malloy d8b229b59a Add feature to googlecompute-import post-processor to delete GCS files
New skip_clean config option added to control deleting import tar
files from GCS bucket. Defaults to false meaning by default delete
import tar files from the GCS bucket.
2018-07-02 21:44:30 -05:00
Adam Robinson 8715bfbf70 set all tar timestamp fields to the zero date 2018-06-26 21:39:54 -05:00
Sean Malloy 3622a669dc Add new post processor googlecompute-import 2018-06-26 21:39:55 -05:00
Matthew Hooker 788418cff2
Add unit test to show that we handle tars safely 2018-05-25 12:13:59 -07:00
Megan Marsh 7e9a653da7 use testify instead of homegrown string compare 2018-05-21 15:26:57 -07:00
Megan Marsh 58acb7f436 fix windows test 2018-05-07 15:10:10 -07:00
Megan Marsh fabd1a6517 windows cmd env vars 2018-05-07 15:10:10 -07:00
Megan Marsh e983a94a88 fix default windows bash call for shell-local provisioner and move chmod command from the execute_command array into the portion of code where we actually generate inline scripts, sparing users the need to think about this modification which Packer should really handle on its own
make bash call work on windows
2018-05-07 15:10:10 -07:00
Megan Marsh 5da4377f21 first pass at docs update 2018-05-07 15:10:10 -07:00
Megan Marsh 854d6fb141 add tests making sure post-processor has backwards compatability 2018-05-07 15:10:10 -07:00
Megan Marsh d304234725 fix tests 2018-05-07 15:10:10 -07:00
Megan Marsh 6dc4b1cbdc move all of the run commands for shell-local provisioner and postprocessor into common library too 2018-05-07 15:10:09 -07:00
Megan Marsh 926327beba deduplicate all validation and interpolation of the shell-local config, sharing options between shell-local provisioner and post-processor. Maintain backwards compatibility with shell-local provisioner. 2018-05-07 15:10:09 -07:00
Megan Marsh 616b41e58f deduplicate the nearly identical communicators for the shell-local provisioner and post-processor, moving single communicator into a new common/shell-local module 2018-05-07 15:10:09 -07:00
Matthew Hooker c6299972b9
s/boot_command/bootcommand/ 2018-04-19 14:26:31 -07:00
Megan Marsh 6855216387 force QueryEscape to escape spaces as %20 instead of as + for ovftool. 2018-04-06 15:48:04 -07:00
Matthew Hooker 60986ae682
better comment about why gnu tar 2018-03-29 16:18:55 -07:00
Matthew Hooker 742e366367
conditionally set tar header on go >= 1.10 2018-03-29 14:21:54 -07:00
Stefan Scherer 832f390733
Set tar header format to tar.FormatGNU 2018-03-29 22:46:59 +02:00
Megan Marsh 2cecd73aad add clarity to error message in vsphere-template postprocessor 2018-03-20 11:32:01 -07:00
Matthew Hooker 3c37aaf4e6
update atlas deprecation language
This is a follow-on to #6018
2018-03-19 10:50:29 -07:00
Josh Soref 939e7d5587 spelling: delete 2018-03-13 07:36:38 +00:00
Josh Soref f6745897c5 spelling: compute 2018-03-13 07:21:31 +00:00
Josh Soref c312493c38 spelling: available 2018-03-13 07:13:24 +00:00
Josh Soref 5c0191828f spelling: account 2018-03-13 07:05:56 +00:00
Graham Hayes 91d60d6b81
Add LXC to vagrant post-processor 2018-03-07 15:17:52 +00:00
Matthew Hooker 975b50005b
Merge branch 'master' into local-vsphere-template 2018-02-09 11:18:13 -08:00
Edouard BONLIEU ae18995ca1
Fix builder id 2018-02-08 12:10:10 -08:00
Edouard BONLIEU 7e36cfcff1
Add Scaleway builder 2018-02-08 12:09:24 -08:00
Matthew Hooker c03ce222b2
add atlas deprecation warnings. 2018-02-07 15:45:00 -08:00
Matthew Hooker 625201c819
Merge pull request #4148 from minimum2scp/features/googlecompute-export-application-default-credential
googlecompute-export: use application default credential
2018-02-05 09:51:21 -08:00
SwampDragons 074ddbea8e
Merge pull request #5732 from KohlsTechnology/vagrant_google
Add vagrant post-processor support for Google
2018-01-31 15:49:02 -08:00
Matthew Hooker 48e12b6bee
only set role name if it's set. 2018-01-25 10:39:21 -08:00
Brian Terry 380147200c Added role in amazon-import 2018-01-25 10:56:30 -05:00
Matthew Hooker 7a189a83a1
fix imports
`find . -type f -name '*.go' -not -path "./vendor/*" -exec goimports -w {} \;`
2018-01-24 17:09:17 -08:00
Matthew Hooker a831d522be
change run signatures
Run now takes a context as well as a statebag. We'll assign the context
to the blank identifier to prevent namespace collisions. We'll let the
step authors opt-in to using the context.

`find . -iname "step_*.go" -exec gsed -i'' 's/func \(.*\)Run(/func \1Run(_ context.Context, /' {} \;`
2018-01-24 17:09:17 -08:00
Matthew Hooker 366dc3da0a
move multistep imports to helper.
gomvpkg -from "github.com/mitchellh/multistep" -to "github.com/hashicorp/packer/helper/multistep"
2018-01-24 17:09:15 -08:00
Matthew Hooker ebe995c0ff
run goimports 2018-01-22 17:21:10 -08:00
Sean Malloy e8bac9f4c8 Add unit tests for new vagrant Google post-processor 2017-12-23 23:46:30 -06:00
Sean Malloy e47bd65986 Add vagrant post-processor support for Google
Add the ability to create Google vagrant boxes
using the vagrant post-processor. The Google
plugin for vagrant is linked below.

https://github.com/mitchellh/vagrant-google
2017-12-23 00:13:17 -06:00
Matthew Hooker f3dea272d9
Set session in state bag
We can construct connections to arbitrary regions from it
2017-12-19 11:32:33 -08:00
Matthew Hooker f6c401a143
don't pass in accessconfig 2017-12-19 11:32:32 -08:00
Rong Chen 3e92b1374e issue5606: follow the convention to use AccessConfig to create new aws session for step_create_tags etc. 2017-12-19 10:34:12 -08:00
Krzysztof Wilczynski 05327b7524
amazon: Remove Session Token (STS) from being shown in the log.
This commit adds a change which ensures that the Session Token
config struct item is removed from log output.

Signed-off-by: Krzysztof Wilczynski <kw@linux.com>
2017-12-04 22:14:38 +01:00
Megan Marsh 487ceac784 fix Vet error. 2017-11-13 11:45:31 -08:00
bugbuilder b754b71519 return vsphere artifact to can build template 2017-11-10 22:57:39 -03:00
bugbuilder da54bf8e73 using only remoteFolder as parameter 2017-11-10 14:03:15 -03:00
Matthew Hooker f146e5903f
Merge pull request #5567 from bennu/vm-template-with-export-vm
enable vsphere-template post processor to work with export behavior
2017-11-09 15:24:41 -08:00
bugbuilder 23f4d187e2 validating keep_registered and fixing skip_export issues 2017-11-08 15:57:34 -03:00
Matthew Hooker 0172a5c82b
Merge pull request #5511 from hashicorp/fix5507
remove login_email from docker
2017-11-06 15:34:04 -08:00
bugbuilder 5ccba2caaa using virtual disk device to create datastorePath 2017-11-06 02:57:41 -03:00
Matthew Hooker 52558e4f75
check for nil body from upload response 2017-11-02 00:13:31 -07:00
Joe Ferguson 5c2f758053 🎨 Fix typo in "copyed" -> "copied" usages. 2017-10-26 07:42:49 -05:00
Matthew Hooker 1901c0385f
remove login_email from docker
adds fixer
removes documentation
removes from docker builder and docker-push pp
2017-10-25 10:53:06 -07:00
Matthew Hooker abcc02dc64
filter password from logs 2017-10-24 11:39:04 -07:00
Matthew Hooker 0cf0a4336d
relay ovftool output. 2017-10-23 15:38:57 -07:00
Megan Marsh a7d25cd4c1 remove deprecation warning since we've been talked out of removing shell-local postprocessor 2017-10-12 16:14:15 -07:00
Matthew Hooker 4d3a762e85 Merge pull request #5207 from sandersaares/hyperv-vagrant-hardlink
Link VHD instead of copy where allowed by OS
2017-10-09 15:08:16 -07:00
bugbuilder 50904064e1 doesn't keep the original artifact 2017-09-24 21:56:35 -03:00
bugbuilder 75a4ca7351 adding artifact testing and using builder id 2017-09-23 15:43:57 -03:00
bugbuilder f1773a57f8 using vmx extension as default 2017-09-23 03:01:35 -03:00
bugbuilder 99dd19ccfd Adding correct reference to VM remote path 2017-09-22 23:37:27 -03:00
bugbuilder 24a8fddf03 showing artifact info in packer UI 2017-09-22 13:54:11 -03:00
bugbuilder 644ac5b367 enable vsphere-template to work with local builders 2017-09-20 22:50:37 -03:00
Megan Marsh fa177c52c2 put deprecation warning at end so it isnt lost in scrollback 2017-09-11 16:35:05 -07:00
Megan Marsh 4b7fd33f99 add deprecation warning to shell local provisioner 2017-09-11 16:29:45 -07:00
Sander Saares fb4db02586 Copy/link permissions 0777 -> 0755
Previous permission flags were unusually permissive. Almost everything else in Packer uses 0755.
2017-09-02 15:06:04 +03:00
Sander Saares 0ebf1d0da9 Link VHD instead of copy where allowed by OS
No need to incur that copy I/O if we don't even change the file!
2017-09-02 14:56:59 +03:00
bugbuilder 6590dfaf82 using runner with pause func 2017-09-01 00:33:40 -03:00
bugbuilder abc21406cb Merge branch 'master' of https://github.com/hashicorp/packer into vsphere-tpl 2017-08-31 22:22:51 -03:00
Vijaya Bhaskar Reddy Kondreddi e45223a867 Fix -on-error issue not working.
When we supply -on-error flag for Packer with Hyper-v builder, it does not do anything.
2017-09-01 00:14:28 +05:30
bugbuilder f09a9c4653 using artifact ID 2017-08-30 18:19:54 -03:00
bugbuilder 138f54d9d3 Merge branch 'master' of https://github.com/hashicorp/packer into vsphere-tpl 2017-08-30 18:13:54 -03:00
bugbuilder fc4bee4598 VMware typo 2017-08-24 22:46:35 -03:00
bugbuilder 81272d1427 Updated mark as template to be able to use --force 2017-08-14 23:00:19 -03:00
Matthew Hooker 943e8e648a
properly handle decode error 2017-08-07 11:09:40 -07:00
Luke Farnell d9a5b69403 clean up ineffectual assignments 2017-08-07 13:20:01 -04:00
Justin Campbell 24c4029bb1 Remove date from atlas post-processor warning 2017-08-01 09:08:14 -04:00
bugbuilder 5e1d241db4 Close govmomi session 2017-07-31 10:30:13 -04:00
bugbuilder 786d3c0a9d updated documentation, vm_name mandatory and cleaning code 2017-07-31 00:26:58 -04:00
bugbuilder 08c6139da4 Create folder using the invotory path 2017-07-27 16:55:47 -04:00
bugbuilder fb52c42b3d Only add the folder when the error is NotFoundError 2017-07-25 23:14:59 -04:00
bugbuilder 7274bbb63d commends, documentation and var names updates 2017-07-19 00:44:18 -04:00
bugbuilder fa10616f57 Changes requested applied 2017-07-18 23:10:05 -04:00
bugbuilder 3cc9f204ac Moving vsphere-tpl to vsphere-template, fixed root folder creation and updated docs 2017-07-10 20:52:48 -04:00
bugbuilder b88fb8bdb2 Improved creation folder step and fixed documentation 2017-07-10 04:13:54 -04:00
bugbuilder 2830b4f3b0 fix test 2017-07-09 22:18:42 -04:00
bugbuilder 35d681444c format 2017-07-09 22:13:31 -04:00
bugbuilder fec0b934b5 Adding a simple test 2017-07-09 21:58:29 -04:00
bugbuilder 26dd7ec31b keep_registered option is not required 2017-07-09 20:33:03 -04:00
bugbuilder 35b29847dc Cleaning code and adding insecure option to vSphere connection 2017-07-09 15:58:42 -04:00
Rickard von Essen 337e7d88e6
post-processor/checksum: properly interpolate output
Fix a bug where "output" of checksum post-processor was not correctly
interpolating {{.BuilderType}}, {{.BuildName}}, and {{.ChecksumType}}.
2017-07-09 21:50:20 +02:00
bugbuilder c8747f138f Adding template feature 2017-07-09 14:56:39 -04:00
bugbuilder dc2124aa2a Initial vSphere-tpl post-processor 2017-07-09 14:12:37 -04:00
Megan Marsh b8b34646bd disallow vagrant.box artifacts in atlas postprocessor 2017-06-29 11:16:42 -07:00
Matthew Hooker 8dae6b60c1 Merge pull request #4996 from hashicorp/mwhooker/4613
builder/amazon: Support Assume Role with MFA and ECS Task Roles
2017-06-13 17:40:09 -07:00
Matthew Hooker 4b4c2e4a59 Merge pull request #5008 from hashicorp/pp-vc-u1
post-processor/vagrant-cloud: try upload once
2017-06-13 11:36:42 -07:00
Matthew Hooker 94d7a4ce8d
post-processor/vagrant-cloud: try upload once
* fixes multiple uploads mentioned in #4973
* removed unused token code
2017-06-12 17:34:32 -07:00
Matthew Hooker 519256feb0
add content-length to file upload 2017-06-12 15:01:19 -07:00
Matthew Hooker a1747c21f7
vagrant-cloud: use less memory when uploading 2017-06-12 11:07:33 -07:00
Matthew Hooker 56c513088b
I think this was the intention 2017-06-09 10:34:49 -07:00
Matthew Hooker dde40d54c6
atlas cloud token warn 2017-06-07 17:20:54 -07:00
Matthew Hooker 8933690e90 Merge pull request #4950 from hashicorp/warn_atlas_users
add warning about vagrant.box vms being uploaded to atlas
2017-06-07 13:44:41 -07:00
Megan Marsh dbd7aa6b95 capitalize all the things 2017-06-07 13:30:39 -07:00
Megan Marsh 1c1db91715 add instructions 2017-06-07 13:20:02 -07:00
Andrew Garrett fbacf883b4 Fix vet issues with alicloud 2017-06-07 19:38:26 +00:00
Matthew Hooker a52cd65af8
remove license type from general debugging 2017-06-05 15:27:33 -07:00