diff options
Diffstat (limited to 'examples/playbooks/rule-jinja-valid.yml')
-rw-r--r-- | examples/playbooks/rule-jinja-valid.yml | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/examples/playbooks/rule-jinja-valid.yml b/examples/playbooks/rule-jinja-valid.yml new file mode 100644 index 0000000..00ce00f --- /dev/null +++ b/examples/playbooks/rule-jinja-valid.yml @@ -0,0 +1,48 @@ +--- +# https://github.com/ansible/ansible-lint/issues/2464 +# https://github.com/ansible/ansible-lint/issues/2462 +# https://github.com/ansible/ansible-lint/issues/2459 +- name: Fixture to test various jinja parsing bugs that we should ignore + hosts: localhost + tasks: + - name: Foo {{ buildset_registry.host | ipwrap }} + ansible.builtin.debug: + msg: "{{ lookup('template', 'lookup/redis_server__env_ports.j2') | from_yaml }}" + loop: "{{ github_release_query.results | subelements('json.assets', {'skip_missing': True}) }}" + - name: Zoo + ansible.builtin.debug: + msg: "{{ lookup('ansible.builtin.ini', 'SOME_VAR', type='properties', file='/tmp/some-file') }}" + + - name: Generate Dovecot main configuration file + ansible.builtin.template: + src: '{{ lookup("template_src", "etc/dovecot/dovecot.conf.j2") }}' + dest: "/etc/dovecot/dovecot.conf" + owner: "root" + group: "dovecot" + mode: "0640" + - name: Bug https://github.com/ansible/ansible-lint/issues/2569 + ansible.builtin.include_tasks: + file: /dev/null + vars: + ns_vars: {} + x: "{{ lookup('ansible.builtin.template', 'namespace.yaml.j2', template_vars=ns_vars) | from_yaml }}" + +# https://github.com/ansible/ansible-lint/issues/2697 +- name: Test linter + hosts: localhost + gather_facts: false + tasks: + - name: Passed linter + ansible.builtin.debug: + msg: "{{ test | to_json }}" + vars: + test: + one: two + param: "{{ ansible_host }}" + - name: Failed linter + ansible.builtin.debug: + msg: "{{ test | to_json }}" + vars: + test: + one: two + param: no jinja |