Project

General

Profile

Review #712

Updated by Pierre-Louis Bonicoli over 3 years ago

"@fix_ipaddr_usage@":https://vcs-git-viewer.duckcorp.org/?p=duckcorp/duckcorp-infra.git;a=log;h=refs/heads/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":https://github.com/ansible/ansible/blob/stable-2.9/lib/ansible/plugins/filter/ipaddr.py 
 - "ansible-collections/ansible.netcommon (@1.1.2@ tag)":https://github.com/ansible-collections/ansible.netcommon/blob/1.1.2/plugins/filter/ipaddr.py 

 Relates: #646

Back