Ansible DNF module not working in virtualenv for Amazon Web Services URL

Solution In Progress - Updated -


  • Creating a virtual environment on Amazon Web Service with an Ansible playbook running the DNF module for package installation fails with a host name resolution error:

    fatal: [localhost]: FAILED! => {"changed": false, "msg": "Failed to download metadata for repo 'rhui-client-config-server-8': Cannot prepare internal mirrorlist: Curl error (6): Couldn't resolve host name for [Could not resolve host:]", "rc": 1, "results": []}


  • Red Hat Enterprise Linux 8.x
  • Amazon Web Services

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content