./scripts/packer/myscript.sh:
#!/usr/bin/env bash
aminame=$ami_name
make_an_external_call "$aminame"
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/a88ca74e-0415-4b96-ad5a-340af42f0d36%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
you want to feed there the AMI name of the current running instance?Your script should be able to get this from the metadataAlvaro.
On Wed, Nov 29, 2017 at 9:14 AM, sibi das <sib...@gmail.com> wrote:
Hi,I am running a script in provisioners section, which requires AMI name used by packer. I know the pre-validation of AMI name by packer happens before this stage. Is there any reliable way in which I can get the ami_name inside my script ?My script would go like this:"provisioners": [ { "type": "shell", "execute_command": "sudo {{.Vars}} bash '{{.Path}}'", "scripts": [ "./scripts/packer/myscript.sh" ] } ]./scripts/packer/myscript.sh:
#!/usr/bin/env bash aminame=$ami_name make_an_external_call "$aminame"
--
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/a88ca74e-0415-4b96-ad5a-340af42f0d36%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--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/ffb570a8-9f68-4bcd-8647-40c449dbfe3b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
why not getting it from the metadata in the script ?
On Wed, Nov 29, 2017 at 1:13 PM, sibi das <sib...@gmail.com> wrote:
I need the AMI name of the image being built. The target AMI name or you can say the futuristic value. The same name that we see in packer logs : Prevalidating AMI Name: *****
On Wednesday, November 29, 2017 at 5:20:12 PM UTC+5:30, Alvaro Miranda Aguilera wrote:you want the source ami from where this AMI was created?or you want the current AMI of the running instance ?
--
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/ffb570a8-9f68-4bcd-8647-40c449dbfe3b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--Alvaro