{"id":19583832,"url":"https://github.com/bodsch/ansible-icinga2","last_synced_at":"2025-04-27T10:33:16.025Z","repository":{"id":42020958,"uuid":"298759826","full_name":"bodsch/ansible-icinga2","owner":"bodsch","description":"ansible role to deploy an Icinga2 master or satellite. supports HA for both components","archived":false,"fork":false,"pushed_at":"2023-11-05T15:18:32.000Z","size":503,"stargazers_count":11,"open_issues_count":5,"forks_count":6,"subscribers_count":4,"default_branch":"main","last_synced_at":"2023-11-05T16:26:00.267Z","etag":null,"topics":["ansible","automation","cluster","icinga2","icinga2-master","icinga2-satellite","monitoring"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bodsch.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2020-09-26T07:18:12.000Z","updated_at":"2023-11-05T16:26:02.277Z","dependencies_parsed_at":"2023-02-18T04:01:01.818Z","dependency_job_id":"5b8f65a1-2269-4fdf-99a6-ca40b52f7ed2","html_url":"https://github.com/bodsch/ansible-icinga2","commit_stats":null,"previous_names":[],"tags_count":35,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bodsch%2Fansible-icinga2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bodsch%2Fansible-icinga2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bodsch%2Fansible-icinga2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bodsch%2Fansible-icinga2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bodsch","download_url":"https://codeload.github.com/bodsch/ansible-icinga2/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224069628,"owners_count":17250451,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ansible","automation","cluster","icinga2","icinga2-master","icinga2-satellite","monitoring"],"created_at":"2024-11-11T07:45:01.910Z","updated_at":"2024-11-11T07:45:02.811Z","avatar_url":"https://github.com/bodsch.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Ansible Role:  `icinga2`\n\nAnsible role to setup Icinga2 master or satellite.\n\n---\n\n\u003e I am in the process of transferring this role to a [collection](https://github.com/bodsch/ansible-collection-icinga) and will therefore no longer process any issues or merge requests here.  \n\u003e However, I will include them in the collection!  \n\u003e **Please be patient until I have completed the work!**\n\n---\n\n\n[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/bodsch/ansible-icinga2/main.yml?branch=main)][ci]\n[![GitHub issues](https://img.shields.io/github/issues/bodsch/ansible-icinga2)][issues]\n[![GitHub release (latest by date)](https://img.shields.io/github/v/release/bodsch/ansible-icinga2)][releases]\n[![Ansible Quality Score](https://img.shields.io/ansible/quality/50067?label=role%20quality)][quality]\n\n[ci]: https://github.com/bodsch/ansible-icinga2/actions\n[issues]: https://github.com/bodsch/ansible-icinga2/issues?q=is%3Aopen+is%3Aissue\n[releases]: https://github.com/bodsch/ansible-icinga2/releases\n[quality]: https://galaxy.ansible.com/bodsch/icinga2\n\n\n## Requirements \u0026 Dependencies\n\nAnsible Collections\n\n- [bodsch.core](https://github.com/bodsch/ansible-collection-core)\n\n```bash\nansible-galaxy collection install bodsch.core\n```\nor\n```bash\nansible-galaxy collection install --requirements-file collections.yml\n```\n\nPython Module\n\n- dnspython\n\n\n### Operating systems\n\nTested on\n\n* ArchLinux\n* Debian based\n    - Debian 10 / 11\n    - Ubuntu 20.04\n* RedHat based\n    - Alma Linux 8\n    - Rocky Linux 8\n    - OracleLinux 8\n\n## Contribution\n\nPlease read [Contribution](CONTRIBUTING.md)\n\n## Development,  Branches (Git Tags)\n\nThe `master` Branch is my *Working Horse* includes the \"latest, hot shit\" and can be complete broken!\n\nIf you want to use something stable, please use a [Tagged Version](https://github.com/bodsch/ansible-icinga2/tags)!\n\n\n## Credits\n\n- [Michael Friedrich](https://gitlab.com/dnsmichi)\n- [Nicolai Buchwitz](https://github.com/nbuchwitz)\n- [Julien Tognazzi](https://github.com/jtognazzi)\n- [Carsten Köbke](https://github.com/Mikesch-mp)\n- [Jo. Fiedler](https://github.com/jofiedler)\n- and many others to make icinga2 what it is\n\n---\n\nPlease read the following documention for configuration points.\n\n\n## Documentation\n\n- [Features](doc/09-features.md)\n- [API Users](doc/10-api-users.md)\n- [groups](doc/11-groups.md)\n- [apply rules](doc/12-apply-rules.md)\n- [downtimes](doc/13-downtimes.md)\n- [check commands](doc/14-checkcommands.md)\n- [master](doc/15-master.md)\n- [satellite](doc/16-satellite.md)\n- [Backup and Restore](doc/20-backup-restore.md)\n\n---\n\n## Examples\n\nA complete test setup can be found in the GitLab under [icinga2-infrastructure](https://gitlab.com/icinga2-infrastructure/deployment).\n\n### Icinga2 Master\n\n#### single-master\n\n```yaml\n---\n- host: icinga-master\n  vars:\n    icinga2_ido:\n      user: icinga2_ido\n      password: icinga2_ido\n      host: localhost\n      cleanup:\n        acknowledgements_age: 72h\n\n    icinga2_api:\n      user:\n        icinga2:\n          password: S0mh1TuFJI\n          permissions: '*'\n\n    icinga2_salt: 42T2fYT7bIxj5v291ajAW6kK0njvNMww8eWinBdEO5vh02xwC5qaNMMx77qNkYFE\n\n    icinga2_masters:\n      master-1.icinga.local:\n\n    icinga2_host_object:\n      master-1.icinga.local:\n        endpoint_name: master-1.icinga.local\n        zone: master\n        display_name: master-1.icinga.local\n        import: generic-host\n        address: '{{ ansible_default_ipv4.address }}'\n        vars: |\n          os = \"Linux\"\n          dist = \"{{ ansible_distribution }}\"\n          dist_ver = \"{{ ansible_distribution_version }}\"\n          disks = {\n            \"disk /\" = {\n              disk_partitions = \"/\"\n            }\n          }\n          services = [ \"uptime\", \"memory\" ]\n\n  roles:\n    - role: icinga2\n```\n\n#### multi-master\n\n```yaml\n---\n- host: icinga-master\n  vars:\n    icinga2_ido:\n      user: icinga2_ido\n      password: icinga2_ido\n      host: localhost\n      cleanup:\n        acknowledgements_age: 72h\n\n    icinga2_api:\n      user:\n        icinga2:\n          password: S0mh1TuFJI\n          permissions: '*'\n\n    icinga2_salt: 42T2fYT7bIxj5v291ajAW6kK0njvNMww8eWinBdEO5vh02xwC5qaNMMx77qNkYFE\n\n    icinga2_ha: true\n\n    icinga2_masters:\n      master-1.icinga.local:\n        # type: primary\n        ip: 192.168.130.20\n        port: 5665\n      master-2.icinga.local:\n        ip: 192.168.130.21\n\n  roles:\n    - role: icinga2\n```\n\n### Icinga satellite\n\n#### simple\n\n```yaml\n---\n- host: icinga-master\n  vars:\n    icinga2_mode: satellite\n\n    icinga2_salt: 42T2fYT7bIxj5v291ajAW6kK0njvNMww8eWinBdEO5vh02xwC5qaNMMx77qNkYFE\n\n    icinga2_masters:\n      master-1.icinga.local:\n\n    icinga2_host_object:\n\n      satellite-1.icinga.local:\n        endpoint_name: satellite-1.icinga.local\n        zone: \"{{ icinga2_satellite_zone }}\"\n        display_name: satellite-1.icinga.local\n        import: generic-host\n        address: '{{ ansible_default_ipv4.address }}'\n        vars: |\n          os = \"Linux\"\n          dist = \"{{ ansible_distribution }}\"\n          dist_ver = \"{{ ansible_distribution_version }}\"\n          satellite = true\n          disks = {\n            \"disk /\" = {\n              disk_partitions = \"/\"\n            }\n          }\n          services = [ \"uptime\" ]\n\n  roles:\n    - role: icinga2\n```\n\n#### multi satellite with zones\n\n```yaml\n---\n- host: icinga-master\n  vars:\n    icinga2_mode: satellite\n\n    icinga2_salt: 42T2fYT7bIxj5v291ajAW6kK0njvNMww8eWinBdEO5vh02xwC5qaNMMx77qNkYFE\n\n    icinga2_masters:\n      master-1.icinga.local:\n\n    icinga2_satellites:\n      zone1:\n        satellite-1.icinga.local:\n          ip: 192.168.130.30\n        satellite-2.icinga.local:\n          ip: 192.168.130.31\n\n  roles:\n    - role: icinga2\n```\n\n\n## tests\n\nfor testing\n\n```bash\ntox -e py38-ansible29 -- molecule\n\ntox -e py38-ansible29 -- molecule -s icinga2-satellite\n```\n\n## Troubleshooting \u0026 Known issues\n\n\n### API\n\n```bash\nexport CURL_OPTS=\"--silent --insecure\"\nexport ICINGA_CREDS=\"--user icinga2:S0mh1TuFJI\"\nexport ICINGA_API_URL=\"https://master-1.icinga.local:5665/v1\"\n```\n\n```bash\n$ curl ${ICINGA_CREDS} ${CURL_OPTS} --header 'Accept: application/json' ${ICINGA_API_URL}/status/ApiListener | jq --raw-output \".results[].status.api.zones\"\n```\n\n```bash\n$ curl ${ICINGA_CREDS} ${CURL_OPTS} --header 'Accept: application/json' ${ICINGA_API_URL}/status/CIB | jq --raw-output '.results[].status.uptime'\n```\n\n```bash\n$ curl ${ICINGA_CREDS} ${CURL_OPTS} --header 'Accept: application/json' ${ICINGA_API_URL}/status/ApiListener | jq --raw-output \".results[].status.api\"\n```\n\n```bash\n$ curl ${ICINGA_CREDS} ${CURL_OPTS} ${ICINGA_API_URL}/objects/hosts | jq\n```\n\n```bash\n$ curl ${ICINGA_CREDS} ${CURL_OPTS} --header 'Accept: application/json' --header 'X-HTTP-Method-Override: GET' --request POST --data '{ \"attrs\": [ \"name\" ], \"type\": \"Host\", \"filter\": \"host.name==\\\"master-1.icinga.local\\\"\" }' ${ICINGA_API_URL}/objects/hosts\n```\n\n\n## License\n\nBSD 2-clause\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbodsch%2Fansible-icinga2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbodsch%2Fansible-icinga2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbodsch%2Fansible-icinga2/lists"}