Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#179 Support multiple var-files #180

Merged
merged 3 commits into from
Jun 20, 2018
Merged

#179 Support multiple var-files #180

merged 3 commits into from
Jun 20, 2018

Conversation

rkettelerij
Copy link
Contributor

Fixes #179

@jrasell
Copy link
Member

jrasell commented May 25, 2018

thanks @rkettelerij for this, I will take a look when I can :)

@jrasell
Copy link
Member

jrasell commented Jun 5, 2018

@rkettelerij do you know what the load order will be when two configs are parsed so I can write in the README about variable file priorities etc?

@rkettelerij
Copy link
Contributor Author

@jrasell the variable files are evaluated in the order in which they are specified on the command line. If a particular variable is defined in more than one variable file, the last value specified is effective. E.g:

1.yaml

foo: 1

2.yaml

foo: 2

myjob.nomad

job "[[.foo]]" {
}
./levant render -var-file=1.yaml -var-file=2.yaml myjob.nomad

Will print:

job "2" {
}

Because 2.yaml is specified as the second -var-file and overwrite the value set by -var-file=1.yaml

This is identical to the way Terraform handles multiple var-files.

@jrasell jrasell self-requested a review June 9, 2018 16:57
@jrasell jrasell merged commit 5e422a6 into hashicorp:master Jun 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants