if i give os.path.dirname(os.path.abspath(os.path.realpath(ansible.file))) command in python terminal will give me “/usr/lib/python2.7/site-packages/ansible”
but if same command i write in own ansible python module. it give this path :- /tmp/ansible_29S4ql/ansible_modlib.zip/ansible
Issue is that, I want to get /usr/lib/python2.7/site-packages/ansible path. if i mention in ansible python module code this line os.path.dirname(os.path.abspath(os.path.realpath(ansible.file))).
It’s not giving me actual path but it’s giving me /tmp/* path example ( /tmp/ansible_29S4ql/ansible_modlib.zip/ansible )
how can i achieve so that i can get /usr/lib/python2.7/site-packages/ansible path dynamically depend on python 2.7 or python 3* version.