Re: [packer] Find out if run through packer in cloudinit script

2017-04-02 Thread Rickard von Essen
Just to be clear PACKER_BUILD_NAME and PACKER_BUILDER_TYPE won't be set in a cloud-init script. That only works for Packer provisioners. // Rickard On 2 April 2017 at 13:17, Alvaro Miranda Aguilera wrote: > you can update your script to skip when packer variables are set: >

Re: [packer] Find out if run through packer in cloudinit script

2017-04-02 Thread Alvaro Miranda Aguilera
you can update your script to skip when packer variables are set: https://www.packer.io/docs/provisioners/shell.html - PACKER_BUILD_NAME is set to the name of the build that Packer is running. This is most

Re: [packer] Find out if run through packer in cloudinit script

2017-03-29 Thread Rickard von Essen
No, unless you check for a specific aws tag, the username etc. On Mar 29, 2017 2:42 PM, "Michael Seiwald" wrote: > Thanks, I didn't know about per-instance. But still is there a way to make > the script not run at all when launched by packer? > > Cheers > > On 29

Re: [packer] Find out if run through packer in cloudinit script

2017-03-29 Thread Michael Seiwald
Thanks, I didn't know about per-instance. But still is there a way to make the script not run at all when launched by packer? Cheers On 29 March 2017 at 14:33, Rickard von Essen wrote: > Just put it in per-instance, then cloud-init will see to that it runes > once

Re: [packer] Find out if run through packer in cloudinit script

2017-03-29 Thread Rickard von Essen
Just put it in per-instance, then cloud-init will see to that it runes once per instance. https://cloudinit.readthedocs.io/en/latest/topics/modules.html#scripts-per-instance On 29 March 2017 at 13:55, Michael Seiwald wrote: > Hello, > > I'm building an AMI that

[packer] Find out if run through packer in cloudinit script

2017-03-29 Thread Michael Seiwald
Hello, I'm building an AMI that already includes a script that is supposed to be run on the first launch of the instance. My problem now is when someone wants to build a "child" AMI off of that AMI using my AMI as source_ami then my script will of course already run. I'm placing the script in