Can the Ansible Collection handle site updates?

Very nice collection, Robin!

Is it possible to handle updates to the Check_MK Server Instance with the Ansible collection?
I’m going to need this for our infrastructure, as we’re planning to remotely update the Sites with Ansible.

Specifically, I’m looking for “omd backup”, “omd update” and all of this automatically.

Kind regards

There are update tasks in the role, but there is no full example in the docs with all the neccessary parameters. I’m currently testing the role and plan to extend it (one more time).

@Noah yes, you can perform upgrades on sites with the collection, and you can also run a backup in advance. Please just keep in mind, that you want to test in advance and verify the upgrades afterwards, as the server role cannot catch all notices and warnings issued by the upgrade process.

P.S.: I split of the conversation to not spam the release post. :slight_smile:

1 Like

Hi, thanks for splitting, I didn’t know better. I suppose that this would be the correct way to handle upgrades with Ansible, isn’t it? We’re still in the pre-starting phase, as this Project will kick off sometime in 2024. With the Result, we want to handle the Updates of the base system and Check MK via Ansible, as far as I read, this would be the correct way to handle such cases.

No worries, that’s what we are here for. :slight_smile:

Yes, try the server role from the collection, it should have you covered.

1 Like

Little Update: Ansible has been implemented successfully, we’ve Updated 56 Servers with the Ansible Collection from 2.2.0p4 to 2.2.0p17 and then to 2.3.0p10, Updates we’re successful on all Servers, the only problem I had with the Server role was the detection of the existing Sites, we wanted the Playbook to detect the existing Site without giving it a value but to find it by itself with “omd sites -b” and Update it accordingly, after a little bit of tinkering we managed to get it were we wanted.

Thanks again to the CheckMK Ansible Team to provide this collection to make managing bigger environments better :grinning:

1 Like

Love to hear that, thanks for the update! :blush:

In theory, we could of course implement existing site detection, but there are several problems and risk in adding that feature. So I think the way you went with doing inventory yourself is better. Eventually, you want to define the sites with a desired state in your Ansible inventory, rather than automatically detecting them, which could result in unwanted results.

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed. Contact an admin if you think this should be re-opened.