Megan Marsh
6d6b94d515
Add ability to use custom keyvault into azure builds
2020-02-06 16:41:28 -08:00
nywilken
654cc4c4d5
builder/azure-arm: Set WinRMPassword on the communicator config
...
Build results before change
```
azure-arm: output will be in this color.
==> azure-arm: Running builder ...
azure-arm:
==> azure-arm: Provisioning with Powershell...
==> azure-arm: Provisioning with powershell script:
/tmp/powershell-provisioner922851060
==> azure-arm: Exception calling "RegisterTaskDefinition" with "7" argument(s): "(38,4):Task:"
==> azure-arm: At C:\Windows\Temp\packer-elevated-shell-5e320d29-bdbd-b619-9e64-0c8a301b9d1d.p
==> azure-arm: s1:60 char:1 ==> azure-arm: + $f.RegisterTaskDefinition($name, $t, 6,
"packer", $password, $logon_type,
==> azure-arm: $null) ...
==> azure-arm: +
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
==> azure-arm: ~~~
==> azure-arm: + CategoryInfo : NotSpecified:
(:) [], MethodInvocationException
==> azure-arm: + FullyQualifiedErrorId :
ComMethodTargetInvocation
==> azure-arm:
==> azure-arm: Exception calling "GetTask" with "1"
argument(s): "The system cannot find the
==> azure-arm: file specified. (Exception from HRESULT:
0x80070002)"
==> azure-arm: At
C:\Windows\Temp\packer-elevated-shell-5e320d29-bdbd-b619-9e64-0c8a301b9d1d.p
==> azure-arm: s1:61 char:1
==> azure-arm: + $t = $f.GetTask("\$name")
==> azure-arm: + ~~~~~~~~~~~~~~~~~~~~~~~~~
==> azure-arm: + CategoryInfo : NotSpecified:
(:) [], MethodInvocationException
==> azure-arm: + FullyQualifiedErrorId :
ComMethodTargetInvocation
==> azure-arm:
==> azure-arm: Method invocation failed because
[System.__ComObject] does not contain a
==> azure-arm: method named 'Run'.
==> azure-arm: At
C:\Windows\Temp\packer-elevated-shell-5e320d29-bdbd-b619-9e64-0c8a301b9d1d.p
==> azure-arm: s1:62 char:1
==> azure-arm: + $t.Run($null) | Out-Null
==> azure-arm: + ~~~~~~~~~~~~~~~~~~~~~~~~
==> azure-arm: + CategoryInfo :
InvalidOperation: (Run:String) [], RuntimeExcept
==> azure-arm: ion
==> azure-arm: + FullyQualifiedErrorId : MethodNotFound
==> azure-arm:
Cancelling build after receiving interrupt
==> azure-arm: Removing the created Deployment object:
'pkrdp087bb80ibj'
==> azure-arm: Removing the created Deployment object:
'kvpkrdp087bb80ibj'
==> azure-arm:
==> azure-arm: Cleanup requested, deleting resource group
...
==> azure-arm: Resource group has been deleted.
Build 'azure-arm' errored: Build was cancelled.
Cleanly cancelled builds after being interrupted.
```
Build results after change
```
azure-arm: WinRM connected.
==> azure-arm: <Objs Version="1.1.0.1"
xmlns="http://schemas.microsoft.com/powershell/2004/04 "><Obj S="progress" RefId="0"><TN RefId="0"><T>System.Management.Automation.PSCustomObject</T><T>System.Object</T></TN><MS><I64
N="SourceId">1</I64><PR N="Record"><AV>Preparing modules for first use.</AV><AI>0</AI><Nil /><PI>-1</PI><PC>-1</PC><T>Completed</T><SR>-1</SR><SD> </SD></PR></MS></Obj><Obj S="progress" RefId="1"><TNRef RefId="0" /><MS><I64 N="SourceId">2</I64><PR N="Record"><AV>Preparing modules for first use.</AV><AI>0</AI><Nil /><PI>-1</PI><PC>-1</PC><T>Completed</T><SR>-1</SR><SD> </SD></PR></MS></Obj><Obj S="progress" RefId="2"><TNRef RefId="0" /><MS><I64 N="SourceId">3</I64><PR N="Record"><AV>Preparing modules for first use.</AV><AI>0</AI><Nil /><PI>-1</PI><PC>-1</PC><T>Completed</T><SR>-1</SR><SD> </SD></PR></MS></Obj></Objs>
==> azure-arm: Connected to WinRM!
==> azure-arm: Running local shell script:
/tmp/packer-shell091779215 azure-arm: 022xUtbwAH3DdqIoRCOh9caZi8tOYqcY
==> azure-arm: Provisioning with Powershell...
==> azure-arm: Provisioning with powershell script: /tmp/powershell-provisioner469853889
azure-arm: HELLO NEW USER; automatically generated aws password is: 022xUtbwAH3DdqIoRCOh9caZi8tOYqcY
==> azure-arm: Querying the machine's properties ...
```
2020-01-30 12:07:48 -05: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
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
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
Megan Marsh
6f418d0e54
get data sharing to a working state with the powershell provisioner
2019-12-11 15:43:38 -08:00
Megan Marsh
601007e3e2
pas data into provisioners well
2019-12-11 15:43:38 -08: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
cf1555bf17
Merge remote-tracking branch 'origin/master' into artifact-tree
2019-10-16 10:22:56 +02:00
Adrien Delorme
078ba7c8c3
commit old code generation tool
...
for history
2019-10-15 12:56:42 +02:00
larohra
936ae42b00
Added a new parameter in config to override the default Azure Go SDK PollingDuration timeout
2019-10-11 15:29:02 -07:00
Sumit Kalra
4bd09f381e
Fixing documentation ( #6 )
2019-10-10 11:30:28 -07:00
Sumit Kalra
595b103bbe
Adding NSG to the ARM deployment template when needed ( #3 )
...
* Adding NSG to the ARM eployment template when needed
* Adding tests and fixing bugs
* Removing denyall rule
* Fixing logic to determine which port to open
* Fixing config description
2019-10-08 14:56:43 -07:00
Sumit Kalra
91d19adcd7
Ensuring that specifying allowed inbound IP and VNet are mutually exclusive ( #2 )
2019-09-26 23:33:18 +00:00
Sumit Kalra
132779c343
Adding config to specify allowed inbound IP addresses and CIDR blocks ( #1 )
...
* Adding config to specify allowed inbound IP addresses
* Also allowing CIDR blocks in addition to IP addresses
2019-09-26 23:31:28 +00:00
Paul Meyer
feeae1514e
Refactor client config
2019-09-25 20:33:38 +00:00
Adrien Delorme
f66ca58a46
Update azure docs for config.go
...
add missing docs fields
Co-Authored-By: Megan Marsh <swampdragons@users.noreply.github.com>
2019-08-27 09:32:03 +02:00
Adrien Delorme
783b02bd15
Update config.go
...
add missing doc fields
Co-Authored-By: Megan Marsh <swampdragons@users.noreply.github.com>
2019-08-27 09:28:36 +02:00
Adrien Delorme
4cb7c30987
Merge remote-tracking branch 'origin/master' into scrape_doc_to_builder_struct_config
2019-08-21 16:44:23 +02:00
Megan Marsh
6a201211a9
fix polling issues in azure
...
adds a configurable timeout to the shared image gallery publisher
2019-08-01 11:18:03 -07:00
Amrita Dutta
85036231c4
Final commit
2019-06-21 02:47:39 +00:00
Amrita Dutta
76dbf4fb3b
Remove subscription id from SIG destination input
2019-06-19 06:10:18 +00:00
Adrien Delorme
d81ca5728d
azure-arm: rewrap struct comments for documentation generation
2019-06-06 17:34:17 +02:00
Adrien Delorme
4399684372
make fmt autogenerated docs
2019-06-06 16:29:25 +02:00
Adrien Delorme
e6cbb013ba
add // go:generate struct-markdown to all previously edited files
2019-06-05 16:42:18 +02:00
Adrien Delorme
f1917edd34
generate the comments for config struct of builders scraping doc website
2019-06-05 16:42:17 +02:00
Amrita Dutta
1438e2e449
SIG as destination validation changes
2019-06-04 00:47:29 +00:00
Manuel Riezebosch
d79b54e46a
feat(arm-builder): print warning on zone resiliency for currently not supported locations
2019-02-15 19:27:53 +01:00
Manuel Riezebosch
f31031f6b1
feat(arm-builder): zone resilient from config
2019-02-15 19:27:32 +01:00
Paul Meyer
7e34579b7e
Factor out Azure client credential config
2019-01-15 17:23:57 +00:00
Christopher Boumenot
f9230aeb95
azure: fix snapshot regression
2018-12-13 13:58:18 -08:00
Christopher Boumenot
c7d8f4e150
azure: configuration for disk caching
...
Export a configuration knob to change the disk caching setting. The
default value remains ReadWrite. This seems the most appropriate value
given Packer. Certain disk sizes require that disk caching be disable,
and this knob allows the user to do just that.
2018-11-30 14:14:43 -08:00
Christopher Boumenot
06c2c35e4c
Merge pull request #6980 from amydutta/amdut/snapshot
...
Adding options for Managed Image OS Disk and Data Disk(s) snapshot(s)
2018-11-16 15:51:52 -08:00
Adrien Delorme
1958ef6e81
remove unecessary check
2018-11-12 11:32:49 +01:00
Adrien Delorme
08e8b1850e
remove unnecessary parenthesis
2018-11-12 10:49:39 +01:00
Adrien Delorme
1ab0173e69
azure builder: allow to auth with managed identities ( MSI )
2018-11-09 17:39:03 +01:00
Mikhail Ushanov
536252683e
builders: reuse private key file reading function
...
Signed-off-by: Mikhail Ushanov <gm.mephisto@gmail.com>
2018-11-08 14:25:50 +03:00
Amrita Dutta
8d8c86366b
Config tests + typo fix
2018-11-07 22:23:22 +00:00
Amrita Dutta
1266d5146d
addressed PR comments + add file for data disk snapshots
2018-11-06 19:17:03 +00:00
Amrita Dutta
d12d23d34b
OS disk snapshot
2018-11-05 23:48:22 +00:00
mbearup
335feaf89c
Convert shared_image_gallery options to a struct
...
Updates tests and documentation for shared_image_gallery
2018-10-09 13:56:49 -07:00
mbearup
5373b8586d
Update tests for Azure Shared Image Gallery
2018-10-05 16:04:07 -07:00
mbearup
b6bb5d4b4d
Fix format/spacing for config.go
2018-10-05 10:52:02 -07:00
mbearup
d21b13cb85
Modify variable names for Shared Image Gallery.
...
Add checks for Shared Image Gallery options.
2018-10-03 16:10:46 -07:00
mbearup
55be0da5da
Initial changes to support Shared Image Gallery
2018-09-30 13:56:44 -07:00
Megan Marsh
a0edaf6c46
Going to revert this change for now, becuase of potential issues that arise from calling Prepare() twice
...
Revert "use statebag instead of SetSharedState for winRM password"
This reverts commit b35acbd879
.
2018-09-10 16:48:42 -07:00
Adrien Delorme
336cac29d4
also use config.SSHPrivateKey for azure-arm builds
2018-08-29 14:40:32 +02:00
Adrien Delorme
51d2aac9f6
SSHPrivateKey => SSHPrivateKeyFile
2018-08-29 14:40:32 +02:00