Add custom information to the packer default output

56 views
Skip to first unread message

dennis....@immediate.co.uk

unread,
Apr 26, 2018, 4:59:57 AM4/26/18
to Packer
**Help wanted/Guidance** 

_Tools we are using_
+ Packer
+ AWS
+ Jenkins

After packer builds an image in AWS, besides the default information packer outputs about the AMI, we are trying to add more information to that output like the custom tags we have added to help identify the AMI in AWS.

**_Goal:_** The plan is to reference that file within Jenkins and use it for another part of the build.

Had a look and have not been able to find a way to do this. Has anyone done this before or is there a way to add more information to that default output.

An example of what the file might look like:


{
  uuid: 00000000
  ...
  ..
  environment:  development
  version:  3.0.0
  software:  jenkins 
}


Alvaro Miranda Aguilera

unread,
Apr 26, 2018, 7:16:50 AM4/26/18
to packe...@googlegroups.com
if I understand this correctly, you want to use that information during the packer build.

looks very similar to a var file, it may need some format update, but you could check into the var file

Alvaro.

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/packer/issues
IRC: #packer-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to packer-tool+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/4a81de36-eb63-4e3b-a9ce-700a08c65125%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Alvaro

Rickard von Essen

unread,
Apr 26, 2018, 8:23:38 AM4/26/18
to packe...@googlegroups.com
Also check the manifest post-processor. It will writ out a json with information about the build, such as region and ami-id with those you can use the aws cli to read any properties of the AMI.

dennis....@immediate.co.uk

unread,
Apr 26, 2018, 9:32:09 AM4/26/18
to Packer
Hi Alvaro, not the var file. I want to use the output after packer runs to do something else. 
To unsubscribe from this group and stop receiving emails from it, send an email to packer-tool...@googlegroups.com.



--
Alvaro

dennis....@immediate.co.uk

unread,
Apr 26, 2018, 9:34:40 AM4/26/18
to Packer
Hi Rickard, yes I want to use the information spat out by packer after it has finished the building the ami.
So you recommend using a post processor script to fetch that information?
To unsubscribe from this group and stop receiving emails from it, send an email to packer-tool...@googlegroups.com.



--
Alvaro

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/packer/issues
IRC: #packer-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to packer-tool...@googlegroups.com.

Rickard von Essen

unread,
Apr 26, 2018, 10:53:44 AM4/26/18
to packe...@googlegroups.com
There is a manifest post-processor which creates a json file with information about the artifacts. With that another script executing in your pipeline get the information you need. 

Reply all
Reply to author
Forward
0 new messages