This topic needs a title

Hello

I hope all is well. I am new to Ansible and I am trying to set up a play or a playbook that will run the following command:

yum update --skip-broken --nobest -y

I am running Ansible 2.9.27 on a RHEL 7.9 server.

How should I go about formatting the play or playbook so the YAML syntax is correct and it actually runs? I will be using a host file to list all of the servers I am supposed to patch.

I tried writing the playbook like this:

Hello

I hope all is well. I am new to Ansible and I am trying to set up a play or a playbook that will run the following command:

yum update --skip-broken --nobest -y

The published "ansible" package..... is no longer "ansible". The core
functionality has been renamed as ansible-core, though that package
contains the critical binaries and modules. The more than 100 distinct
ansible galaxy collection modules listed are built up into the frankly
misnamed pypi.org published tarball called "ansible", and which has an
"ansible-core" dependency. And there is no published "ansiblle-core"
RPM for RHEL 7. Frankly, what is now called "ansible" should be
labeled as "ansible_collections", since ansible galaxy collection
odules are all it provides, and it actually puths them in the python
module directory labeled "ansible_collections".

The latest version of ansible-core requires python 3.9 or later, which
isn't available packaged well for RHEL 7. It is available for RHEL 8.
If you want. I also publish RPM building tools for backports over at
https://github.com/nkadel/ansiblerepo/, but you're probably much
better off hopping to RHEL 8 and installing ansible-core 2.14. Install
what ansible galaxy collecion modules you need only if and as you ned
them, to avoid wasting 150 Megabytes of the 300 Megabyte ansible 7.1.0
deployment on the "fortinet" modules which consume roughly half of the
required space.

Very few, if any, people any longer see a reason to install the
"ansible" package. The current list of modules in it is published at
https://github.com/ansible-community/ansible-build-data/blob/main/7/ansible-7.1.0.deps
, it's safer to and much, much more efficient to pick and choose among
those.

I am running Ansible 2.9.27 on a RHEL 7.9 server.

How should I go about formatting the play or playbook so the YAML syntax is correct and it actually runs? I will be using a host file to list all of the servers I am supposed to patch.

I'd start by updating to RHEL 8, and do "yum install ansible-core".