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/ansible_module_dnf.py\", line 534, in <module>\r\n    main()\r\n  File \"/tmp/ansible_hsbv2mrz/ansible_module_dnf.py\", line 530, in main\r\n    ensure(module, base, params['state'], params['name'], params['autoremove'])\r\n  File \"/tmp/ansible_hsbv2mrz/ansible_module_dnf.py\", line 414, in ensure\r\n    base.install(pkg_spec)\r\n  File \"/usr/lib/python3.6/site-packages/dnf/base.py\", 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
  tasks:
    - package:
        name: cifs-utils
        state: latest
...

The inventory is:

[all]
localhost

[RHEL8]
benmon01 ansible_python_interpreter=/usr/libexec/platform-python

Any ideas on how I can resolve this?

Thanks

Responses