Getting started

Example inventory

The debops.icinga role is not included in the common.yml playbook and needs to be activated by adding a host to a specific Ansible inventory group. The role is designed to be used on all hosts in the cluster, therefore the easiest way to do this is to include the main DebOps group in the Icinga inventory group.



See the Deployment guide documentation for more details about deploying Icinga in DebOps.

Example playbook

If you are using this role without DebOps, here's an example Ansible playbook that uses the debops.icinga role:


- name: Configure Icinga service
  hosts: [ 'debops_service_icinga' ]
  become: True

  environment: '{{ inventory__environment | d({})
                   | combine(inventory__group_environment | d({}))
                   | combine(inventory__host_environment  | d({})) }}'


    - role: debops.keyring
      tags: [ 'role::keyring', 'skip::keyring', 'role::icinga' ]
        - '{{ icinga__keyring__dependent_apt_keys }}'

    - role: debops.icinga/env
      tags: [ 'role::icinga', 'role::secret' ]

    - role: debops.secret
      tags: [ 'role::secret', 'role::icinga' ]
        - '{{ icinga__secret__directories | d([]) }}'

    - role: debops.apt_preferences
      tags: [ 'role::apt_preferences', 'skip::apt_preferences' ]
        - '{{ icinga__apt_preferences__dependent_list }}'

    - role: debops.etc_services
      tags: [ 'role::etc_services', 'skip::etc_services' ]
        - '{{ icinga__etc_services__dependent_list }}'

    - role: debops.ferm
      tags: [ 'role::ferm', 'skip::ferm' ]
        - '{{ icinga__ferm__dependent_rules }}'

    - role: debops.icinga
      tags: [ 'role::icinga', 'skip::icinga' ]

Ansible tags

You can use Ansible --tags or --skip-tags parameters to limit what tasks are performed during Ansible run. This can be used after a host was first configured to speed up playbook execution, when you are sure that most of the configuration is already in the desired state.

Available role tags:

Main role tag, should be used in the playbook to execute all of the role tasks as well as role dependencies.
This tag can be used to register an Icinga 2 instance in the Icinga Director via the REST API. Already registered nodes are not registered again.