How to use ansible to drive and manage centos 9 stream based OS

Issues related to applications and software problems and general support
Post Reply
Huang Haiqing
Posts: 9
Joined: 2022/11/25 05:21:24

How to use ansible to drive and manage centos 9 stream based OS

Post by Huang Haiqing » 2022/11/28 03:36:56

Hello, since "redhat-lsb-core" is not loaded into CentOS 9 stream, here I kickstarted several centos 9 stream OS, and I want to use Ansible to manage them. But all ansible_get_facts paramers can't clear fetch centos 9 stream version info, my question is hwo centos 9 stream is planned to be managed by Ansible?

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: How to use ansible to drive and manage centos 9 stream based OS

Post by TrevorH » 2022/11/28 12:47:31

Are you using the ansible version from EPEL 9?
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

User avatar
jlehtone
Posts: 4523
Joined: 2007/12/11 08:17:33
Location: Finland

Re: How to use ansible to drive and manage centos 9 stream based OS

Post by jlehtone » 2022/11/28 18:03:34

I had briefly one instance of CS9 before RHEL9 was released and I see that I had that machine in my Ansible inventory.

I was running Ansible 2.9 at the time -- version packaged by CentOS SIG, although EPEL probably had the same version.

What parameters does your get facts return?

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: How to use ansible to drive and manage centos 9 stream based OS

Post by TrevorH » 2022/11/28 18:08:24

More importantly, all the LSB packages have been deprecated and removed from RHEL 9 so having anything depend on them is doomed to failure. Any ansible packages that come from CentOS or RHEL supplied sources for el9 should not depend on LSB (because it doesn't exist) and if you find anything that does then you need to report it as a bug to the packager of those things that are trying to use LSB.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

User avatar
jlehtone
Posts: 4523
Joined: 2007/12/11 08:17:33
Location: Finland

Re: How to use ansible to drive and manage centos 9 stream based OS

Post by jlehtone » 2022/11/28 21:31:48

Huang Haiqing wrote:
2022/11/28 03:36:56
I kickstarted several centos 9 stream OS
CentOS Stream is a preview into which direction RHEL will tune to next. You might want one or couple, if you have applications that you develop for the Enterprise Linux platform.

However, does that require several system? I'd rather respawn instance from scratch when needed, and -- obviously -- configure it with Ansible. For production use I'd have RHEL or its rebuilds. (I have AlmaLinux 9 and run Ansible from it -- currently version 2.13 of the ansible-core.)

Huang Haiqing
Posts: 9
Joined: 2022/11/25 05:21:24

Re: How to use ansible to drive and manage centos 9 stream based OS

Post by Huang Haiqing » 2022/11/30 05:40:48

I mean how to sue Ansible when conditions to filter managed OS, which is based on CentOS stream 9. As you know, for other linux OS, there is OS detail info which is based on lsb-release, but when I tried to filter CentOS stream 9 based OS from Ansible get-facts, I can't filter out any OS version info out.

User avatar
jlehtone
Posts: 4523
Joined: 2007/12/11 08:17:33
Location: Finland

Re: How to use ansible to drive and manage centos 9 stream based OS

Post by jlehtone » 2022/11/30 06:50:32

As you know, no el9 has lsb-release and Ansible does get details from them.

What do you get with:

Code: Select all

ansible hostname -m setup | grep distribution

Post Reply