16 views
Skip to first unread message

Sean Son

unread,
Jan 19, 2023, 5:37:50 AM1/19/23
to ansible...@googlegroups.com
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:

---
    - name: Upgrade all packages
      command: yum update --skip-broken --nobest -y

But I keep getting syntax errors.  Any suggestions will GREATLY be appreciated!

Thank you in advance, 

Sean

Nico Kadel-Garcia

unread,
Jan 19, 2023, 8:49:51 AM1/19/23
to ansible...@googlegroups.com
On Thu, Jan 19, 2023 at 5:37 AM Sean Son
<linuxmailin...@gmail.com> wrote:
>
> 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".

> I tried writing the playbook like this:
>
> ---
> - name: Upgrade all packages
> command: yum update --skip-broken --nobest -y
>
> But I keep getting syntax errors. Any suggestions will GREATLY be appreciated!
>
> Thank you in advance,
>
> Sean
>
> --
> You received this message because you are subscribed to the Google Groups "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAOKpjz-tG8tda70U6tWO7SqhMn%3Dct_vjfpORsNxQ5-t94YBLVw%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages