Rebooting a host with Ansible using reboot hints

The need to configure a host, reboot it if needed, then wait for it return, is an extremely common pattern in Ansible – so common it will (finally!) become theĀ reboot module in Ansible 2.7.

For those of us using Ansible 2.6 or earlier, we need a way to reboot a host. There’s no shortage of suggestions out there and mine below hopes to add to those. The method I propose will:

  1. Verify if a reboot is required (using /bin/needs-restarting – CentOS/RHEL only).
  2. If necessary, reboot the host.
  3. Wait for SSH to disappear, meaning the host has progressed far into its reboot process.
  4. Wait for SSH to return, meaning the host is alive and ready for the play to continue.

Read more “Rebooting a host with Ansible using reboot hints”

Configuration domains in CloudForms/ManageIQ – part deux

In the last post on this topic I discussed a technique of separating your configuration from your code in CloudForms’ Automation Engine. The technique relied on creating class overrides in a higher priority domain, enabling attributes on those higher priority classes to be passed down.

It works but it’s…clunky, and it requires a duplicate of every class in a higher domain. Not the most scalable technique!

Below I present two other methods – one that uses $evm.instance_get, and another that loads the config directly onto the root object.

Read more “Configuration domains in CloudForms/ManageIQ – part deux”