Hello Everyone, I hope you're doing well.

I used to run ansible normal, everything was working fine, and now I moved 
everything to a virtualenv. I moved the ansible.cfg and changed the 
configuration to adjust to the new paths. I suspect the issue is with the 
past /usr/share/ansible/ , but I did change the path (also the plugin ones) 
to the virtualenv in ansible.cfg:

library  = ~/mine/ve/juniper1/lib/python2.7/site-packages/ansible/ 

action_plugins     = 
~/mine/ve/juniper1/lib/python2.7/site-packages/ansible/plugins/action
callback_plugins   = 
~/mine/ve/juniper1/lib/python2.7/site-packages/ansible/plugins/callback
connection_plugins = 
~/mine/ve/juniper1/lib/python2.7/site-packages/ansible/plugins/connection
lookup_plugins     = 
~/mine/ve/juniper1/lib/python2.7/site-packages/ansible/plugins/lookup
vars_plugins       = 
~/mine/ve/juniper1/lib/python2.7/site-packages/ansible/plugins/vars
filter_plugins     = 
~/mine/ve/juniper1/lib/python2.7/site-packages/ansible/plugins/filter

I have an issue which really doesn't make sense to me and maybe I'm missing 
something. When using ansible for module juniper_junos_jsnapy I get the 
following error (I can run everything on jsnapy as a python module in a 
script, so it's an issue with ansible not jsnapy).

The full traceback is:
Traceback (most recent call last):
  File "/tmp/ansible_05PG1b/ansible_module_juniper_junos_jsnapy.py", line 
399, in <module>
    main()
  File "/tmp/ansible_05PG1b/ansible_module_juniper_junos_jsnapy.py", line 
257, in main
    juniper_junos_common = import_juniper_junos_common()
  File "/tmp/ansible_05PG1b/ansible_module_juniper_junos_jsnapy.py", line 
248, in import_juniper_junos_common
    import juniper_junos_common
  File 
"/home/aarriola/etc/ansible/roles/Juniper.junos/module_utils/juniper_junos_common.py",
 
line 39, in <module>
    from ansible.plugins.action.normal import ActionModule as ActionNormal
ImportError: No module named plugins.action.normal

fatal: [mx960_nap_1]: FAILED! => {
    "changed": false, 
    "module_stderr": "Traceback (most recent call last):\n  File 
\"/tmp/ansible_05PG1b/ansible_module_juniper_junos_jsnapy.py\", line 399, 
in <module>\n    main()\n  File 
\"/tmp/ansible_05PG1b/ansible_module_juniper_junos_jsnapy.py\", line 257, 
in main\n    juniper_junos_common = import_juniper_junos_common()\n  File 
\"/tmp/ansible_05PG1b/ansible_module_juniper_junos_jsnapy.py\", line 248, 
in import_juniper_junos_common\n    import juniper_junos_common\n  File 
\"/home/aarriola/etc/ansible/roles/Juniper.junos/module_utils/juniper_junos_common.py\",
 
line 39, in <module>\n    from ansible.plugins.action.normal import 
ActionModule as ActionNormal\nImportError: No module named 
plugins.action.normal\n", 
    "module_stdout": "", 
    "msg": "MODULE FAILURE", 
    "rc": 0
}

I am able to open python in the same virtualenv and run "from 
ansible.plugins.action.normal import ActionModule as ActionNormal" without 
issues. 
I already made sure that the ansible.cfg file is the one I modified 
properly. And seems ansible is able to use inventory plugin ok:

ansible-playbook 2.4.2.0
  config file = /home/aarriola/.ansible.cfg
  configured module search path = 
[u'/home/aarriola/mine/ve/juniper1/lib/python2.7/site-packages/ansible']
  ansible python module location = 
/home/aarriola/mine/ve/juniper1/local/lib/python2.7/site-packages/ansible
  executable location = /home/aarriola/mine/ve/juniper1/bin/ansible-playbook
  python version = 2.7.3 (default, Oct 26 2016, 21:04:23) [GCC 4.6.3]
Using /home/aarriola/.ansible.cfg as config file
setting up inventory plugins
Parsed /home/aarriola/etc/ansible/hosts inventory source with ini plugin
Loading callback plugin default of type stdout, v2.0 from 
/home/aarriola/mine/ve/juniper1/local/lib/python2.7/site-packages/ansible/plugins/callback/__init__.pyc
Loading callback plugin jsnapy of type aggregate, v2.0 from 
/home/aarriola/mine/ve/juniper1/local/lib/python2.7/site-packages/ansible/plugins/callback/__init__.pyc

Like I mentioned before, jsnapy works fine as a module in a script. I would 
really appreciate any help I can get. 

-- 
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/7cb8c5d3-04b0-485c-97ab-0707a5fe2505%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to