Created
July 15, 2022 09:47
-
-
Save mkrizek/974ac736ea78b9bb4cddb62c376113ef to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
terraform { | |
required_providers { | |
{{ tf_provider['name'] }} = { | |
source = "{{ tf_provider['source'] }}" | |
version = "{{ tf_provider['version'] }}" | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- hosts: localhost | |
gather_facts: false | |
tasks: | |
- template: | |
src: test.j2 | |
dest: out | |
vars: | |
tf_provider: | |
name: "null" | |
source: "hashicorp/null" | |
version: ">=2.0.0, < 3.0.0" |
Or simply use this template:
{{ a.name }}
and this playbook:
- hosts: localhost
gather_facts: false
tasks:
- template:
src: test.j2
dest: out
vars:
a: "{{ b }}"
b:
name: foo
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you replace lines 8-11 of test.yml by:
then it also crashes.