Checkmk goes Ansible

Hello guys!

Disclaimer: I know I am not the first one to build Ansible roles for Checkmk, I have seen the posts here and found some roles in the Galaxy already. This is merely my humble approach to the subject.

As it came up during the Checkmk Conference No. 7, I want to outline my thoughts on the matter and see who wants to participate and what we can do.

I started creating two Ansible roles for Checkmk just before the conference:

Links

They are in a very early maturity state, I am considering them alpha at best.

My intention behind this post is the following: I want to start a community driven project which revolves around Ansible. This can include roles, collections but also modules. I would love to see the community work together to build an ecosystem in Ansible around Checkmk.

For starters these are some ideas where to start:

Ideas
  • Collaborate on the two existing roles to improve them
  • Create additional roles if use cases come up
  • Create native Ansible Modules that handle e.g.:
    • Host Management
    • Checkmk Management (Like Sites, Rulesets etc.)

Personally I will focus on role development and maybe collections as that is what I do. If someone is knowledgeable about creating Ansible Modules please raise a hand, then we can connect.

Maybe we can start something that helps everyone regardless of the edition and environment they are using Checkmk in.

I appreciate all input!

20 Likes

Awesome idea. I would like to learn and contribute here.

1 Like

Hi @thorian93
I like this idea. I have some ansible stuff on myself here. Maybe I can add it to your ones.
I’ll contact you directly.

2 Likes

@davidwayne: Do you have any knowledge regarding Ansible or Python? Because we definitly need Python programmers for the Ansible modules.
For the Ansible roles and general stuff I am happy to help and educate however I can. :slight_smile:

Hi @thorian93,

There are some early implementations in a project we had some years ago. You will find them in our official git repository: cmk_host_registration

Unfortunately our official project is on hold due to other priorities. But feel free, to use this code as inspiration, if you like. As I am very limited in my (free)time (two small kids at home…), I most likely cannot participate in your project - but I may have some space here and there to answer open questions. Just write me a private message. :slight_smile:

2 Likes

Hi,

I guess you checked what already exists.
What is missing from Chris Lingberghs projects?

Regards,
Simon

2 Likes

Briefly: I did not go through them entirely. So I cannot say how good they are.

My intend here is - primarily - to get the community together to work on this topic.

If Chris feels like joining the efforts that’d be awesome.

I appreciate your efforts - but wouldn’t it be better then that you try Chris’ roles first and find out if they are already fulfilling your requirements?
I have used both of Chris’ Checkmk Ansible roles (server/client) for a customer project; they worked flawlessly. Chris releases frequently and responds to pull requests. What more could I want?
Please get me right: I just want to point you to the risk of reinventing the wheel.

2 Likes

@thorian93 In Checkmk context, I have done some bits and pieces in Ansible and Puppet. Also, I am not a developer but with my day to day dealing with Checkmk in multiple environments, I can fix things.

Pingback: Checkmk_ansible_modules - #8 by DerD

Just to assure you this is not dead: As these things go, just after being thrilled by the positive feedback regarding this around the last Conference and starting this post, I got a lot of stuff going on. That’s why there is so little activity here. But I will be back! :wink:

As soon as anything starts moving again I will update here.

Thanks for all the feedback and interest shown here and elsewhere!

4 Likes

Hey folks!
I know, it has been a while, and I apologize for playing dead.
It’s-a-me @thorian93’s alter ego @robin.gierse. :slight_smile:
Some of you might be aware, that I joined the tribe in the end of last year. Due to that, I am acting under this new account as the tribe employee in contrast to purely private usage of @thorian93. The career change had a little impact on the time at my disposal, but also opened up new opportunities.

But that’s enough about my person, you are here for Ansible!

Without further ado, let me announce the first release of our brand-new Ansible collection to the Ansible Galaxy! :tada:

A few disclaimers are due though first: This is a purely open source, non-commercial side project. Meaning: a few of the tribe members are working part-time on this. We try to keep up, but please be merciful, in case we cannot uphold your expectations. Furthermore, there will be no commercial support from tribe29. But of course and as always: The community is here, and we will work issues opened in the GitHub repository.
Also, please be aware that this a very basic release and we want to features as we go. But we are sure you will already find value in it. :slight_smile:

Now after that legal-ish talk, here are the links to the content.
Enjoy, share, provide feedback!
Thanks in advance for everyone using, contributing and sharing!

Ansible Galaxy: tribe29.checkmk

7 Likes

63 posts were split to a new topic: Collection Release Announcements

Any plan to add support for MS Agents? Unfortunatly 90% of our hosts are MS Windows…

Plans? Yes. A timetable? Not at all.
We do not have easy access to Windoze boxes, so anyone who wants to give it a shot, have at it! :muscle:

Hi Robin,

sorry that I am writing now. I have started to use the ansible collection from v 0.6.0, It’s only couple of week.

Concerning

I see that this bug is still around and it’s not fixed completely.

line 140 in code should not it state

        current_folder = "%s" % extensions.get("folder", "/")

instead of

        current_folder = "%s" % extensions.get("folder", "")

default folder should be “/” and not “”.

Anyway thanks for this good collection!
I would be glad if I can help out.

Best, Michael

2 Likes

Hi Michael! Can you head over to GitHub with your report and open a bug issue there? That way it is easier for us to track things like this. Thanks!

Also, thanks for your positive feedback, it is definitely appreciated! :hugs:

1 Like

A post was split to a new topic: Ansible collection automation user usage

A post was split to a new topic: Is the legacy agent supported by the Ansible collection?

Sorry to correct you, there is no CentOS 9
it name is:
[

CentOS Stream 9

](CentOS Stream 9 - The CentOS Project)

BR

MF