All Projects → T-Systems-MMS → Ansible Collection Icinga Director

T-Systems-MMS / Ansible Collection Icinga Director

Licence: gpl-3.0
An Ansible collection that contains modules to change objects in Icinga 2 using the director API.

Programming Languages

python
139335 projects - #7 most used programming language

Labels

Projects that are alternatives of or similar to Ansible Collection Icinga Director

Ansible Collection Letsencrypt
An Ansible collection for issuing Let's Encrypt certificates.
Stars: ✭ 33 (-28.26%)
Mutual labels:  ansible
Ansible Role Seafile
An ansible role to deploy Seafile, an Open Source Cloud Storage. http://seafile.com/
Stars: ✭ 38 (-17.39%)
Mutual labels:  ansible
Ansible Dcos
[DEPRECATED] Please consider using the Ansible Roles for DC/OS maintained by the Mesosphere SRE team
Stars: ✭ 41 (-10.87%)
Mutual labels:  ansible
Ansible Wsl
Provisioning your Windows from inside of WSL by Ansible
Stars: ✭ 34 (-26.09%)
Mutual labels:  ansible
Column
A stable API for Ansible
Stars: ✭ 38 (-17.39%)
Mutual labels:  ansible
Ansible Role Jenkins2
This Ansible role can be used to install and manage Jenkins 2.
Stars: ✭ 39 (-15.22%)
Mutual labels:  ansible
Adhokku
A toy PaaS
Stars: ✭ 32 (-30.43%)
Mutual labels:  ansible
Eos Mainnet
Ansible repo for setting up an EOS RPC API node and syncing to the mainnet
Stars: ✭ 45 (-2.17%)
Mutual labels:  ansible
Kitchen Ansiblepush
test-kitchen plugin to use ansible in push mode
Stars: ✭ 38 (-17.39%)
Mutual labels:  ansible
Ansible Kvm
Stars: ✭ 40 (-13.04%)
Mutual labels:  ansible
Ansible Role Android Sdk
Install Android SDK tools and packages, headless, with ansible.
Stars: ✭ 34 (-26.09%)
Mutual labels:  ansible
Ansible Phoenix
[Unmaintained] Develop and deploy a Phoenix app using Ansible!
Stars: ✭ 37 (-19.57%)
Mutual labels:  ansible
Dotfiles
Configs 🤘🤘🤘
Stars: ✭ 39 (-15.22%)
Mutual labels:  ansible
Ansible device42
Scripts to generate static inventory file or generate dynamic inventory for ansible from Device42 data
Stars: ✭ 33 (-28.26%)
Mutual labels:  ansible
Vagrant Centos7 Ansible Lamp
Ansible example using Vagrant to deploy Centos7 server with Apache2.4.6, PHP7 (with xdebug), mariaDB5.5 and phpmyadmin to local VM.
Stars: ✭ 41 (-10.87%)
Mutual labels:  ansible
Ansible Supervisor
Ansible role to set up (the latest or a specific version of) supervisor in Debian-like systems
Stars: ✭ 32 (-30.43%)
Mutual labels:  ansible
Ansible Elixir Playbooks
Ansible playbooks for Elixir build server and Phoenix Website. Sample app here: https://github.com/LunarLogic/phoenix_website
Stars: ✭ 39 (-15.22%)
Mutual labels:  ansible
Ansible Role Packer rhel
Ansible Role - Packer RHEL/CentOS Configuration for Vagrant VirtualBox
Stars: ✭ 45 (-2.17%)
Mutual labels:  ansible
Azure preview modules
Azure preview modules for Ansible
Stars: ✭ 43 (-6.52%)
Mutual labels:  ansible
Ansible Role Patroni
🐘 Ansible Role for Patroni
Stars: ✭ 40 (-13.04%)
Mutual labels:  ansible

Icinga Director Collection for Ansible

ci-ansible-test codecov

This collection contains Ansible modules and a role to change objects in Icinga 2 using the director API.

Required Ansible version: 2.9.10

Currently supported modules:

  • icinga_command_template
  • icinga_command
  • icinga_endpoint
  • icinga_host_template
  • icinga_host
  • icinga_hostgroup
  • icinga_notification
  • icinga_notification_template
  • icinga_service
  • icinga_service_apply
  • icinga_service_template
  • icinga_servicegroup
  • icinga_timeperiod
  • icinga_user_group
  • icinga_user_template
  • icinga_user
  • icinga_zone

Additionally all supported modules have an appropriate *_info-module to gather facts about the existing objects in the director.

Installation

If you use Ansible >=3.0.0, this collection is included in Ansible.

If you use an older version, you can install it with Ansible Galaxy:

ansible-galaxy collection install t_systems_mms.icinga_director

Alternatively put the collection into a requirements.yml-file:

---
collections:
- t_systems_mms.icinga_director

Examples using the modules

See the examples directory for a complete list of examples.

- hosts: localhost
  collections:
    - t_systems_mms.icinga_director
  tasks:
    - name: create a host in icinga
      t_systems_mms.icinga_director.icinga_host:
        state: present
        url: "https://example.com"
        url_username: "{{ icinga_user }}"
        url_password: "{{ icinga_pass }}"
        object_name: "{{ ansible_hostname }}"
        address: "{{ ansible_default_ipv4.address }}"
        display_name: "{{ ansible_hostname }}"
        groups:
          - "foo"
        imports:
          - "StandardServer"
        vars:
          dnscheck: "no"
- name: Query a service apply rule in icinga
  t_systems_mms.icinga_director.icinga_service_apply_info:
    url: "{{ icinga_url }}"
    url_username: "{{ icinga_user }}"
    url_password: "{{ icinga_pass }}"
    query: "SERVICE_dummy"
  register: result

Examples using the role

Please see the README of the role.

Troubleshooting

If the following error is thrown, check if you're behind a proxy and use force_basic_auth: true in the task.

fatal: [localhost]: FAILED! => {"changed": false, "msg": "bad return code while creating: -1. Error message: Request failed: <urlopen error Tunnel connection failed: 302 Found>"}

Local Development and testing

Linting with tox

> tox -elinters

Updating the tests and examples

If you add new features or arguments to the existing modules, please add them to the examples in the module itself. The integration tests and examples in our documentation are then generated from the module-examples.

To trigger this generation, you need to run the script hacking/update_examples_and_tests.sh from the root of the repository. For this you need to have yq in version 3 installed (see https://mikefarah.gitbook.io/yq/v/v3.x/).

Integration tests with docker

# run icinga in a container and forward port 80
> docker run -d -p 80:80 schurzi/icinga2

# run ansible-test
> ansible-test integration

# alternatively run the test playbooks against the container
> ansible-playbook tests/integration/targets/icinga/normalmode.yml
> ansible-playbook tests/integration/targets/icinga/checkmode.yml

Extras

  • Use our code snippets template supported in Visual Studio Code

Please see the README for more information.

License

GPLv3

Author Information

  • Sebastian Gumprich
  • Lars Krahl
  • Michaela Mattes
  • Martin Schurz
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].