8000 Unrecognized type <<class 'ansible.template.native_helpers.AnsibleUndefined'>> · Issue #4579 · ansible/ansible-lint · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Unrecognized type <<class 'ansible.template.native_helpers.AnsibleUndefined'>> #4579

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

Open
mooky31 opened this issue Apr 10, 2025 · 2 comments
Labels

Comments

@mooky31
Copy link
mooky31 commented Apr 10, 2025
Summary

Exception with ipaddr filter

Issue Type
  • Bug Report
OS / ENVIRONMENT

Ansible EE based on RHEL-ubi9-minimal

ansible-core              2.18.4
ansible-lint              25.2.1
STEPS TO REPRODUCE

Trying to lint {{ item.subnet | ansible.utils.ipaddr('network') }} leads to jinja[invalid]: An unhandled exception occurred while templating '{{ item.subnet | ansible.utils.ipaddr('network') }}'. Error was a <class 'ansible.errors.AnsibleFilterError'>, original message: Unrecognized type <<class 'ansible.template.native_helpers.AnsibleUndefined'>> for ipaddr filter <value>

Desired Behavior

Lint OK since there is no error

Actual Behavior

Playbook:

---
- name: Test lint
  hosts: localhost
  gather_facts: false

  tasks:
    - name: Test lint
      ansible.builtin.debug:
        msg: "{{ ip }}"
      vars:
        ip: "{{ item.subnet | ansible.utils.ipaddr('network') }}"
      loop:
        - name: azerty
          subnet: 1.2.3.4/24

Lint:

jinja[invalid]: An unhandled exception occurred while templating '{{ item.subnet | ansible.utils.ipaddr('network') }}'. Error was a <class 'ansible.errors.AnsibleFilterError'>, original message: Unrecognized type <<class 'ansible.template.native_helpers.AnsibleUndefined'>> for ipaddr filter <value>
play-test_lint.yml:9 Task/Handler: Test lint
@audgirka
Copy link
Contributor

@mooky31 Try using the latest version of ansible-lint and keep us posted

@audgirka audgirka removed the new Triage required label Apr 23, 2025
@mooky31
Copy link
Author
mooky31 commented Apr 23, 2025

25.2.1 is not the latest ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: No status
Development

No branches or pull requests

2 participants
0