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

Solution In Progress - Updated -

Issue

  • 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 https://rhui3.REGION.aws.ce.redhat.com/pulp/mirror/protected/rhui-client-config/rhel/server/8/x86_64/os [Could not resolve host: rhui3.REGION.aws.ce.redhat.com]", "rc": 1, "results": []}

Environment

  • 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