Project

General

Profile

Review #712

Fix 'ipaddr' Jinja filter usage and avoid a fork

Added by Pierre-Louis Bonicoli about 1 month ago. Updated about 1 month ago.

Status:
In Progress
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 month ago

  • Description updated (diff)

Also available in: Atom PDF