Thank you for your reply. The issue is resolved now, issue was in the group vars. I able to execute playbooks on Network,Linux,Windows using a jumpserver.
On Friday, September 11, 2020 at 11:43:51 AM UTC+5:30 [email protected] wrote: > Can you paste the error again. Your inventory file show a different python > interpreter than is currently in the error. > With the 'linux' host you do not use delegate_to. If you would do this for > the linux host you might get the same type of error but this will be better > to troubleshoot. > > From the error it looks like you're loading the wrong python libraries. > > Op maandag 27 juli 2020 om 06:44:13 UTC+2 schreef [email protected]: > >> Can someone help? >> >> >> On Friday, July 24, 2020 at 2:37:05 PM UTC+5:30, sajal tiwari wrote: >>> >>> My bad, below is the linux playbook which is working fine using the same >>> jumpserver. >>> --- >>> - hosts: test >>> gather_facts: no >>> become: yes >>> #become_method: "sudo" >>> >>> tasks: >>> - name: Create file >>> file: >>> path: /tmp/test >>> state: touch >>> >>> Host file entry >>> TestA ansible_connection=ssh ansible_ssh_user=root ansible_ssh_pass=**** >>> ansible_ssh_common_args='-o ProxyCommand="sshpass -p '****' ssh -W >>> %h:%p -q root@**** >>> >>> >>> >>> On Friday, July 24, 2020 at 4:55:47 AM UTC+5:30, Dick Visser wrote: >>>> >>>> You only posted one playbook initially, Which I think is the "asa >>>> playbook". But now you mention a second "linux playbook". >>>> What does that look like? Is it very similar? >>>> >>>> Logically, if one playbook "doesn't work", and a different one does, >>>> then you've not proven much. >>>> >>>> But instead of going over all permutations of the available snippets of >>>> information and guess what you mean, it's best if you provide all the >>>> information. >>>> >>>> >>>> >>>> On Thu, 23 Jul 2020 at 20:12, sajal tiwari <[email protected]> wrote: >>>> >>>>> No the jumpserver is same only difference is playbook is linux >>>>> playbook is working but asa playbook is not working. >>>>> >>>>> On Thursday, July 23, 2020 at 10:35:31 PM UTC+5:30, Dick Visser wrote: >>>>>> >>>>>> So the only difference is the jumphost? >>>>>> Ie it works with one jumphost and it doesn't with another? >>>>>> >>>>>> On Thu, 23 Jul 2020 at 18:18, sajal tiwari <[email protected]> >>>>>> wrote: >>>>>> >>>>> Hello, >>>>>>> I am executing a simple ansible playbook using asa_config module on >>>>>>> a ASA via a Centos Jumpserver but i am getting below error. >>>>>>> >>>>>>> The full traceback is: >>>>>>> Traceback (most recent call last): >>>>>>> File >>>>>>> "/root/.ansible/tmp/ansible-tmp-1595520658.91-31174-97593380815349/AnsiballZ_asa_config.py" >>>>>>> , line 102, in <module> >>>>>>> _ansiballz_main() >>>>>>> File >>>>>>> "/root/.ansible/tmp/ansible-tmp-1595520658.91-31174-97593380815349/AnsiballZ_asa_config.py" >>>>>>> , line 94, in _ansiballz_main >>>>>>> invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS) >>>>>>> File >>>>>>> "/root/.ansible/tmp/ansible-tmp-1595520658.91-31174-97593380815349/AnsiballZ_asa_config.py" >>>>>>> , line 40, in invoke_module >>>>>>> runpy.run_module(mod_name= >>>>>>> 'ansible.modules.network.asa.asa_config', init_globals=None, >>>>>>> run_name='__main__', alter_sys=True) >>>>>>> File "/usr/lib64/python2.7/runpy.py", line 176, in run_module >>>>>>> fname, loader, pkg_name) >>>>>>> File "/usr/lib64/python2.7/runpy.py", line 82, in _run_module_code >>>>>>> mod_name, mod_fname, mod_loader, pkg_name) >>>>>>> File "/usr/lib64/python2.7/runpy.py", line 72, in _run_code >>>>>>> exec code in run_globals >>>>>>> File >>>>>>> "/tmp/ansible_asa_config_payload_AAC3E0/ansible_asa_config_payload.zip/ansible/modules/network/asa/asa_config.py" >>>>>>> , line 371, in <module> >>>>>>> File >>>>>>> "/tmp/ansible_asa_config_payload_AAC3E0/ansible_asa_config_payload.zip/ansible/modules/network/asa/asa_config.py" >>>>>>> , line 365, in main >>>>>>> File >>>>>>> "/tmp/ansible_asa_config_payload_AAC3E0/ansible_asa_config_payload.zip/ansible/modules/network/asa/asa_config.py" >>>>>>> , line 281, in run >>>>>>> File >>>>>>> "/tmp/ansible_asa_config_payload_AAC3E0/ansible_asa_config_payload.zip/ansible/module_utils/network/asa/asa.py" >>>>>>> , line 146, in get_config >>>>>>> File >>>>>>> "/tmp/ansible_asa_config_payload_AAC3E0/ansible_asa_config_payload.zip/ansible/module_utils/network/asa/asa.py" >>>>>>> , line 87, in get_connection >>>>>>> File >>>>>>> "/tmp/ansible_asa_config_payload_AAC3E0/ansible_asa_config_payload.zip/ansible/module_utils/connection.py" >>>>>>> , line 121, in __init__ >>>>>>> AssertionError: socket_path must be a value >>>>>>> fatal: [172.22.105.11 -> 172.22.110.194]: FAILED! => { >>>>>>> "ansible_facts": { >>>>>>> "discovered_interpreter_python": "/usr/bin/python" >>>>>>> }, >>>>>>> "changed": false, >>>>>>> "module_stderr": "Shared connection to 172.22.110.194 >>>>>>> closed.\r\n", >>>>>>> "module_stdout": "Traceback (most recent call last):\r\n File >>>>>>> \"/root/.ansible/tmp/ansible-tmp-1595520658.91-31174-97593380815349/AnsiballZ_asa_config.py\", >>>>>>> >>>>>>> line 102, in <module>\r\n _ansiballz_main()\r\n File >>>>>>> \"/root/.ansible/tmp/ansible-tmp-1595520658.91-31174-97593380815349/AnsiballZ_asa_config.py\", >>>>>>> >>>>>>> line 94, in _ansiballz_main\r\n invoke_module(zipped_mod, temp_path, >>>>>>> ANSIBALLZ_PARAMS)\r\n File >>>>>>> \"/root/.ansible/tmp/ansible-tmp-1595520658.91-31174-97593380815349/AnsiballZ_asa_config.py\", >>>>>>> >>>>>>> line 40, in invoke_module\r\n >>>>>>> runpy.run_module(mod_name='ansible.modules.network.asa.asa_config', >>>>>>> init_globals=None, run_name='__main__', alter_sys=True)\r\n File >>>>>>> \"/usr/lib64/python2.7/runpy.py\", line 176, in run_module\r\n >>>>>>> fname, >>>>>>> loader, pkg_name)\r\n File \"/usr/lib64/python2.7/runpy.py\", line 82, >>>>>>> in >>>>>>> _run_module_code\r\n mod_name, mod_fname, mod_loader, pkg_name)\r\n >>>>>>> File \"/usr/lib64/python2.7/runpy.py\", line 72, in _run_code\r\n >>>>>>> exec >>>>>>> code in run_globals\r\n File >>>>>>> \"/tmp/ansible_asa_config_payload_AAC3E0/ansible_asa_config_payload.zip/ansible/modules/network/asa/asa_config.py\", >>>>>>> >>>>>>> line 371, in <module>\r\n File >>>>>>> \"/tmp/ansible_asa_config_payload_AAC3E0/ansible_asa_config_payload.zip/ansible/modules/network/asa/asa_config.py\", >>>>>>> >>>>>>> line 365, in main\r\n File >>>>>>> \"/tmp/ansible_asa_config_payload_AAC3E0/ansible_asa_config_payload.zip/ansible/modules/network/asa/asa_config.py\", >>>>>>> >>>>>>> line 281, in run\r\n File >>>>>>> \"/tmp/ansible_asa_config_payload_AAC3E0/ansible_asa_config_payload.zip/ansible/module_utils/network/asa/asa.py\", >>>>>>> >>>>>>> line 146, in get_config\r\n File >>>>>>> \"/tmp/ansible_asa_config_payload_AAC3E0/ansible_asa_config_payload.zip/ansible/module_utils/network/asa/asa.py\", >>>>>>> >>>>>>> line 87, in get_connection\r\n File >>>>>>> \"/tmp/ansible_asa_config_payload_AAC3E0/ansible_asa_config_payload.zip/ansible/module_utils/connection.py\", >>>>>>> >>>>>>> line 121, in __init__\r\nAssertionError: socket_path must be a >>>>>>> value\r\n" >>>>>>> , >>>>>>> "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", >>>>>>> "rc": 1 >>>>>>> >>>>>>> If i execute a simple copy playbook on another linux server using >>>>>>> Jumpserver it is working fine. >>>>>>> Can someone help in resolving it, tried multiple things but nothing >>>>>>> is working. >>>>>>> >>>>>>> [asa] >>>>>>> *.*.*.* >>>>>>> >>>>>>> [asa:vars] >>>>>>> ansible_user=***** >>>>>>> ansible_password=****** >>>>>>> ansible_auth_pass=***** >>>>>>> ansible_python_interpreter=/usr/bin/python3 >>>>>>> #ansible_python_interpreter=/usr/bin/python2.7 >>>>>>> ansible_network_os=asa >>>>>>> ansible_connection=network_cli >>>>>>> ansible_ssh_common_args='-o ProxyCommand="sshpass -p '*******' ssh >>>>>>> -W %h:%p -q root@*.*.*.*"' >>>>>>> >>>>>>> Playbook: >>>>>>> >>>>>>> --- >>>>>>> - name: ASA User Create >>>>>>> hosts: asa >>>>>>> gather_facts: yes >>>>>>> >>>>>>> tasks: >>>>>>> >>>>>>> - name: ASA Local User Creation >>>>>>> asa_config: >>>>>>> lines: >>>>>>> - username {{ local_user_name }} password {{ >>>>>>> local_user_password }} privilege {{ privilege_level }} >>>>>>> provider: >>>>>>> host: "{{ asa_ip }}" >>>>>>> username: "{{ username }}" >>>>>>> password: "{{ password }}" >>>>>>> authorize: yes >>>>>>> auth_pass: "{{ enable_password }}" >>>>>>> save: yes >>>>>>> delegate_to: JumpserverIP >>>>>>> >>>>>>> ansible-playbook user.yaml --extra-vars "asa_ip=*.*.*.* >>>>>>> username=*** password=**** enable_password=**** local_user_name=*** >>>>>>> local_user_password=**** privilege_level=10" >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> Thanks in advance. >>>>>>> >>>>>>> -- >>>>>>> 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/a2fb15c7-1564-4d3f-881f-9bb8f84d3f8fo%40googlegroups.com >>>>>>> >>>>>>> <https://groups.google.com/d/msgid/ansible-project/a2fb15c7-1564-4d3f-881f-9bb8f84d3f8fo%40googlegroups.com?utm_medium=email&utm_source=footer> >>>>>>> . >>>>>>> >>>>>> -- >>>>>> Sent from a mobile device - please excuse the brevity, spelling and >>>>>> punctuation. >>>>>> >>>>> -- >>>>> 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/013bfe72-7c60-4bca-9235-a7dfe58e2e16o%40googlegroups.com >>>>> >>>>> <https://groups.google.com/d/msgid/ansible-project/013bfe72-7c60-4bca-9235-a7dfe58e2e16o%40googlegroups.com?utm_medium=email&utm_source=footer> >>>>> . >>>>> >>>> -- >>>> Sent from a mobile device - please excuse the brevity, spelling and >>>> punctuation. >>>> >>> -- 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/d827adad-11bb-400f-8783-1488b4d1bfbdn%40googlegroups.com.
