Use Ansible on RHEL 7 to Install packages on RHEL 8 client

Latest response

Hi all

Ansible noob here... Trying to configure a new RHEL 8 VM from a RHEL 7 ansible server.

The output is:

ansible-playbook playbook-minimal.yml

PLAY [Initial build] ************************************************************************************************************************************************************************************************************************

TASK [Gathering Facts] **********************************************************************************************************************************************************************************************************************
ok: [benmon01]

TASK [package] ******************************************************************************************************************************************************************************************************************************
fatal: [benmon01]: FAILED! => {"changed": false, "module_stderr": "Shared connection to benmon01 closed.\r\n", "module_stdout": "Traceback (most recent call last):\r\n  File \"/tmp/ansible_hsbv2mrz/\", line 534, in <module>\r\n    main()\r\n  File \"/tmp/ansible_hsbv2mrz/\", line 530, in main\r\n    ensure(module, base, params['state'], params['name'], params['autoremove'])\r\n  File \"/tmp/ansible_hsbv2mrz/\", line 414, in ensure\r\n    base.install(pkg_spec)\r\n  File \"/usr/lib/python3.6/site-packages/dnf/\", line 1860, in install\r\n    raise dnf.exceptions.MarkingError(_('no package matched'), pkg_spec)\r\ndnf.exceptions.MarkingError: no package matched\r\n", "msg": "MODULE FAILURE", "rc": 0}
        to retry, use: --limit @/root/ansible/initial_build/playbook-minimal.retry

PLAY RECAP **********************************************************************************************************************************************************************************************************************************
benmon01                   : ok=1    changed=0    unreachable=0    failed=1

The playbook is:

- name: Initial build
  hosts: benmon01
    - package:
        name: cifs-utils
        state: latest

The inventory is:


benmon01 ansible_python_interpreter=/usr/libexec/platform-python

Any ideas on how I can resolve this?



The error messages indicate that yum (i.e. dnf) doesn't find the package called cifs-utils, which is strange.

If you log in to benmon01 and run sudo yum info cifs-utils, does it find it? It should be in the BaseOS repo. Is the system subscribed?

Hi and thanks for the reply.

I can install the package manually.

 dnf list cifs-utils
Updating Subscription Management repositories.
Unable to read consumer identity
This system is receiving updates from Spacewalk server.
Available Packages

The problem is I'm trying to convert my monolithic (and complicated) build scripts run on my beloved Satellite v5.8 server over to Ansible.

It looks like the required packages aren't installed on the RHEL 8 server, I just can't work out what is required.

Thanks again

Which ansible version are you using on the RHEL7 box? I had the same problem with ansible-2.3.x but it works with ansible-2.8.x.