Hey Folks,
I've been forwarded to this maillist from the bug tracker. Here is the
problem - https://github.com/ansible/ansible/issues/49139
The filter ipaddr doesn't seem to work properly if installed in the same
playbook:
*Tasks:*
*- pip:state: latestname: netaddr- debug:msg: "{{
'192.168.10.0/24' | ipaddr('-1') }}"Logs:*
> ansible-playbook 2.5.2
> config file = /Users/jack/git/test/ansible.cfg
> configured module search path = [u'/Users/jack/.ansible/plugins/modules',
> u'/usr/share/ansible/plugins/modules']
> ansible python module location =
> /Users/jack/git/test/env/lib/python2.7/site-packages/ansible
> executable location = /Users/jack/git/test/env/bin/ansible-playbook
> python version = 2.7.15 (default, Jul 23 2018, 21:27:06) [GCC 4.2.1
> Compatible Apple LLVM 9.1.0 (clang-902.0.39.2)]
> Using /Users/jack/git/test/ansible.cfg as config file
> setting up inventory plugins
> Set default localhost to localhost
> Parsed /Users/jack/git/test/inventory inventory source with ini plugin
> Loading callback plugin default of type stdout, v2.0 from
> /Users/jack/git/test/env/lib/python2.7/site-packages/ansible/plugins/callback/default.pyc
>
> PLAYBOOK: test.yml
> **
> 1 plays in test.yml
>
> PLAY [localhost]
>
> META: ran handlers
>
> TASK [pip]
> **
> task path: /Users/jack/git/test/test.yml:6
> Using module file
> /Users/jack/git/test/env/lib/python2.7/site-packages/ansible/modules/packaging/language/pip.py
> ESTABLISH LOCAL CONNECTION FOR USER: jack
> EXEC /bin/sh -c 'echo ~ && sleep 0'
> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo
> /Users/jack/.ansible/tmp/ansible-tmp-1543309702.88-83569388017787 `" && echo
> ansible-tmp-1543309702.88-83569388017787="` echo
> /Users/jack/.ansible/tmp/ansible-tmp-1543309702.88-83569388017787 `" ) &&
> sleep 0'
> PUT /Users/jack/.ansible/tmp/ansible-local-81317WNDcgg/tmpCYMmdF
> TO /Users/jack/.ansible/tmp/ansible-tmp-1543309702.88-83569388017787/pip.py
> EXEC /bin/sh -c 'chmod u+x
> /Users/jack/.ansible/tmp/ansible-tmp-1543309702.88-83569388017787/
> /Users/jack/.ansible/tmp/ansible-tmp-1543309702.88-83569388017787/pip.py &&
> sleep 0'
> EXEC /bin/sh -c '/tmp/netaddr/bin/python
> /Users/jack/.ansible/tmp/ansible-tmp-1543309702.88-83569388017787/pip.py &&
> sleep 0'
> EXEC /bin/sh -c 'rm -f -r
> /Users/jack/.ansible/tmp/ansible-tmp-1543309702.88-83569388017787/ >
> /dev/null 2>&1 && sleep 0'
> changed: [localhost] => {
> "changed": true,
> "cmd": "/Users/jack/git/test/env/bin/pip2 install -U netaddr",
> "invocation": {
> "module_args": {
> "chdir": null,
> "editable": false,
> "executable": null,
> "extra_args": null,
> "name": [
> "netaddr"
> ],
> "requirements": null,
> "state": "latest",
> "umask": null,
> "use_mirrors": true,
> "version": null,
> "virtualenv": null,
> "virtualenv_command": "virtualenv",
> "virtualenv_python": null,
> "virtualenv_site_packages": false
> }
> },
> "name": [
> "netaddr"
> ],
> "requirements": null,
> "state": "latest",
> "stderr": "",
> "stderr_lines": [],
> "stdout": "Collecting netaddr\n Using cached
> https://files.pythonhosted.org/packages/ba/97/ce14451a9fd7bdb5a397abf99b24a1a6bb7a1a440b019bebd2e9a0dbec74/netaddr-0.7.19-py2.py3-none-any.whl\nInstalling
> collected packages: netaddr\nSuccessfully installed netaddr-0.7.19\n",
> "stdout_lines": [
> "Collecting netaddr",
> " Using cached
> https://files.pythonhosted.org/packages/ba/97/ce14451a9fd7bdb5a397abf99b24a1a6bb7a1a440b019bebd2e9a0dbec74/netaddr-0.7.19-py2.py3-none-any.whl;,
> "Installing collected packages: netaddr",
> "Successfully installed netaddr-0.7.19"
> ],
> "version": null,
> "virtualenv": null
> }
>
> TASK [debug]
>
> task path: /Users/jack/git/test/test.yml:10
> fatal: [localhost]: FAILED! => {
> "msg": "The ipaddr filter requires python-netaddr be installed on the
> ansible controller"
> }
> ...ignoring
>
> TASK [shell]
>