[ansible-project] Execute the ipaddr filter after installation

2019-05-14 Thread Evgeniy Ivanov
Hi there, 

I've got a problem with the ipaddr filter. It doesn't seem to be loaded 
after installed in the same playbook:

example:

- pip: name=netaddr state=latest

- debug: msg="{{ '192.0.2.0' | ipaddr }}"

gives an error:

TASK [debug] 
>> ***
>
> fatal: [localhost]: FAILED! => {"msg": "The ipaddr filter requires 
>> python-netaddr be installed on the ansible controller"}
>
>
It seems that netaddr  should be in the system before evoking ansible.

Is there any workaround to load the filter in the same playbook?

Thanks!

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/49bc5af7-321a-4e98-8b9f-27ddd45c0e85%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] ipaddr filter doesn't work in virtuelenv

2018-11-27 Thread Evgeniy Ivanov
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] 
> 

[ansible-project] a module to create Keystone endpoints

2016-07-25 Thread Evgeniy Ivanov
I found os_user module and a lot of other OS modules, but I can't find 
almost the most important module to work with Keystone. 
Is there a way to create Keystone endpoints?
Now I'm using shell module and openstack endpoint commands, but it is not a 
good way

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/c015cf0d-bdec-4f6b-aa2b-2e59e5102a4d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.