Project

General

Profile

Review #712

Fix 'ipaddr' Jinja filter usage and avoid a fork

Added by Pierre-Louis Bonicoli about 1 year ago. Updated 11 months ago.

Status:
Resolved
Priority:
Normal
Category:
System :: Base
Start date:
2020-08-28
Branch:
fix_ipaddr_usage

Description

fix_ipaddr_usage branch from duckcorp-infra repository.

Use address parameter with hosts and network parameter with ranges.

ipaddr Jinja filter behavior is quiet unexpected but a fork of this filter isn't required.

Tested with the following play and command:

- hosts: all
tasks:
- debug:
msg: "{{ item ~ ' : ' ~ (item|ipaddr('address') or item|ipaddr('network')) ~ '/' ~ item|ipaddr('netmask') }}"
loop: '{{ firewalling.whitelist }}'
$ ansible-playbook -c local -l Elwing test.yaml

The playbook output is the same with these ipaddr versions:

- the one committed
- ansible/ansible: branch stable-2.9
- ansible-collections/ansible.netcommon

Relates: #646

History

#1

Updated by Pierre-Louis Bonicoli about 1 year ago

  • Description updated (diff)
#2

Updated by Marc Dequènes 11 months ago

  • Status changed from In Progress to Resolved

Sorry it took so long. I think I looked at it but was really tired and did not understand well. I've been a bit off these days but I looked again today. That's really clever and I'm happy to finally remove this fork.

Also available in: Atom PDF