Project

General

Profile

Actions

Review #712

closed

Fix 'ipaddr' Jinja filter usage and avoid a fork

Added by Pierre-Louis Bonicoli over 3 years ago. Updated over 3 years 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

Actions #1

Updated by Pierre-Louis Bonicoli over 3 years ago

  • Description updated (diff)
Actions #2

Updated by Marc Dequènes over 3 years 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.

Actions

Also available in: Atom PDF