{"id":13589862,"url":"https://github.com/Icinga/ansible-icinga2","last_synced_at":"2025-04-08T09:34:30.897Z","repository":{"id":145046331,"uuid":"131996937","full_name":"Icinga/ansible-icinga2","owner":"Icinga","description":"Ansible Role for Icinga 2","archived":true,"fork":false,"pushed_at":"2023-05-24T06:36:42.000Z","size":63,"stargazers_count":50,"open_issues_count":19,"forks_count":23,"subscribers_count":22,"default_branch":"master","last_synced_at":"2024-08-02T16:32:24.357Z","etag":null,"topics":["ansible","icinga","icinga2","monitoring"],"latest_commit_sha":null,"homepage":null,"language":"Jinja","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Icinga.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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,"roadmap":null,"authors":"AUTHORS"}},"created_at":"2018-05-03T13:11:05.000Z","updated_at":"2023-11-09T00:30:44.000Z","dependencies_parsed_at":"2024-01-16T21:53:15.014Z","dependency_job_id":"b54f4e5f-de99-40b0-9941-79dab8cf426c","html_url":"https://github.com/Icinga/ansible-icinga2","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Icinga%2Fansible-icinga2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Icinga%2Fansible-icinga2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Icinga%2Fansible-icinga2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Icinga%2Fansible-icinga2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Icinga","download_url":"https://codeload.github.com/Icinga/ansible-icinga2/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223314436,"owners_count":17125081,"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","icinga","icinga2","monitoring"],"created_at":"2024-08-01T16:00:35.513Z","updated_at":"2024-11-06T09:31:44.545Z","avatar_url":"https://github.com/Icinga.png","language":"Jinja","funding_links":[],"categories":["monitoring"],"sub_categories":[],"readme":"**Attention: This role is no longer maintained.** See: https://github.com/Icinga/ansible-collection-icinga\n\n# Icinga 2 Role for Ansible\n\nAnsible role to install and configure [Icinga 2](https://www.icinga.com/products/icinga-2/).\n\n\n\nThe scope of this role is to handle the installation and configuration of Icinga 2. In the future it will be possible to configure Icinga as master, satellite or agent. This role handles only Icinga 2 and not any third-party software (like databases, nrpe, UI etc.). The installation and configuration of Icinga Web 2 is currently not part of this role.\n\nThe role is supported on the following platforms:\n\n- Ansible \u003e= v2.8\n- Icinga 2 \u003e= v2.8\n- Ubuntu: 18.04, 20.04\n- Debian: 9, 10\n- CentOS/RHEL: 7, 8\n\nOther operating systems or versions may work but have not been tested.  \nPlatform support may be extended after a v1.0 release.\n\n## Installation\n\nUsing `ansible-galaxy`:\n\n```bash\nansible-galaxy install icinga.icinga2\n```\n\nUsing `requirements.yml`:\n\n```yaml\n---\n\n- src: icinga.icinga2\n```\n\n## Requirements\n\nPrerequisites that you may need, but are not covered by this role:\n\n- Database (MySQL/MariaDB/Postgres)\n- Web UI (icingaweb2)\n- NRPE\n\n## Role Configuration\n\nBy default this role adds the official [Icinga Repository](https://packages.icinga.com) to the system and installs the\n`icinga2` package.\n\n``` yaml\n- name: Default Example\n  hosts: localhost\n  roles:\n    - icinga2\n```\n\n### Disable repository management\n\nYou may choose to use your own or the systems default repositories. Repository management can be disabled:\n\n``` yaml\n- name: Example without repository\n  hosts: all\n  roles:\n    - icinga2\n  vars:\n    - i2_manage_repository: false\n```\n\n### Variables\n\n#### Variable: `i2_manage_repository`\n\nWhether to add the official [Icinga Repository](https://packages.icinga.com/) to the system or not. Defaults to `true`.\n\n#### Variable: `i2_manage_package`\n\nWhether to install packages or not. Defaults to `true`.\n\n#### Variable: `i2_manage_epel`\n\nWhether to install the EPEL release package. Defaults to `true`.\n\n#### Variable: `i2_manage_service`\n\nWhether to start, restart and reload the Icinga 2 on changes or not. Defaults to `true`.\n\n#### Variable: `i2_apt_key`\n\nGPG key used to verify packages on APT based system. The key will be imported. Defaults to\n`https://packages.icinga.com/icinga.key`.\n\n#### Variable: `i2_apt_url`\n\nRepository URL for APT based systems. Defaults\nto `deb http://packages.icinga.com/{{ ansible_distribution|lower }} icinga-{{ ansible_distribution_release }} main`.\nThis may be customized if you have a local mirror.\n\n#### Variable: `i2_yum_key`\n\nGPG key used to verify packages on YUM based sytems. The key URL will be added to the repository file. Defaults to\n`https://packages.icinga.com/icinga.key`.\n\n#### Variable: `i2_yum_url`\n\nRepository URL for YUM based sytem. Defaults to `http://packages.icinga.com/epel/$releasever/release/`. This may be\ncustomized if you have a local mirror.\n\n#### Variable: `i2_confd`\n\nBy default, configuration located in `/etc/icinga2/conf.d` is included. This list may be modified to include additional directories or set to `[]` to not include `conf.d` at all (e.g. on distributed installations).\nDefaults to `[ \"conf.d\" ]`.\n\n#### Variable: `i2_include_plugins`\n\nThe [ITL](https://www.icinga.com/docs/icinga2/latest/doc/10-icinga-template-library/) comes with a set of\npre-configured check commands. This variable defines what to include. Defaults to\n`[\"itl\", \"plugins\", \"plugins-contrib\", \"manubulon\", \"windows-plugins\", \"nscp\"]`\n\n#### Variable: `i2_const_plugindir`\n\nSet `PluginDir` constant. Defaults to `{{ i2_lib_dir }}/nagios/plugins`.\n\n#### Variable: `i2_const_manubulonplugindir`\n\nSet `ManubulonPluginDir` constant. Defaults to `{{ i2_lib_dir }}/nagios/plugins`.\n\n#### Variable: `i2_const_plugincontribdir`\n\nSet `PluginContribDir` constant. Defualts to `{{ i2_lib_dir }}/nagios/plugins`.\n\n#### Variable: `i2_const_nodename`\n\nSet `NodeName` constant. Defaults to `{{ ansible_fqdn }}`.\n\n#### Variable: `i2_const_zonename`\n\nSet `ZoneName` constant. Defaults to `{{ ansible_fqdn }}`.\n\n#### Variable: `i2_const_ticketsalt`\n\nSet `TicketSalt` constant. Empty by default.\n\n#### Variable: `i2_custom_constants`\n\nAdd custom constants to `constants.conf`. Must be a dictionary. Defaults to: `{}`\n\nSome default required values are specified in `i2_default_constants` and merged with this variable. Use this variable to override these default values, or add your own constants.\n\nDefault values of `i2_default_constants`:\n\n```yaml\n  PluginDir: \"{{ i2_lib_dir }}/nagios/plugins\"\n  ManubulonPluginDir: \"{{ i2_lib_dir }}/nagios/plugins\"\n  PluginContribDir: \"{{ i2_lib_dir }}/nagios/plugins\"\n  NodeName: \"{{ ansible_fqdn }}\"\n  ZoneName: \"{{ ansible_fqdn }}\"\n  TicketSalt: \"\"\n```\n\nExample usage:\n\n```yaml\n  vars:\n    - i2_constants:\n        TicketSalt: \"My ticket salt\"\n        Foo: \"bar\"\n```\n\n#### Variable: `i2_zones`\n\nReplaces `zones.conf` with configured zones.\n\nExample:\n\n```yaml\n  vars:\n    i2_zones:\n      - name: master\n        is_parent: true\n        endpoints:\n          - name: master1.example.tom\n            host: master1.example.tom\n            port: 15667\n          - name: master2.example.tom\n            host: 128.0.0.1\n          - name: global-templates\n            is_global: true\n          - name: director-global\n            is_global: true\n```\n\nis_parent = sets the parent zone to this zonename (optional).\nis_global = sets the zone to a global zone (optional).\nhost = sets the host ip/fqdn to connect to this endpoint (optional).\nport = sets the port (optional). Defaults to 5665. Requires host do be set.\n\n### System specific variables\n\nThe following variables are system specific and don't need to be overwritten in most cases. Be careful when making\nchanges to any of these variables.\n\n#### Variable: `i2_conf_dir`\n\nBase Icinga 2 configuration directory. Defaults to `/etc/icinga2`.\n\n#### Variable: `i2_user`\n\nIcinga 2 running as user. Default depends on OS.\n\n#### Variable: `i2_group`\n\nIcinga 2 running as group. Default depends on OS.\n\n#### Variable: `i2_lib_dir`\n\nLib dir. Default depends on OS.\n\n### Feature Usage\n\n#### Variable: `i2_custom_features`\n\nFeatures are maintained over the dictionary `i2_custom_features`.\nBy default features won't be managed until `i2_custom_features` has further values.\n\nExample usage:\n\n```yaml\nvars:\n  i2_custom_features:\n    ApiListener:                #ObjectType\n      api:                      #ObjectName\n        accept_command: true    #ObjectAttribute\n        accept_config: true     #ObjectAttribute\n    GraphiteWriter:\n      graphite:\n        host: \"127.0.0.1\"\n        port: \"2004\"\n```\n\n#### Variable: `i2_remove_unmanaged_features`\n\nThe variable `i2_remove_unmanaged_features` change the behaviour of the feature handling.\nIt will remove all **unmanged** `.conf` files from the directory `/etc/icinga2/features-enabled` and let you manage only your defined features.\n\n### Handlers\n\n#### Handler: `start icinga2`\n\nThis handler starts Icinga 2. It is only used to make sure Icinga 2 is running. You can prevent this handler from\nbeing triggered by setting `i2_manage_service` to false.\n\n#### Handler: `reload icinga2`\n\nThis handler reloads Icinga 2 when configuration changes. You can prevent this handler from being triggered by setting\n`i2_manage_service` to false.\n\n### Examples\n\nExample Agent Config:\n\nExample usage (api featuer will NOT be enabled in this example):\n\n```yaml\n- name: icinga Package\n  hosts: icingaagents\n  roles:\n    - icinga2\n  vars:\n    i2_confd: [] #don't include conf.d\n    i2_zones:\n      - name: master\n        is_parent: true\n        endpoints:\n          - name: master1.example.tom\n            host: master1.example.tom\n            port: 15667\n          - name: master2.example.tom\n            host: 128.0.0.1\n```\n\n## Dependencies\n\nNone\n\n## Example Playbook\n\n```yaml\n---\n\n- name: Playbook\n  hosts: all\n\n  roles:\n    - icinga.icinga2\n```\n\n\u003c!--\n## Development\nA roadmap of this project is located at https://github.com/Icinga/ansible-icinga2/milestones. Please consider this\nroadmap when you start contributing to the project.\n--\u003e\n\n## Contributing\n\nWhen contributing several steps such as pull requests and proper testing implementations are required. Find a detailed\nstep by step guide in [CONTRIBUTING.md](CONTRIBUTING.md).\n\n## Testing\n\nTesting is essential in our workflow to ensure a good quality. We use Molecule to test all\ncomponents of this role. For a detailed description see [TESTING.md](TESTING.md).\n\n## Release Notes\n\nWhen releasing new versions we refer to [SemVer 1.0.0](http://semver.org/spec/v1.0.0.html) for version numbers. All steps required when creating a new\nrelease are described in [RELEASE.md](RELEASE.md)\n\nSee also [CHANGELOG.md](CHANGELOG.md)\n\n## Authors\n\n[AUTHORS](AUTHORS) is generated on each release.\n\n## License\n\nThis project is under the Apache License. See the [LICENSE](LICENSE) file for the full license text.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FIcinga%2Fansible-icinga2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FIcinga%2Fansible-icinga2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FIcinga%2Fansible-icinga2/lists"}