Template variables that are set to environment variable values, how to validate?

15 views
Skip to first unread message

Justin Metz

unread,
Oct 19, 2018, 3:36:12 PM10/19/18
to Packer
Hi All,

I was wondering if there was any way to have packer fail variable validation if an environment variable it is assigned to does not exist?  I recently figured out that explicitly setting the template value to null will set off the validation if the variable is not set, but the environment variable based ones do not seem to do the same thing.  What I am trying to prevent is a variable not getting set due to the fact an environment variable was forgotten about, which produces fairly significant effects downstream...  If not, are there any plans to make this configurable in the future?

Thanks in advance..

J




 

Justin Metz

unread,
Oct 19, 2018, 3:50:17 PM10/19/18
to Packer

One of the main drivers for wanting to do this is to be able to feed variable values into templates without the need for a static file (-var-file) or building the command string with variable values (-var).




 
Reply all
Reply to author
Forward
0 new messages