is there a DryRun or skip-ami option available without creating an ami ?

46 views
Skip to first unread message

raje...@qubole.com

unread,
Feb 12, 2019, 12:47:46 AM2/12/19
to Packer
Hi All,

My use case is we bake an AMI only a couple of times a month. 
While baking we install a whole lot of system level packages/python packages etc ... and goes on.

Since we depend on a lot of open source packages, due to some issues like mirrors down/required version of package not available/package has updated version, some dependencies will break and thus ami creation fails.  

This slows down our release process. Tto resolve this we just want to un the baking process and install all dependencies on an ec2 machine and verify nothing is breaking.
We want to do this daily as a CI process without creating an ami.  As creating ami 's daily sums up to a huge cost on aws.

so is there a way I can run packer and install all dependencies but without creating an AMI?

I googled a bit and got to know that a similar request was made by several people to have skip-ami option, but it was not approved and the feature is still not available.


Just want to know if there is any option available to skip ami creation or is there any other way  that i can try to skip ami creation.

Any help is greatly appreciated.

Thanks!
Raj




Rickard von Essen

unread,
Feb 12, 2019, 1:29:16 AM2/12/19
to packe...@googlegroups.com
No it's not, and if you really want test the build you have to launch an instance and test on that. It's easy to wrap the packer build with some clean up script. It's not the creation of the AMI's that costs, it's keeping them.

If you still don't want to create an AMI I recommend that you as the last step creates a file with shell-local and then exits with an error. If that file exists the build was successful otherwise not. 

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/093bc189-a14c-49ba-b7cd-ad77a362dc74%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

raje...@qubole.com

unread,
Feb 12, 2019, 11:34:39 PM2/12/19
to Packer
Thanks for the reply!!
is there a way we can restrict the IAM role not to have permission to create an ami attached to the build server(where packer command is executed), which will then fail to create an ami.

should the IAM role(without ami creation permission) be attached to build server or packer builder node? 
we tried attaching to the build server, but still it went to create an ami. Not sure how ? 

Thanks!
Rajendra

Rickard von Essen

unread,
Feb 13, 2019, 1:13:57 AM2/13/19
to packe...@googlegroups.com
Yes if you remove ec2:CreateImage (or Deny it) the build will fail in the end. If it doesn't do that you are running with different credentials than you think. 

raje...@qubole.com

unread,
Feb 13, 2019, 3:40:23 AM2/13/19
to Packer
I am also trying with the shell-local, which I feel is cleaner way to doit. 
But i am getting an error as below 

1550046805,,ui,error,1 error(s) occurred:\n\n* unknown configuration key: "inline"

in my packer config.json i have added this snippet , is shell-local not supported in packer version 1.0.0
{
"type": "shell-local",
"inline": ["echo foo"]
}

Rickard von Essen

unread,
Feb 13, 2019, 10:45:08 AM2/13/19
to packe...@googlegroups.com
Please try the latest version instead. 

Rajendra Kumar

unread,
Feb 13, 2019, 11:38:12 PM2/13/19
to packe...@googlegroups.com
Thank you !!


For more options, visit https://groups.google.com/d/optout.


--
Thanks!
Raj
Reply all
Reply to author
Forward
0 new messages