Forum Discussion

Edson_Araujo's avatar
Icon for Nimbostratus rankNimbostratus
Jul 15, 2021

Connection Refused error when running Ansible Playbook

I'm trying to run an Ansible playbook to create a new local user account on a Big-IP VE running using the bigip_user module. I'm able to run tasks using bigip_device_info and bigip_config modules successfully, but whenever I try to run a playbook with a module to change settings (i.e. bigip_user or bigip_snmp_community) it errors out with the message: "An exception occurred during task execution. To see the full traceback, use -vvv. The error was: urllib.error.URLError: <urlopen error [Errno 111] Connection refused>"

I'm new to Ansible on Big-IP platform. Any help on this is greatly appreciated.


- name: Add users playbook
  hosts: "{{ devices }}"
  strategy: free
  order: sorted
  connection: local
  gather_facts: no
  become: no
  become_method: enable
  ignore_errors: no

    - f5networks.f5_modules

      server: "{{ ansible_host }}"
      user: <username>
      password: <password>
      validate_certs: no
      server_port: 443

  - name: Add or update the user
	  provider: "{{ provider }}"
	  username_credential: user
	  password_credential: password
	  update_password: always
	  full_name: User
	  shell: bash
	    - all:admin
	  state: present
    delegate_to: localhost


The full traceback is:
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/urllib/", line 1350, in do_open
  File "/usr/local/lib/python3.7/http/", line 1277, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/local/lib/python3.7/http/", line 1323, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/usr/local/lib/python3.7/http/", line 1272, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/local/lib/python3.7/http/", line 1032, in _send_output
  File "/usr/local/lib/python3.7/http/", line 972, in send
  File "/usr/local/lib/python3.7/http/", line 1439, in connect
  File "/usr/local/lib/python3.7/http/", line 944, in connect
    (,self.port), self.timeout, self.source_address)
  File "/usr/local/lib/python3.7/", line 728, in create_connection
    raise err
  File "/usr/local/lib/python3.7/", line 716, in create_connection
ConnectionRefusedError: [Errno 111] Connection refused



4 Replies

  • Zuke's avatar
    Icon for Cirrostratus rankCirrostratus

    I have a similar error, though I don't get a connection refused issue.

    The error was: urllib.error.URLError: <urlopen error timed out>

    Did you ever find a fix to your issue, Edson?

  • I too notice the same error when using bigip_device_info module on BIG-IP VE v13, But not on the Physical VIPRION Chassis, 



    "ansible_facts": {

            "job_errors": "Role=>'unknown'\\n Module=>'unknown'\\n Task=>'Collect BIG-IP information'\\n  Result=> '{'failed': True, '_ansible_parsed': False, 'module_stdout': '', 'module_stderr': 'Traceback (most recent call last):\\\\n 

    \\\n    raise URLError(err)\\\\nurllib.error.URLError: <urlopen error timed out>\\\\n', 'msg': 'MODULE FAILURE\\\\nSee stdout/stderr for the exact error', 'rc': 1, '_ansible_no_log': False, 'changed': False, '_ansible_delegated_vars': {'ansible_delegated_host': 'localhost', 'ansible_remote_tmp': None, 'ansible_system_tmpdirs': None, 'ansible_async_dir': None, 'ansible_admin_users': None, 'ansible_shell_allow_world_readable_temp': None}}'",

            "job_result": "FAILURE"

  • Hi Guys, I managed to resolve this issue, It's definitely a connectivity issue, In my case TCP443 was not allowed in the Openstack Security group configured on the Mgmt interface of the BIG-VE instances.