+
Skip to content

ansible.utils.ipaddr('host/prefix') should not parse non CIDR IP. #372

@ijajmulani

Description

@ijajmulani
SUMMARY
ISSUE TYPE
  • Bug Report
COMPONENT NAME
ANSIBLE VERSION
ansible [core 2.16.3]
  config file = /opt/IMAppliance/ansible/ansible.cfg
  configured module search path = ['/opt/IMAppliance/ansible/library', '/opt/ansible/library']
  ansible python module location = /usr/lib/python3.12/site-packages/ansible
  ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections
  executable location = /bin/ansible
  python version = 3.12.3 (main, Jun 19 2024, 10:06:03) [GCC 8.5.0 20210514 (Red Hat 8.5.0-22)] (/usr/bin/python3.12)
  jinja version = 3.1.2
  libyaml = True

COLLECTION VERSION
# /usr/share/ansible/collections/ansible_collections
Collection    Version
------------- -------
ansible.utils 5.0.0
OS / ENVIRONMENT

RHEL 8.10

STEPS TO REPRODUCE
ansible -i localhost, all -m debug -a "msg={{ '203.0.113.23' | ansible.utils.ipaddr('host/prefix') }}" 
EXPECTED RESULTS
localhost | SUCCESS => {
    "msg": ""
}
ACTUAL RESULTS
<!--- Describe what actually happened. If possible run with extra verbosity (-vvvv) -->
localhost | SUCCESS => {
    "msg": "203.0.113.23/32"
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    has_prThis issue has an associated PR.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载