As you can see here my whole set
up: https://groups.google.com/forum/#!topic/packer-tool/WQEXIut-ibI
The issue with this is that i have too many variables (lets say 40) and
packer json would be too crowded.
{
"type": "shell",
"script": "./example.sh",
"environment_vars": [
"AWS_ACCESS_KEY={{user `script_aws_access`}}",
"AWS_SECRET_ACCESS_KEY={{user `script_aws_secret_access`}}",
"VPN_01_PUBLIC_IP={{user `vpn_01_public_ip`}}",
"VPN_01_PRIVATE_IP={{user `vpn_01_private_ip`}}"
5
6
7
8
9
10
etc
],
"pause_before": "10s"
}
Is there a way to hold non sensitive variables in separate file?
I was thinking something like this:
{
"type": "shell",
"script": "./example.sh",
"use_env_var_file": true,
"execute_command": "chmod +x {{ .Path }}; {{ .EnvVarFile }} sudo -E sh '{{
.Path }}'",
"environment_vars": [
"AWS_ACCESS_KEY={{user `script_aws_access`}}",
"AWS_SECRET_ACCESS_KEY={{user `script_aws_secret_access`}}",
"pause_before": "10s"
}
So the point is to use "environment_vars" for AWS keys and other secrets,
and VarFile for other non sensitive values.
1. How this can be achieved?
2 . Where we can set .EnvVarFile variable? How packer knows the path to the
Var file?
3. .Path ( in this case packer knows where is example.sh, right?
--
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/b5497e79-fd28-4d3c-9ce7-2e1dabbc5967%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.