Slightly OT: Looking for ansible script examples to update the OS of my Nomad cluster

Hi all,

maybe someone else has already solved this and would like to share.

Currently, when I’m updating my Nomad cluster, I’m executing the following steps:

  1. Run “apt update & apt upgrade” on the nodes not running jobs. Making sure that the node is up again before moving to the next node to keep quorum for the server nodes.
  2. Drain the full nodes to the nodes already migrated
  3. Update the recently drained nodes

Since this is quite time-consuming, I would love to automate these steps, ideally with ansible. Any help appreciated.