No, unless you check for a specific aws tag, the username etc. On Mar 29, 2017 2:42 PM, "Michael Seiwald" <[email protected]> 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 March 2017 at 14:33, Rickard von Essen <[email protected]> > wrote: > >> 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.ht >> ml#scripts-per-instance >> >> On 29 March 2017 at 13:55, Michael Seiwald <[email protected] >> m> wrote: >> >>> 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 /var/lib/cloud/scripts/per-once. Is there a way for me to determine >>> inside the script if the instance was launched by packer? I was thinking >>> about checking the Name tag on the instance for "Packer builder" but that >>> can be overwritten. Is there an elegant way to solve this? >>> >>> Thanks, >>> Michael >>> >>> >>> Geschäftsführer: Pontus Noren, James Monico >>> Sitz der Gesellschaft: München >>> Amtsgericht München - HRB 212683 - USt-IdNr.: DE296631220 >>> >>> >>> The above terms reflect a potential business arrangement, are provided >>> solely as a basis for further discussion, >>> and are not intended to be and do not constitute a legally binding >>> obligation. No legally binding obligations >>> will be created, implied, or inferred until an agreement in final form >>> is executed in writing by all parties involved. >>> >>> This email may be confidential or privileged. If you received this >>> communication by mistake, please don't forward >>> it to anyone else, please erase all copies and attachments, and please >>> let us know that it has gone to the wrong person. >>> >>> -- >>> 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 [email protected]. >>> To view this discussion on the web visit https://groups.google.com/d/ms >>> gid/packer-tool/425c66f4-368e-430a-b669-63139d29d75b%40googlegroups.com >>> <https://groups.google.com/d/msgid/packer-tool/425c66f4-368e-430a-b669-63139d29d75b%40googlegroups.com?utm_medium=email&utm_source=footer> >>> . >>> For more options, visit https://groups.google.com/d/optout. >>> >> >> -- >> 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 a topic in the >> Google Groups "Packer" group. >> To unsubscribe from this topic, visit https://groups.google.com/d/to >> pic/packer-tool/m3kkVteqvj8/unsubscribe. >> To unsubscribe from this group and all its topics, send an email to >> [email protected]. >> To view this discussion on the web visit https://groups.google.com/d/ms >> gid/packer-tool/CALz9Rt9fqdqT9BA64d-0vCBPT8x13XrHLAY%3DkbHrz >> 1rcuZQYbg%40mail.gmail.com >> <https://groups.google.com/d/msgid/packer-tool/CALz9Rt9fqdqT9BA64d-0vCBPT8x13XrHLAY%3DkbHrz1rcuZQYbg%40mail.gmail.com?utm_medium=email&utm_source=footer> >> . >> >> For more options, visit https://groups.google.com/d/optout. >> > > > > -- > *Michael Seiwald* > Cloud Systems Developer > > > > Mobil: ++4915161148511 <+49%201516%201148511> > Büro: +49 89 381 535920 <+49%2089%20381535920> (x3408) > > [email protected] > > Intelligent Cloud Adoption. <http://goo.gl/YjdhZv> > > Cloudreach GmbH > Landsbergerstr. 300 > 80687 München > Deutschland > > www.cloudreach.de > > > Geschäftsführer: Pontus Noren, James Monico > Sitz der Gesellschaft: München > Amtsgericht München - HRB 212683 - USt-IdNr.: DE296631220 > > > The above terms reflect a potential business arrangement, are provided > solely as a basis for further discussion, > and are not intended to be and do not constitute a legally binding > obligation. No legally binding obligations > will be created, implied, or inferred until an agreement in final form is > executed in writing by all parties involved. > > This email may be confidential or privileged. If you received this > communication by mistake, please don't forward > it to anyone else, please erase all copies and attachments, and please let > us know that it has gone to the wrong person. > > -- > 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 [email protected]. > To view this discussion on the web visit https://groups.google.com/d/ > msgid/packer-tool/CACNFMFY2L4CAY8JtDVCjqzc-BTSRZQrDf%2B9JUm% > 2BvHwrtNLs1WQ%40mail.gmail.com > <https://groups.google.com/d/msgid/packer-tool/CACNFMFY2L4CAY8JtDVCjqzc-BTSRZQrDf%2B9JUm%2BvHwrtNLs1WQ%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/CALz9Rt_ZcjjZG%3DHecVfsT%2Bg2igmMn0Fpb%2Bamp_ez0yAOya6F0Q%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
