Skip to content
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

ipaddr('prefix') returns [prefix] instead of just prefix #151

Closed
SRv6d opened this issue Mar 4, 2022 · 2 comments
Closed

ipaddr('prefix') returns [prefix] instead of just prefix #151

SRv6d opened this issue Mar 4, 2022 · 2 comments

Comments

@SRv6d
Copy link

SRv6d commented Mar 4, 2022

SUMMARY

ipaddr('prefix') returns [prefix] instead of just prefix like ansible.netcommon.ipaddr did before the migration.

ISSUE TYPE
  • Bug Report
COMPONENT NAME

ipaddr('prefix')

ANSIBLE VERSION
ansible [core 2.12.3]
  python version = 3.9.10 (main, Jan 15 2022, 11:40:53) [Clang 13.0.0 (clang-1300.0.29.3)]
  jinja version = 3.0.3
  libyaml = True
COLLECTION VERSION

# /Users/.../ansible/.venv-ansible/lib/python3.9/site-packages/ansible_collections
Collection    Version
------------- -------
ansible.utils 2.5.0

# /Users/.../.ansible/collections/ansible_collections
Collection    Version
------------- -------
ansible.utils 2.5.1
CONFIGURATION
DEFAULT_STDOUT_CALLBACK(/Users/.../ansible/ansible.cfg) = yaml
OS / ENVIRONMENT
STEPS TO REPRODUCE
- set_fact:
     ansible_default_ipv4:
       address: "10.10.184.252"
       netmask: "255.255.240.0"

- debug:
    msg: "{{ (ansible_default_ipv4.address + '/' + ansible_default_ipv4.netmask) | ansible.netcommon.ipaddr('prefix') }}"
EXPECTED RESULTS

Result of debug: 20

ACTUAL RESULTS

Result of debug: [20]

@AdamMack2007
Copy link

AdamMack2007 commented Mar 4, 2022

@SRv6d This has been fixed in version 2.5.2 released a few hours ago, issue and Merge Requests can be found here

I had issues similar to this with the "address" filter returning a list as opposed to a string and can confirm that 2.5.2 fixed both issues.

Do note that this has been moved from ansible.netcommon to ansible.utils so your filter reference may need to be updated.

@SRv6d
Copy link
Author

SRv6d commented Mar 4, 2022

Thanks, the latest release does fix it. Closing the issue.

@SRv6d SRv6d closed this as completed Mar 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants