diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-26 06:24:57 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-26 06:24:57 +0000 |
commit | 6321bd49c49eb2bb436cf7fb4842c4c424198de7 (patch) | |
tree | f34b66b4551dfe468bbcb29d0dcec5384556543b /examples/playbooks/transform-jinja.yml | |
parent | Adding debian version 6.17.2-3. (diff) | |
download | ansible-lint-6321bd49c49eb2bb436cf7fb4842c4c424198de7.tar.xz ansible-lint-6321bd49c49eb2bb436cf7fb4842c4c424198de7.zip |
Merging upstream version 24.6.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'examples/playbooks/transform-jinja.yml')
-rw-r--r-- | examples/playbooks/transform-jinja.yml | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/examples/playbooks/transform-jinja.yml b/examples/playbooks/transform-jinja.yml new file mode 100644 index 0000000..4a4cd32 --- /dev/null +++ b/examples/playbooks/transform-jinja.yml @@ -0,0 +1,40 @@ +--- +- name: Fixture + hosts: localhost + vars: + my_list: + - foo + - bar + tasks: + - name: A block used to check that we do not identify error at correct level + block: + - name: Foo # <-- this is valid jinja2 + ansible.builtin.debug: + foo: "{{ 1 }}" # <-- jinja2[spacing] + msg: "{{ 'a' b }}" # <-- jinja2[invalid] + + - name: A block used to check that we do not identify error at correct level + block: + - name: Foo # <-- this is valid jinja2 + ansible.builtin.debug: + msg: "{{ item }}" # <-- jinja2[spacing] + with_items: + - "{{ items }}" + + - name: Confirm a deeply nested duplicate error is corrected + ansible.builtin.set_fact: + fact: + dict: + dict: + list: + - one + - two + - dict: + fix: "{{'VALUE_1'|lower}}" # <-- jinja2[spacing] + - dict: + fix: "{{'VALUE_1'|lower}}" # <-- jinja2[spacing] + - dict: + fix: "{{'VALUE_2'|lower}}" # <-- jinja2[spacing] + +# It should be noted that even ansible --syntax-check fails to spot the jinja +# error above, but ansible will throw a runtime error when running |