Skip to main content

Posts

Showing posts from December, 2024

Ansible - Create Users from a Dictionary

Creating users is typically straightforward as the documentation for the required Ansible modules is comprehensive and easy to navigate. However, working with dictionaries instead of lists can introduce some additional complexity.  For example, let's assume the following dictionary structure is given: usergroups: group1: gid: 10001 name: group1 group2: gid: 10002 name: group2 group3: gid: 10003 name: group3 group4: gid: 10004 name: group4 users: user1: uid: 1985 name: user1 groups: - group1 - group2 sshkeys: - ssh-ed25519 AAAA0 - ssh-ed25519 AAAA1 user2: uid: 1986 name: user2 groups: - group4 - group1 sshkeys: - ecdsa-sha2-nistp384 AAAA0 Ansible provides the dict2items filter which transforms a dictionary into a list of key-value pairs. This transformation allows you to ite...

Foreman - upgrade from el8 to el9 using leapp

Foreman has supported el9 for several releases. With Foreman 3.12 and Katello 4.14 being the last supported versions on el8, it's time to upgrade. Upgrading to el9 will provide access to future upgrades, streamline the verisons used in my infrastructure and the latest security and performance improvements. I'll be upgrading my Server using leapp again just like I did previously. The procedure is outlined quite well in the documentation but here's my own take on documenting the procedure. NOTE: before continuing, please ensure you have a way to roll back any changes in case anything goes wrong. First, apply the latest patches for all packages: [root@katello01 ~]# dnf -4y --refresh update Check if a reboot is required: [root@katello01 ~]# dnf needs-restarting -r Perform a reboot if system libraries and packages have been upgraded: [root@katello01 ~]# systemctl reboot Once the server is back online, we can begin with the upgrade. To facilitate the transition from EL8 ...