# Error while running ansible

**URL:** <https://community.f5.com/t/error-while-running-ansible/74422>\
**Category:** Technical Forums\
**Tags:** devops, error, ansible\
**Created:** [April 26, 2024, 5:55am UTC](https://community.f5.com/t/error-while-running-ansible/74422 "2024-04-26T05:55:10Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![pranay48](https://avatars.discourse-cdn.com/v4/letter/p/e47c2d/32.png) [@pranay48](https://community.f5.com/u/pranay48)\
**Post date:** [April 26, 2024, 5:55am UTC](https://community.f5.com/t/error-while-running-ansible/74422/1 "2024-04-26T05:55:10Z")

</div>

I am getting the following error when I am trying to run ansible script on f5 instance through jumphost

The full traceback is:  
Traceback (most recent call last):  
&nbsp; File “/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/urllib/request.py”, line 1344, in do\_open  
&nbsp; &nbsp; h.request(req.get\_method(), req.selector, req.data, headers,  
&nbsp; File “/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/http/client.py”, line 1336, in request  
&nbsp; &nbsp; self.\_send\_request(method, url, body, headers, encode\_chunked)  
&nbsp; File “/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/http/client.py”, line 1382, in \_send\_request  
&nbsp; &nbsp; self.endheaders(body, encode\_chunked=encode\_chunked)  
&nbsp; File “/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/http/client.py”, line 1331, in endheaders  
&nbsp; &nbsp; self.\_send\_output(message\_body, encode\_chunked=encode\_chunked)  
&nbsp; File “/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/http/client.py”, line 1091, in \_send\_output  
&nbsp; &nbsp; self.send(msg)  
&nbsp; File “/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/http/client.py”, line 1035, in send  
&nbsp; &nbsp; self.connect()  
&nbsp; File “/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/http/client.py”, line 1477, in connect  
&nbsp; &nbsp; self.sock = self.\_context.wrap\_socket(self.sock,  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  
&nbsp; File “/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/ssl.py”, line 455, in wrap\_socket  
&nbsp; &nbsp; return self.sslsocket\_class.\_create(  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  
&nbsp; File “/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/ssl.py”, line 1042, in \_create  
&nbsp; &nbsp; self.do\_handshake()  
&nbsp; File “/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/ssl.py”, line 1320, in do\_handshake  
&nbsp; &nbsp; self.\_sslobj.do\_handshake()  
ssl.SSLError: [SSL: WRONG\_VERSION\_NUMBER] wrong version number (\_ssl.c:1000)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):  
&nbsp; File “/Users/pranaychowd.pinapaka/.ansible/tmp/ansible-tmp-1714109490.0885582-73185-193526554178977/AnsiballZ\_bigip\_command.py”, line 107, in \<module\>  
&nbsp; &nbsp; \_ansiballz\_main()  
&nbsp; File “/Users/pranaychowd.pinapaka/.ansible/tmp/ansible-tmp-1714109490.0885582-73185-193526554178977/AnsiballZ\_bigip\_command.py”, line 99, in \_ansiballz\_main  
&nbsp; &nbsp; invoke\_module(zipped\_mod, temp\_path, ANSIBALLZ\_PARAMS)  
&nbsp; File “/Users/pranaychowd.pinapaka/.ansible/tmp/ansible-tmp-1714109490.0885582-73185-193526554178977/AnsiballZ\_bigip\_command.py”, line 47, in invoke\_module  
&nbsp; &nbsp; runpy.run\_module(mod\_name=‘ansible\_collections.f5networks.f5\_modules.plugins.modules.bigip\_command’, init\_globals=dict(\_module\_fqn=‘ansible\_collections.f5networks.f5\_modules.plugins.modules.bigip\_command’, \_modlib\_path=modlib\_path),  
&nbsp; File “\<frozen runpy\>”, line 226, in run\_module  
&nbsp; File “\<frozen runpy\>”, line 98, in \_run\_module\_code  
&nbsp; File “\<frozen runpy\>”, line 88, in \_run\_code  
&nbsp; File “/var/folders/4c/dnty3w814gxd01c5lq6910nr0000gn/T/ansible\_bigip\_command\_payload\_rjjis8dv/ansible\_bigip\_command\_payload.zip/ansible\_collections/f5networks/f5\_modules/plugins/modules/bigip\_command.py”, line 757, in \<module\>  
&nbsp; File “/var/folders/4c/dnty3w814gxd01c5lq6910nr0000gn/T/ansible\_bigip\_command\_payload\_rjjis8dv/ansible\_bigip\_command\_payload.zip/ansible\_collections/f5networks/f5\_modules/plugins/modules/bigip\_command.py”, line 750, in main  
&nbsp; File “/var/folders/4c/dnty3w814gxd01c5lq6910nr0000gn/T/ansible\_bigip\_command\_payload\_rjjis8dv/ansible\_bigip\_command\_payload.zip/ansible\_collections/f5networks/f5\_modules/plugins/modules/bigip\_command.py”, line 680, in exec\_module  
&nbsp; File “/var/folders/4c/dnty3w814gxd01c5lq6910nr0000gn/T/ansible\_bigip\_command\_payload\_rjjis8dv/ansible\_bigip\_command\_payload.zip/ansible\_collections/f5networks/f5\_modules/plugins/modules/bigip\_command.py”, line 631, in exec\_module  
&nbsp; File “/var/folders/4c/dnty3w814gxd01c5lq6910nr0000gn/T/ansible\_bigip\_command\_payload\_rjjis8dv/ansible\_bigip\_command\_payload.zip/ansible\_collections/f5networks/f5\_modules/plugins/module\_utils/icontrol.py”, line 551, in tmos\_version  
&nbsp; File “/var/folders/4c/dnty3w814gxd01c5lq6910nr0000gn/T/ansible\_bigip\_command\_payload\_rjjis8dv/ansible\_bigip\_command\_payload.zip/ansible\_collections/f5networks/f5\_modules/plugins/module\_utils/bigip.py”, line 31, in api  
&nbsp; File “/var/folders/4c/dnty3w814gxd01c5lq6910nr0000gn/T/ansible\_bigip\_command\_payload\_rjjis8dv/ansible\_bigip\_command\_payload.zip/ansible\_collections/f5networks/f5\_modules/plugins/module\_utils/bigip.py”, line 52, in connect\_via\_token\_auth  
&nbsp; File “/var/folders/4c/dnty3w814gxd01c5lq6910nr0000gn/T/ansible\_bigip\_command\_payload\_rjjis8dv/ansible\_bigip\_command\_payload.zip/ansible\_collections/f5networks/f5\_modules/plugins/module\_utils/icontrol.py”, line 239, in post  
&nbsp; File “/var/folders/4c/dnty3w814gxd01c5lq6910nr0000gn/T/ansible\_bigip\_command\_payload\_rjjis8dv/ansible\_bigip\_command\_payload.zip/ansible\_collections/f5networks/f5\_modules/plugins/module\_utils/icontrol.py”, line 194, in send  
&nbsp; File “/var/folders/4c/dnty3w814gxd01c5lq6910nr0000gn/T/ansible\_bigip\_command\_payload\_rjjis8dv/ansible\_bigip\_command\_payload.zip/ansible/module\_utils/urls.py”, line 1578, in open  
&nbsp; File “/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/urllib/request.py”, line 215, in urlopen  
&nbsp; &nbsp; return opener.open(url, data, timeout)  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  
&nbsp; File “/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/urllib/request.py”, line 515, in open  
&nbsp; &nbsp; response = self.\_open(req, data)  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;^^^^^^^^^^^^^^^^^^^^^  
&nbsp; File “/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/urllib/request.py”, line 532, in \_open  
&nbsp; &nbsp; result = self.\_call\_chain(self.handle\_open, protocol, protocol +  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  
&nbsp; File “/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/urllib/request.py”, line 492, in \_call\_chain  
&nbsp; &nbsp; result = func(\*args)  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;^^^^^^^^^^^  
&nbsp; File “/var/folders/4c/dnty3w814gxd01c5lq6910nr0000gn/T/ansible\_bigip\_command\_payload\_rjjis8dv/ansible\_bigip\_command\_payload.zip/ansible/module\_utils/urls.py”, line 605, in https\_open  
&nbsp; File “/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/urllib/request.py”, line 1347, in do\_open  
&nbsp; &nbsp; raise URLError(err)  
urllib.error.URLError: \<urlopen error [SSL: WRONG\_VERSION\_NUMBER] wrong version number (\_ssl.c:1000)\>  
fatal: [hostip

]: FAILED! =\> {  
&nbsp; &nbsp; “changed”: false,  
&nbsp; &nbsp; “module\_stderr”: “Traceback (most recent call last):\n &nbsp;File \”/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/urllib/request.py\“, line 1344, in do\_open\n &nbsp; &nbsp;h.request(req.get\_method(), req.selector, req.data, headers,\n &nbsp;File \”/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/http/client.py\", line 1336, in request\n&nbsp; &nbsp; ..

.

.

.

payload.zip/ansible\_collections/f5networks/f5\_modules/plugins/module\_utils/bigip.py\“, line 52, in connect\_via\_token\_auth\n &nbsp;File \”/var/folders/4c/dnty3w814gxd01c5lq6910nr0000gn/T/ansible\_bigip\_command\_payload\_rjjis8dv/ansible\_bigip\_command\_payload.zip/ansible\_collections/f5networks/f5\_modules/plugins/module\_utils/icontrol.py\“, line 239, in post\n &nbsp;File \”/var/folders/4c/dnty3w814gxd01c5lq6910nr0000gn/T/ansible\_bigip\_command\_payload\_rjjis8dv/ansible\_bigip\_command\_payload.zip/ansible\_collections/f5networks/f5\_modules/plugins/module\_utils/icontrol.py\“, line 194, in send\n &nbsp;File \”/var/folders/4c/dnty3w814gxd01c5lq6910nr0000gn/T/ansible\_bigip\_command\_payload\_rjjis8dv/ansible\_bigip\_command\_payload.zip/ansible/module\_utils/urls.py\“, line 1578, in open\n &nbsp;File \”/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/urllib/request.py\“, line 215, in urlopen\n &nbsp; &nbsp;return opener.open(url, data, timeout)\n &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n &nbsp;File \”/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/urllib/request.py\“, line 515, in open\n &nbsp; &nbsp;response = self.\_open(req, data)\n &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ^^^^^^^^^^^^^^^^^^^^^\n &nbsp;File \”/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/urllib/request.py\“, line 532, in \_open\n &nbsp; &nbsp;result = self.\_call\_chain(self.handle\_open, protocol, protocol +\n &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n &nbsp;File \”/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/urllib/request.py\“, line 492, in \_call\_chain\n &nbsp; &nbsp;result = func(\*args)\n &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ^^^^^^^^^^^\n &nbsp;File \”/var/folders/4c/dnty3w814gxd01c5lq6910nr0000gn/T/ansible\_bigip\_command\_payload\_rjjis8dv/ansible\_bigip\_command\_payload.zip/ansible/module\_utils/urls.py\“, line 605, in https\_open\n &nbsp;File \”/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/urllib/request.py\“, line 1347, in do\_open\n &nbsp; &nbsp;raise URLError(err)\nurllib.error.URLError: \<urlopen error [SSL: WRONG\_VERSION\_NUMBER] wrong version number (\_ssl.c:1000)\>\n”,  
&nbsp; &nbsp; “module\_stdout”: “”,  
&nbsp; &nbsp; “msg”: “MODULE FAILURE\nSee stdout/stderr for the exact error”,  
&nbsp; &nbsp; “rc”: 1  
}

---

<div class="post-metadata">

**Author:** ![pranay48](https://avatars.discourse-cdn.com/v4/letter/p/e47c2d/32.png) [@pranay48](https://community.f5.com/u/pranay48)\
**Post date:** [May 8, 2024, 4:10am UTC](https://community.f5.com/t/error-while-running-ansible/74422/2 "2024-05-08T04:10:08Z")

</div>

Anysolution anyone?"

---

<div class="post-metadata">

**Author:** ![boneyard](https://d1p9zq3aats0t8.cloudfront.net/user_avatar/community.f5.com/boneyard/32/20419_2.png) [@boneyard](https://community.f5.com/u/boneyard)\
**Post date:** [May 9, 2024, 9:07am UTC](https://community.f5.com/t/error-while-running-ansible/74422/3 "2024-05-09T09:07:38Z")

</div>

For any playbook? Can you share a simple one which triggers this?

The errors “\<urlopen error [SSL: WRONG\_VERSION\_NUMBER]” point to a lower SSL version then the F5 accepts, does a curl from the jump host towards it work?

---

<div class="post-metadata">

**Author:** ![pranay48](https://avatars.discourse-cdn.com/v4/letter/p/e47c2d/32.png) [@pranay48](https://community.f5.com/u/pranay48)\
**Post date:** [May 9, 2024, 9:52am UTC](https://community.f5.com/t/error-while-running-ansible/74422/4 "2024-05-09T09:52:35Z")

</div>

Yes, it is every playbook.&nbsp;  
Ex:

---  
- name: List virtual  
&nbsp; hosts: f5  
&nbsp; connection: local  
&nbsp; vars:  
&nbsp; &nbsp; provider:  
&nbsp; &nbsp; &nbsp; server: “localhost”  
&nbsp; &nbsp; &nbsp; user: “\<\>”  
&nbsp; &nbsp; &nbsp; password: “\<\>”  
&nbsp; &nbsp; &nbsp; server\_port: \<\>  
&nbsp; &nbsp; &nbsp; validate\_certs: no

tasks:  
&nbsp; - name: Retrieve LTM pool list  
&nbsp; &nbsp; bigip\_command:  
&nbsp; &nbsp; &nbsp; commands:  
&nbsp; &nbsp; &nbsp; &nbsp; - tmsh -c “list ltm pool”  
&nbsp; &nbsp; &nbsp; provider: “{{ provider }}”  
&nbsp; &nbsp; register: ltm\_pool\_list

- name: Display LTM pool list  
&nbsp; &nbsp; debug:  
&nbsp; &nbsp; &nbsp; var: ltm\_pool\_list.stdout\_lines

Inventory:

[f5]

\<Ip\>

[f5:vars]

ansible\_ssh\_common\_args=‘-o StrictHostKeyChecking=no -J \<user\>@localhost:\<port\>’

-Yes, curl and ssh from jumphost towards F5 works

---

<div class="post-metadata">

**Author:** ![boneyard](https://d1p9zq3aats0t8.cloudfront.net/user_avatar/community.f5.com/boneyard/32/20419_2.png) [@boneyard](https://community.f5.com/u/boneyard)\
**Post date:** [May 13, 2024, 5:09pm UTC](https://community.f5.com/t/error-while-running-ansible/74422/5 "2024-05-13T17:09:50Z")

</div>

Is that ansible\_ssh\_common\_args needed? Do you tunnel or such towards the F5?

Have you limited the allowed TLS versions on the F5 management interface?
