Can you try adding this to the playbook: gather_facts: false
On Wed, 18 Mar 2020 at 15:19, Hesam Bahmanabadi < [email protected]> wrote: > Thank you for fast reply > > > Passed the var from comman line > > ansible-playbook postgres.yml -e > 'ansible_python_interpreter=/usr/bin/python3' -vvv > > > Error Output: > > fatal: [staging]: FAILED! => { > "ansible_facts": {}, > "changed": false, > "failed_modules": { > "setup": { > "exception": "Traceback (most recent call last):\r\n File > \"/root/.ansible/tmp/ansible-tmp-1584540952.95-42346186184755/AnsiballZ_setup.py\", > line 102, in <module>\r\n _ansiballz_main()\r\n File > \"/root/.ansible/tmp/ansible-tmp-1584540952.95-42346186184755/AnsiballZ_setup.py\", > line 94, in _ansiballz_main\r\n invoke_module(zipped_mod, temp_path, > ANSIBALLZ_PARAMS)\r\n File > \"/root/.ansible/tmp/ansible-tmp-1584540952.95-42346186184755/AnsiballZ_setup.py\", > line 40, in invoke_module\r\n > runpy.run_module(mod_name='ansible.modules.setup', init_globals=None, > run_name='__main__', alter_sys=True)\r\n File > \"/usr/lib/python3.5/runpy.py\", line 196, in run_module\r\n return > _run_module_code(code, init_globals, run_name, mod_spec)\r\n File > \"/usr/lib/python3.5/runpy.py\", line 96, in _run_module_code\r\n > mod_name, mod_spec, pkg_name, script_name)\r\n File > \"/usr/lib/python3.5/runpy.py\", line 85, in _run_code\r\n exec(code, > run_globals)\r\n File > \"/tmp/ansible_setup_payload_kteaw1zg/ansible_setup_payload.zip/ansible/modules/setup.py\", > line 136, in <module>\r\nValueError: attempted relative import beyond > top-level package\r\n", > "failed": true, > "module_stderr": "Shared connection to 138.548.458.6 > closed.\r\n", > "module_stdout": "Traceback (most recent call last):\r\n File > \"/root/.ansible/tmp/ansible-tmp-1584540952.95-42346186184755/AnsiballZ_setup.py\", > line 102, in <module>\r\n _ansiballz_main()\r\n File > \"/root/.ansible/tmp/ansible-tmp-1584540952.95-42346186184755/AnsiballZ_setup.py\", > line 94, in _ansiballz_main\r\n invoke_module(zipped_mod, temp_path, > ANSIBALLZ_PARAMS)\r\n File > \"/root/.ansible/tmp/ansible-tmp-1584540952.95-42346186184755/AnsiballZ_setup.py\", > line 40, in invoke_module\r\n > runpy.run_module(mod_name='ansible.modules.setup', init_globals=None, > run_name='__main__', alter_sys=True)\r\n File > \"/usr/lib/python3.5/runpy.py\", line 196, in run_module\r\n return > _run_module_code(code, init_globals, run_name, mod_spec)\r\n File > \"/usr/lib/python3.5/runpy.py\", line 96, in _run_module_code\r\n > mod_name, mod_spec, pkg_name, script_name)\r\n File > \"/usr/lib/python3.5/runpy.py\", line 85, in _run_code\r\n exec(code, > run_globals)\r\n File > \"/tmp/ansible_setup_payload_kteaw1zg/ansible_setup_payload.zip/ansible/modules/setup.py\", > line 136, in <module>\r\nValueError: attempted relative import beyond > top-level package\r\n", > "msg": "MODULE FAILURE\nSee stdout/stderr for the exact > error", > "rc": 1 > } > }, > "msg": "The following modules failed to execute: setup\n" > } > > PLAY RECAP > *********************************************************************************************************************************************************************************** > support-staging : ok=0 changed=0 unreachable=0 > failed=1 skipped=0 rescued=0 ignored=0 > > > > > > > > > On Wednesday, March 18, 2020 at 10:02:21 AM UTC-4, Stefan Hornburg (Racke) > wrote: >> >> On 3/18/20 2:54 PM, Hesam Bahmanabadi wrote: >> > Hello I am trying to get this working,but getting following error. is >> it from ansible or moudle? >> > >> >> Good question, but try to tell Ansible to use Python 3 on the target: >> >> ansible_python_interpreter: /usr/bin/python3 >> >> Regards >> Racke >> >> > >> > --- >> > - hosts: staging >> > tasks: >> > - name: Collect all info except databases >> > become: yes >> > become_user: postgres >> > postgresql_info: >> > filter: >> > - "!databases" >> > >> > >> > >> > >> > Error OUTPUT >> > fatal: [support-staging]: FAILED! => { >> > "ansible_facts": {}, >> > "changed": false, >> > "failed_modules": { >> > "setup": { >> > "ansible_facts": { >> > "discovered_interpreter_python": "/usr/bin/python" >> > }, >> > "deprecations": [ >> > { >> > "msg": "Distribution Ubuntu 16.04 on host staging >> should use /usr/bin/python3, but is using >> > /usr/bin/python for backward compatibility with prior Ansible releases. >> A future Ansible release will default to using >> > the discovered platform python for this host. See >> > >> https://docs.ansible.com/ansible/2.9/reference_appendices/interpreter_discovery.html >> for more information", >> > "version": "2.12" >> > } >> > ], >> > "exception": "Traceback (most recent call last):\r\n File >> > >> \"/root/.ansible/tmp/ansible-tmp-1584539519.0-58561432581937/AnsiballZ_setup.py\", >> line 102, in <module>\r\n >> > _ansiballz_main()\r\n File >> \"/root/.ansible/tmp/ansible-tmp-1584539519.0-58561432581937/AnsiballZ_setup.py\", >> line 94, >> > in _ansiballz_main\r\n invoke_module(zipped_mod, temp_path, >> ANSIBALLZ_PARAMS)\r\n File >> > >> \"/root/.ansible/tmp/ansible-tmp-1584539519.0-58561432581937/AnsiballZ_setup.py\", >> line 40, in invoke_module\r\n >> > runpy.run_module(mod_name='ansible.modules.setup', init_globals=None, >> run_name='__main__', alter_sys=True)\r\n File >> > \"/usr/lib/python2.7/runpy.py\", line 188, in run_module\r\n fname, >> loader, pkg_name)\r\n File >> > \"/usr/lib/python2.7/runpy.py\", line 82, in _run_module_code\r\n >> mod_name, mod_fname, mod_loader, pkg_name)\r\n >> > File \"/usr/lib/python2.7/runpy.py\", line 72, in _run_code\r\n exec >> code in run_globals\r\n File >> > >> \"/tmp/ansible_setup_payload_Fvldd3/ansible_setup_payload.zip/ansible/modules/setup.py\", >> line 136, in >> > <module>\r\nValueError: Attempted relative import beyond toplevel >> package\r\n", >> > "failed": true, >> > "module_stderr": "Shared connection to 138.197.140.174 >> closed.\r\n", >> > "module_stdout": "Traceback (most recent call last):\r\n >> File >> > >> \"/root/.ansible/tmp/ansible-tmp-1584539519.0-58561432581937/AnsiballZ_setup.py\", >> line 102, in <module>\r\n >> > _ansiballz_main()\r\n File >> \"/root/.ansible/tmp/ansible-tmp-1584539519.0-58561432581937/AnsiballZ_setup.py\", >> line 94, >> > in _ansiballz_main\r\n invoke_module(zipped_mod, temp_path, >> ANSIBALLZ_PARAMS)\r\n File >> > >> \"/root/.ansible/tmp/ansible-tmp-1584539519.0-58561432581937/AnsiballZ_setup.py\", >> line 40, in invoke_module\r\n >> > runpy.run_module(mod_name='ansible.modules.setup', init_globals=None, >> run_name='__main__', alter_sys=True)\r\n File >> > \"/usr/lib/python2.7/runpy.py\", line 188, in run_module\r\n fname, >> loader, pkg_name)\r\n File >> > \"/usr/lib/python2.7/runpy.py\", line 82, in _run_module_code\r\n >> mod_name, mod_fname, mod_loader, pkg_name)\r\n >> > File \"/usr/lib/python2.7/runpy.py\", line 72, in _run_code\r\n exec >> code in run_globals\r\n File >> > >> \"/tmp/ansible_setup_payload_Fvldd3/ansible_setup_payload.zip/ansible/modules/setup.py\", >> line 136, in >> > <module>\r\nValueError: Attempted relative import beyond toplevel >> package\r\n", >> > "msg": "MODULE FAILURE\nSee stdout/stderr for the exact >> error", >> > "rc": 1 >> > } >> > }, >> > "msg": "The following modules failed to execute: setup\n" >> > } >> > >> > PLAY RECAP >> > >> *********************************************************************************************************************************************************************************** >> >> > support-staging : ok=0 changed=0 unreachable=0 >> failed=1 skipped=0 rescued=0 ignored=0 >> > >> > >> > CONFIDENTIALITY STATEMENT. The information contained in this e-mail >> message, including attachments, is the confidential >> > information of, and/or is the property of, Blended Perspectives. The >> information is intended for use solely by the >> > individual or entity named in the message. If you are not an intended >> recipient or you received this in error, then any >> > review, printing, copying, or distribution of any such information is >> prohibited, and please notify the sender >> > immediately by reply e-mail and then delete this e-mail from your >> system. >> > >> > -- >> > 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] <mailto: >> [email protected]>. >> > To view this discussion on the web visit >> > >> https://groups.google.com/d/msgid/ansible-project/a9ef0a51-ea0c-4d7c-a35a-b737d26e7977%40googlegroups.com >> > < >> https://groups.google.com/d/msgid/ansible-project/a9ef0a51-ea0c-4d7c-a35a-b737d26e7977%40googlegroups.com?utm_medium=email&utm_source=footer>. >> >> >> >> -- >> Ecommerce and Linux consulting + Perl and web application programming. >> Debian and Sympa administration. Provisioning with Ansible. >> >> > CONFIDENTIALITY STATEMENT. The information contained in this e-mail > message, including attachments, is the confidential information of, and/or > is the property of, Blended Perspectives. The information is intended for > use solely by the individual or entity named in the message. If you are not > an intended recipient or you received this in error, then any review, > printing, copying, or distribution of any such information is prohibited, > and please notify the sender immediately by reply e-mail and then delete > this e-mail from your system. > > -- > 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 view this discussion on the web visit > https://groups.google.com/d/msgid/ansible-project/47d2835f-9f62-4cbc-9af3-5787099d70d2%40googlegroups.com > <https://groups.google.com/d/msgid/ansible-project/47d2835f-9f62-4cbc-9af3-5787099d70d2%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- Dick Visser Trust & Identity Service Operations Manager GÉANT -- 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 view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAL8fbwPdXOWnxWyC-FzEmUb8LgBKbGcg7Xjv%2BdoBmn%2BdgBaaHw%40mail.gmail.com.
