Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix apt state with Ubuntu 22.04 & clean up icinga2 state #173

Merged
merged 2 commits into from
Oct 8, 2024

Conversation

DasSkelett
Copy link
Member

apt state

We installed python-apt, which on Ubuntu is still pointing towards the Python2 variant.
On Ubuntu 22.04, this is not available anymore. Since we don't actually need the Python2 package, but the Python3 one, it is changed to python3-apt

A sources.list template for Ubuntu 22.04 has been created , this state was failing for the vm-hosts as it couldn't find a file.
We'll have to add the one for 24.04 soon as well.

icinga2 state

Basically we had a bit of a mess in terms of using roles/minion_roles, role/minion_role and device_role/minion_device_role:

  • roles/minion_roles is pointing to the unused and unmaintained netbox:config_context:roles (only a handful of VMs had set icinga2_client there in the netbox config context, but it wasn't referenced anywhere, instead we are using the tag icinga2_client).
  • device_role/minion_device_role points to the deprecated device_role property of devices in netbox. The "new" role property has been introduced, matching VMs and other objects. device_role is a synonym for role in netbox 3.x and removed in netbox 4.0 (further cleanup in other states needed before we upgrade netbox).
    I have removed/replaced it with the role/minion_role mine function.
  • The actual role/minion_role data is not a list, but a single value. The code has been changed in a lot of places to account for this.

Additionally, some icinga services/checks had broken conditions, like checking for roles which don't exist anymore or no VM has assigned anymore (dnsserver, gateway, ...). I fixed those, mostly changing the conditions to match on either the new roles (nextgen-gateway) or on the host tags (dnsdist, recursor, authorative-dns, docker...).

@DasSkelett DasSkelett requested a review from a team as a code owner October 3, 2024 18:49
@DasSkelett DasSkelett merged commit 1602766 into main Oct 8, 2024
8 checks passed
@DasSkelett DasSkelett deleted the icinga-fixes branch October 8, 2024 21:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants