Skip to content

Commit

Permalink
Avoid 'Unrecognized type' errors with jinja rule (#3149)
Browse files Browse the repository at this point in the history
  • Loading branch information
ssbarnea authored Mar 7, 2023
1 parent cef6c1e commit dae8941
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions .config/dictionary.txt
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ importlib
iniconfig
inlinehilite
insertafter
ipaddr
ipwrap
isclass
iscsi
Expand Down
8 changes: 6 additions & 2 deletions examples/playbooks/rule-jinja-pass.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,17 @@
a_var:
- one

- name: Bug https://github.com/ansible/ansible-lint/issues/3082
- name: Bugs
hosts: localhost
tasks:
- name: Use with_items to populate a file
- name: Bug https://github.com/ansible/ansible-lint/issues/3082
ansible.builtin.copy:
content: "{{ item.cfg | to_nice_yaml(indent=2, width=9999) }}"
dest: "/tmp/{{ item.name }}.yaml"
mode: "0640"
with_items:
- name: file2

- name: Bug https://github.com/ansible/ansible-lint/issues/3136
ansible.builtin.debug:
msg: "IP is {{ foo | ansible.utils.ipaddr('address') }}"
1 change: 1 addition & 0 deletions src/ansiblelint/rules/jinja.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
r"^Error in (.*)is undefined$",
r"^Mandatory variable (.*) not defined.$",
r"is undefined",
r"Unrecognized type <<class 'ansible.template.AnsibleUndefined'>> for (.*) filter <value>$",
]
),
flags=re.MULTILINE | re.DOTALL,
Expand Down

0 comments on commit dae8941

Please sign in to comment.