I have dynmaic inventory which has 10 nodes. 8 of them are RedHat and 2 of them are Ubuntu. The hosts are in random order.
I want to write a playbook so that it will patch the Ubuntu node at last after all the RedHat node are patched first. Instead of manipulating the inventory, how can I write a playbook for it?
I have written a playbook but it doesn’t work.
You may have a look into Conditionals based on
ansible_factsand the following minimal example playbooks options.1.)
Documentation
ansible_factsdnfmodule – Manages packages with the dnf package manageraptmodule – Manages apt-packages2.)
Depending if groups are used
Documentation
3.)
Documentation
import_tasksmodule – Import a task listinclude_tasksmodule – Dynamically include a task listinclude_tasksandimport_tasks?... and many more options to structure the upgrade process.