Commit Graph

148 Commits

Author SHA1 Message Date
Wilken Rivera 8d209caf34 Fix spacing and line endings 2020-06-24 09:20:32 -04:00
Arsenii Petrovich f3c33f9a27 remove spaces 2020-06-24 16:08:48 +03:00
Arsenii Petrovich c2f352ee6e Update JSONs to fix tests and make them work with the latest URL changes 2020-06-24 01:35:35 +03:00
Arsenii Petrovich d7b8d50acd
Fix data disks URI
Fixing bug appeared in 0589f57d4d
2020-06-23 12:58:53 +03:00
Feiyu Shi c016f3752a upgrade SIG source api-version to match identity api-version to avoid potential setback for identity 2020-05-26 16:08:00 -07:00
Feiyu Shi b334458b91 use empty struct for UserAssignedIdentities map value; omitempty 2020-05-24 19:05:45 -07:00
Feiyu Shi c5e2eff847 change to []*Resource 2020-05-24 19:05:45 -07:00
Feiyu Shi 76a7ab25e2 add SetIdentity test 2020-05-24 19:05:45 -07:00
Feiyu Shi 764f99ec7b add correct api-version 2020-05-24 19:05:45 -07:00
Feiyu Shi 7c1a62dfed set identity field in the template 2020-05-24 19:05:45 -07:00
Feiyu Shi d9c9bfbae8 add identity field to the template 2020-05-24 19:05:45 -07:00
Evan Digby e4eaff6bba
s/Directoty/Directory (#9221) 2020-05-14 15:00:27 +02:00
Paul Meyer 26d768f429
[builder/azure-chroot] Shared image source (#9070) 2020-04-23 11:03:17 +02:00
vijayrajah 5d2fee04b2
builder/azure: enable boot Diagnostics (#9053)
* enable boot Diagnostics
2020-04-20 07:29:13 -04:00
Paul Meyer 89f3aa0bd6
[builder/azure-arm] Use VM/build location for image location (#9068)
* [builder/azure-arm] Use VM/build location for image locationThe builder was using the location of the containing resource group asthe image location, but the API call can only create images in the samelocation as the source VM that is being captured.
2020-04-17 05:43:03 -04:00
Paul Meyer 89a8238a07 Fix artifact output 2020-04-09 20:54:50 +00:00
Paul Meyer 47107e6355 Default polling delay 5 sec 2020-04-09 20:37:23 +00:00
Paul Meyer 90188bb18d add func for searching string slice 2020-04-07 22:49:24 +00:00
Paul Meyer a3d8bf27e1 Add snapshot and gallery clients 2020-04-07 22:49:24 +00:00
Paul Meyer f3703a775f Use subscription id from client set 2020-04-07 22:49:24 +00:00
Paul Meyer 6131301fdd Standardize compute SDK version 2020-04-07 22:49:24 +00:00
Paul Meyer f0ec912ba6 Make VirtualMachineImagesClient easier to mock 2020-04-07 22:49:21 +00:00
Paul Meyer a3b49cdc08 Stub metadata service for builder tests 2020-04-07 22:49:21 +00:00
Vijay Rajah 90a0c5ec49 fix more typos ( ')]' ) 2020-04-06 22:02:43 +05:30
Vijay Rajah 1009e8c983 fix more typos 2020-04-06 21:50:05 +05:30
Vijay Rajah 1314d69b51 fix typo (add missing ')]' ) 2020-04-06 11:40:05 +05:30
Vijay Rajah 0589f57d4d Update tests for datadisk name change 2020-04-05 01:16:24 +05:30
Vijay Rajah d82475566a change datadisk names -- WIP 2020-04-02 21:28:38 +05:30
Megan Marsh 28797dd709 replace the homegrown vault delete functions in azure with the sdk ones. 2020-03-18 13:48:54 -07:00
Mike Brancato 926e3ac2e4 Add support for configurable KeyVault SKU 2020-03-11 20:33:57 -04:00
Megan Marsh 9643ad35f1 add tests 2020-02-06 16:41:28 -08:00
Megan Marsh 6d6b94d515 Add ability to use custom keyvault into azure builds 2020-02-06 16:41:28 -08:00
Sylvia Moss dc31bad539
Sharing info with post-processors via artifact (#8632) 2020-01-30 11:27:58 +01: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
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
Lars Lehtonen df031db9da builder/azure/common/template: remove unused TemplateBuilder.getResourceByType2() (#8419)
builder/azure/common/template: remove unused TemplateBuilder.toKeyVaultID()
2019-12-02 18:09:42 +01:00
Megan Marsh d5ba530b26 make it clear we expect pem format not some other formate (#8344) 2019-11-07 10:30:51 +01:00
Megan Marsh 6c704f7046 Revert "fix template imports"
This reverts commit 0e70e0e5a4.
2019-11-04 14:29:00 -08:00
Megan Marsh 517834d528 Revert "Revert "remove clean_ami_name and clean_image_name; complete the deprecation for these functions in favor of clean_resource_name""
This reverts commit 44f91c9afc.
2019-11-04 14:28:40 -08:00
Paul Meyer b54a2ee09d Set correct user agent for Azure clientset 2019-10-23 11:31:29 -07:00
Megan Marsh d15f43e4eb
Merge pull request #8232 from hashicorp/artifact-tree
HCL2 configs - part one
2019-10-22 11:54:34 -07:00
Megan Marsh 836aaafaa3
Merge pull request #8203 from sumit-kalra/master
Azure-ARM builder: Deploy NSG if list of IP addresses is provided in config
2019-10-21 11:10:58 -07:00
Adrien Delorme 4542666e25 fix func calls after master merge 2019-10-16 10:40:25 +02:00
Adrien Delorme cf1555bf17 Merge remote-tracking branch 'origin/master' into artifact-tree 2019-10-16 10:22:56 +02:00
Paul Meyer 9b724d4ca0 Add artifact 2019-10-15 21:14:20 +00:00
Paul Meyer 0866cb3714 Reorganize client/common packages 2019-10-15 21:14:20 +00:00
Paul Meyer 716f19a457 make fmt 2019-10-15 21:14:20 +00:00
Paul Meyer 27a5bfe11c Add implementation for disk as source 2019-10-15 21:13:37 +00:00
Paul Meyer 113dc12346 Add function to detect whether Packer is running on Azure 2019-10-15 21:13:37 +00:00
Paul Meyer f106adbd12 Add Azure client set for chroot builder 2019-10-15 21:13:37 +00:00