Commit Graph

233 Commits

Author SHA1 Message Date
Adrien Delorme 0c45bd8b4f import new replace and regex replace funcs from go-cty + documentation 2020-03-10 16:14:25 +01:00
Adrien Delorme 193dad46e6
Hcl2 input variables, local variables and functions (#8588)
Mainly redefine or reused what Terraform did.

* allow to used `variables`, `variable` and `local` blocks
* import the following functions and their docs from Terraform: abs, abspath, basename, base64decode, base64encode, bcrypt, can, ceil, chomp, chunklist, cidrhost, cidrnetmask, cidrsubnet, cidrsubnets, coalesce, coalescelist, compact, concat, contains, convert, csvdecode, dirname, distinct, element, file, fileexists, fileset, flatten, floor, format, formatdate, formatlist, indent, index, join, jsondecode, jsonencode, keys, length, log, lookup, lower, max, md5, merge, min, parseint, pathexpand, pow, range, reverse, rsadecrypt, setintersection, setproduct, setunion, sha1, sha256, sha512, signum, slice, sort, split, strrev, substr, timestamp, timeadd, title, trim, trimprefix, trimspace, trimsuffix, try, upper, urlencode, uuidv4, uuidv5, values, yamldecode, yamlencode, zipmap.
2020-02-06 11:49:21 +01: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
Adrien Delorme 46ce0529dd docs ++ 2019-12-19 16:23:30 +01:00
Adrien Delorme 7fe51022ca add expression 2019-12-18 18:16:10 +01:00
Adrien Delorme 0436457fd7 fix sidebar current 2019-12-18 17:14:02 +01:00
Adrien Delorme 8cdf8ca442 add syntax-json for HCL 2019-12-18 17:10:59 +01:00
Adrien Delorme bb72a0c0ce document hcl language & syntax 2019-12-18 16:57:36 +01:00
Adrien Delorme 9219a606a3 move "Installing Packer" a little lower in the nav bar 2019-12-18 15:57:28 +01:00
Adrien Delorme 8dc587967e Update guides.erb 2019-12-18 15:51:38 +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
Adrien Delorme 7108f6d07e
Merge pull request #8295 from rjspiker/rj.fonts
website - font and brand updates
2019-11-05 15:40:03 +01:00
mingsheng.su ba90606581 fix docs index 2019-11-05 19:07:09 +08:00
RJ Spiker 8ab89b5ed7 feedback updates and some style cleanup 2019-11-04 13:11:13 -07:00
Megan Marsh de360df259 update website to hopefully make community builders and provisioners easier to find 2019-10-21 16:04:34 -07:00
Paul Meyer 066ae0aa07 Documentation update 2019-10-15 21:14:20 +00:00
Megan Marsh ccf58f0c98 major rework of communicator docs and addition of preseed guides 2019-10-03 09:18:03 -07:00
Adrien Delorme f89156fb83 link proxmox builder docs
fix #8044
2019-08-28 10:13:34 +02:00
xiaohan.liang f4fc9dd09a Rewrite all files, remove sensitive information 2019-08-09 15:00:23 +08:00
Thomas Meckel a876bf3c4e Added documentation for virtualbox-vm builder 2019-07-27 16:08:13 +02:00
Marin Salinas a152ca272e website: add outscale bsuvolume website documentation 2019-07-18 09:39:08 -07:00
Marin Salinas 0fe9971843 website: add outscale chroot website documentation 2019-07-18 09:39:08 -07:00
Marin Salinas 46afe22f8b website: add bsusurrogate website documentation 2019-07-18 09:39:08 -07:00
Marin Salinas 6b3da118fb website: add outscale bsu builder webite documentation 2019-07-18 09:39:08 -07: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
mingsheng.su d1b9ad90c8 Merge remote-tracking branch 'origin' into feature/ucloud_builder 2019-06-18 18:17:19 +08:00
mingsheng.su 00ae304919 update docs && examples 2019-06-18 17:54:07 +08:00
Megan Marsh 435bda05a7 clean up docs 2019-06-06 15:02:22 -07:00
Megan Marsh 2b8fe72e30 add to sidebar nav 2019-06-06 14:31:02 -07:00
Adrien Delorme 5399e8a67d
Merge pull request #7547 from hashicorp/comment_guide
add guide for uisng jq to strip comments from packer template
2019-04-23 15:26:24 +02:00
Megan Marsh f985f2de62 add docs for how to use the format strings for the isotime function 2019-04-22 16:10:35 -07:00
Megan Marsh 9eadac3410 add guide for uisng jq to strip comments from packer template 2019-04-22 15:35:00 -07:00
Marques Johansson 99987c2d56 Add Linode Images builder
Packer Builder for [Linode Images](https://www.linode.com/docs/platform/disk-images/linode-images/)

Adds the following builder:

  * `linode`

Based on https://github.com/linode/packer-builder-linode (MPL/2)
(formerly maintained by @dradtke).  Includes website docs and tests.

Relates to #174, #3131
2019-04-15 20:40:59 -04:00
Gennady Lipenkov d816bb1700 Init doc page
Squashed commit of the following:

commit adff177ad2e3fc9d73bcf9703c7443ae33922dca
Author: Yandex.Cloud Bot <ycloud-bot@yandex.ru>
Date:   Tue Mar 26 20:52:08 2019 +0000

    sync upstream
2019-04-12 01:00:54 +03:00
Megan Marsh 5aa55f194d add vagrant docs to website 2019-03-05 09:31:14 -08:00
Miłosz Smółka 94a7a07c87 Merge branch 'master' into hyperone 2019-02-24 15:16:21 +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
xinau c207451f7e Merge branch 'master' of https://github.com/hashicorp/packer into packer-provisioner-inspec 2019-02-12 05:32:05 +00:00
Miłosz Smółka 228829139b Merge branch 'master' into hyperone 2019-02-07 14:12:13 +01:00
Rickard von Essen 26aa0144e6
ansible: Change the doc navigator to Ansible (Remote) 2019-02-04 18:56:52 +01:00
Matthew Aynalem b404cfc365 add builder/tencentcloud-cvm to sidebar
post-processors/docker-import - move tags under optional
add missing data types to various attributes
2019-02-03 16:24:38 -08:00
Miłosz Smółka be30415395 Add HyperOne builder 2019-01-23 14:04:05 +01:00
xinau f5b13e3cb5 added inspec.io provisioner 2019-01-20 15:43:47 +00:00
Andrew Starr-Bochicchio c0c5c6afac Add DigitalOcean post-processor. 2018-11-29 21:00:57 -05:00
Megan Marsh a93721c54d add disable option to breakpoint provisioner 2018-11-29 15:09:14 -08:00
Lukas Kämmerling 1600a12880 Add missing docs link 2018-11-14 06:46:28 +01: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
Sean Malloy cf04fd55ea Add missing link to googlecompute-import post-processor docs 2018-07-16 20:40:19 -05:00
Jeff Kohrman 2cf0533221
Add link to privacy policy in website footer
Added link to updated privacy policy in footer of `layout.erb` for the OSS website.
2018-05-09 12:15:11 -06:00
Jeff Escalante a0fa374844 bring back turbolinks and adjust scripts to match 2018-04-23 14:18:00 -04:00