On Monday, July 24, 2017 at 1:16:47 AM UTC-7, Josu Vilda wrote: > > Yes but I expected that, ansible only pay attention to > ansible_python_interpreter = / u sr / bin / python which is what has been > configured. > Why then, you can not administer all kinds of python applications, if you > have to install in all versions what you need ansible. > > Any solution? > > I'm sorry, I still don't understand what you're asking. Perhaps if you could give us a short example playbook and the output you expect from that versus the output you are actually getting it would help to make clear what you need to do.
-Toshio > > El viernes, 21 de julio de 2017, 22:51:25 (UTC+2), Toshio Kuratomi > escribió: >> >> I'm not sure I understand... Are you pointing out the PYTHONHOME >> environment being set? If so, that's not something that ansible sets on >> its own. It seems like you have it set on the remote host or are telling >> ansible to set it inside of a playbook or role. For instance, through the >> environment: paramter to a task. >> >> -Toshio >> >> On Fri, Jul 21, 2017 at 12:35 AM, Josu Vilda <[email protected]> wrote: >> >>> Ansible appears to modify PYTHONPATH internally to vendored versions of >>> some modules. This causes Python scripts executed within playbooks to >>> potentially fail if there are module conflicts. >>> >>> >>> >>> []# ansible-playbook -e "*ansible_python_interpreter=/usr/bin/python*" >>> -vvv test-Sonan3.yml >>> Using /etc/ansible/ansible.cfg as config file >>> >>> PLAYBOOK: test-Sonan3.yml >>> ****************************************************** >>> 1 plays in test-Sonan3.yml >>> >>> PLAY [fac1apprep] >>> ************************************************************** >>> >>> *TASK [setup] >>> ******************************************************************** >>> Using module file >>> /usr/lib/python2.6/site-packages/ansible/modules/core/system/setup.py >>> <9.9.9.9> ESTABLISH SSH CONNECTION FOR USER: arbor >>> <9.9.9.9> SSH: EXEC ssh -o ControlMaster=no -o >>> KbdInteractiveAuthentication=no -o >>> PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey >>> -o PasswordAuthentication=no -o User=arbor -o ConnectTimeout=20 9.9.9.9 >>> '/bin/sh -c '"'"'( umask 77 && mkdir -p "` echo >>> ~/.ansible/tmp/ansible-tmp-1500558765.89-197955274343710 `" && echo >>> ansible-tmp-1500558765.89-197955274343710="` echo >>> ~/.ansible/tmp/ansible-tmp-1500558765.89-197955274343710 `" ) && sleep >>> 0'"'"'' >>> <9.9.9.9> PUT /tmp/tmpuy0cXs TO >>> ~/.ansible/tmp/ansible-tmp-1500558765.89-197955274343710/setup.py >>> <9.9.9.9> SSH: EXEC sftp -b - -o ControlMaster=no -o >>> KbdInteractiveAuthentication=no -o >>> PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey >>> -o PasswordAuthentication=no -o User=arbor -o ConnectTimeout=20 '[9.9.9.9]' >>> <9.9.9.9> ESTABLISH SSH CONNECTION FOR USER: arbor >>> <9.9.9.9> SSH: EXEC ssh -o ControlMaster=no -o >>> KbdInteractiveAuthentication=no -o >>> PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey >>> -o PasswordAuthentication=no -o User=arbor -o ConnectTimeout=20 9.9.9.9 >>> '/bin/sh -c '"'"'chmod u+x >>> '"'"'"'"'"'"'"'"'~/.ansible/tmp/ansible-tmp-1500558765.89-197955274343710/'"'"'"'"'"'"'"'"' >>> >>> '"'"'"'"'"'"'"'"'~/.ansible/tmp/ansible-tmp-1500558765.89-197955274343710/setup.py'"'"'"'"'"'"'"'"' >>> >>> && sleep 0'"'"'' >>> <9.9.9.9> ESTABLISH SSH CONNECTION FOR USER: arbor >>> <9.9.9.9> SSH: EXEC ssh -o ControlMaster=no -o >>> KbdInteractiveAuthentication=no -o >>> PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey >>> -o PasswordAuthentication=no -o User=arbor -o ConnectTimeout=20 -tt 9.9.9.9 >>> '/bin/sh -c '"'"'/usr/bin/python >>> '"'"'"'"'"'"'"'"'~/.ansible/tmp/ansible-tmp-1500558765.89-197955274343710/setup.py'"'"'"'"'"'"'"'"'; >>> >>> rm -rf "~/.ansible/tmp/ansible-tmp-1500558765.89-197955274343710/" > >>> /dev/null 2>&1 && sleep 0'"'"'' >>> ok: [9.9.9.9] >>> >>> *TASK [Incluye variables del fichero minimo como kenan_env] >>> ********************** >>> task path: /etc/ansible/playbooks/test-Sonan3.yml:8 >>> ok: [9.9.9.9] => { >>> "ansible_facts": { >>> "sonan_env3": { >>> "*PYTHONHOME": "/opt2/arbor/Sonan_INT/3P/python*" >>> } >>> }, >>> "changed": false, >>> "invocation": { >>> "module_args": { >>> "file": "/etc/ansible/vars_files/sonan_env3.yml", >>> "name": "sonan_env3" >>> }, >>> "module_name": "include_vars" >>> } >>> } >>> >>> *TASK [comprueba variable] >>> ******************************************************* >>> task path: /etc/ansible/playbooks/test-sonan3.yml:13 >>> [DEPRECATION WARNING]: Using bare variables is deprecated. Update your >>> playbooks so that the environment value uses the >>> full variable syntax ('{{sonan_env3}}'). >>> This feature will be removed in a future release. Deprecation warnings >>> can be >>> disabled by setting deprecation_warnings=False in ansible.cfg. >>> Using module file >>> /usr/lib/python2.6/site-packages/ansible/modules/core/commands/command.py >>> <9.9.9.9> ESTABLISH SSH CONNECTION FOR USER: arbor >>> <9.9.9.9> SSH: EXEC ssh -o ControlMaster=no -o >>> KbdInteractiveAuthentication=no -o >>> PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey >>> -o PasswordAuthentication=no -o User=arbor -o ConnectTimeout=20 9.9.9.9 >>> '/bin/sh -c '"'"'( umask 77 && mkdir -p "` echo >>> ~/.ansible/tmp/ansible-tmp-1500558767.68-174841249651867 `" && echo >>> ansible-tmp-1500558767.68-174841249651867="` echo >>> ~/.ansible/tmp/ansible-tmp-1500558767.68-174841249651867 `" ) && sleep >>> 0'"'"'' >>> <9.9.9.9> PUT /tmp/tmpuy0cXs TO >>> ~/.ansible/tmp/ansible-tmp-1500558767.68-174841249651867/command.py >>> <9.9.9.9> SSH: EXEC sftp -b - -o ControlMaster=no -o >>> KbdInteractiveAuthentication=no -o >>> PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey >>> -o PasswordAuthentication=no -o User=arbor -o ConnectTimeout=20 '[9.9.9.9]' >>> <9.9.9.9> ESTABLISH SSH CONNECTION FOR USER: arbor >>> <9.9.9.9> SSH: EXEC ssh -o ControlMaster=no -o >>> KbdInteractiveAuthentication=no -o >>> PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey >>> -o PasswordAuthentication=no -o User=arbor -o ConnectTimeout=20 9.9.9.9 >>> '/bin/sh -c '"'"'chmod u+x >>> '"'"'"'"'"'"'"'"'~/.ansible/tmp/ansible-tmp-1500558767.68-174841249651867/'"'"'"'"'"'"'"'"' >>> >>> '"'"'"'"'"'"'"'"'~/.ansible/tmp/ansible-tmp-1500558767.68-174841249651867/command.py'"'"'"'"'"'"'"'"' >>> >>> && sleep 0'"'"'' >>> <9.9.9.9> ESTABLISH SSH CONNECTION FOR USER: arbor >>> <9.9.9.9> SSH: EXEC ssh -o ControlMaster=no -o >>> KbdInteractiveAuthentication=no -o >>> PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey >>> -o PasswordAuthentication=no -o User=arbor -o ConnectTimeout=20 -tt 9.9.9.9 >>> '/bin/sh -c '"'"'*PYTHONHOME=/opt2/arbor/SONAN_INT/3P/python >>> /usr/bin/python >>> *'"'"'"'"'"'"'"'"'~/.ansible/tmp/ansible-tmp-1500558767.68-174841249651867/command.py'"'"'"'"'"'"'"'"'; >>> >>> rm -rf "~/.ansible/tmp/ansible-tmp-1500558767.68-174841249651867/" > >>> /dev/null 2>&1 && sleep 0'"'"'' >>> fatal: [9.9.9.9]: FAILED! => { >>> "changed": false, >>> "failed": true, >>> "invocation": { >>> "module_name": "command" >>> }, >>> "module_stderr": "Connection to 9.9.9.9 closed.\r\n", >>> "module_stdout": "*'import site' failed; use -v for >>> traceback\r\nTraceback (most recent call last):\r\n File >>> \"~/.ansible/tmp/ansible-tmp-1500558767.68-174841249651867/command.py\", >>> line 4, in ?\r\n import os\r\nImportError: No module named os\r\n",* >>> "msg": "MODULE FAILURE" >>> } >>> to retry, use: --limit @/etc/ansible/playbooks/test-sonan3.retry >>> >>> PLAY RECAP >>> ********************************************************************* >>> 9.9.9.9 : ok=2 changed=0 unreachable=0 failed=1 >>> >>> -- >>> 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/3fb71b52-e28d-4715-a435-780362f94b48%40googlegroups.com >>> >>> <https://groups.google.com/d/msgid/ansible-project/3fb71b52-e28d-4715-a435-780362f94b48%40googlegroups.com?utm_medium=email&utm_source=footer> >>> . >>> For more options, visit https://groups.google.com/d/optout. >>> >> >> -- 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/05a6a654-d7d6-4142-a058-f545560785aa%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
