|
| 1 | +# Ansible Icinga |
| 2 | + |
| 3 | +This role is used to configure an Icinga Instance over its Icinga Director. |
| 4 | + |
| 5 | +## Installation |
| 6 | + |
| 7 | +* create a `requirements.yml`: |
| 8 | + |
| 9 | +```bash |
| 10 | +--- |
| 11 | +collections: |
| 12 | + - name: t_systems_mms.icinga_director |
| 13 | + src: https://github.com/T-Systems-MMS/ansible-collection-icinga-director |
| 14 | + version: 1.2.2 |
| 15 | +``` |
| 16 | + |
| 17 | +* install the collections: |
| 18 | + |
| 19 | +```bash |
| 20 | +ansible-galaxy collection install -r requirements.yml -p collections/ |
| 21 | +``` |
| 22 | + |
| 23 | +## Dependencies |
| 24 | + |
| 25 | +collections: |
| 26 | +t_systems_mms.icinga_director >= 1.2.2 |
| 27 | + |
| 28 | +## Role Variables |
| 29 | + |
| 30 | +| Variable | Required | Default |
| 31 | +|----------------------------|----------|--------- |
| 32 | +| **icinga** |
| 33 | +| url | yes | |
| 34 | +| use_proxy | no | |
| 35 | +| validate_certs | no | |
| 36 | +| url_username | yes | |
| 37 | +| url_password | yes | |
| 38 | +| force_basic_auth | no | |
| 39 | +| client_cert | no | |
| 40 | +| client_key | no | |
| 41 | +| **icinga_timeperiod** |
| 42 | +| icinga_timeperiods | no | [] |
| 43 | +| display_name | no | |
| 44 | +| imports | no | |
| 45 | +| ranges | no | |
| 46 | +| **icinga_user_template** |
| 47 | +| icinga_user_templates | no | [] |
| 48 | +| imports | no | |
| 49 | +| period | no | |
| 50 | +| enable_notifications | no | |
| 51 | +| **icinga_user** |
| 52 | +| icinga_users | no | [] |
| 53 | +| display_name | no | |
| 54 | +| imports | yes | [] |
| 55 | +| pager | no | |
| 56 | +| period | no | |
| 57 | +| disabled | no | |
| 58 | +| email | yes | null |
| 59 | +| **icinga_hostgroup** |
| 60 | +| icinga_hostgroups | no | [] |
| 61 | +| display_name | no | |
| 62 | +| assign_filter | no | `host.name="hostgroup.1-*"` |
| 63 | +| **icinga_host_template** |
| 64 | +| icinga_host_templates | no | [] |
| 65 | +| display_name | no | |
| 66 | +| address | no | |
| 67 | +| groups | no | |
| 68 | +| check_command | no | |
| 69 | +| disabled | no | |
| 70 | +| imports | no | |
| 71 | +| zone | no | |
| 72 | +| vars | no | |
| 73 | +| **icinga_host** |
| 74 | +| icinga_hosts | no | [] |
| 75 | +| display_name | no | |
| 76 | +| address | no | |
| 77 | +| groups | no | |
| 78 | +| disabled | no | |
| 79 | +| imports | yes | [] |
| 80 | +| zone | no | |
| 81 | +| vars | no | |
| 82 | +| **icinga_command_template** |
| 83 | +| icinga_command_templates | no | [] |
| 84 | +| display_name | no | |
| 85 | +| command | no | |
| 86 | +| methods_execute | yes | PluginCheck |
| 87 | +| timeout | no | |
| 88 | +| imports | no | |
| 89 | +| disabled | no | |
| 90 | +| zone | no | |
| 91 | +| vars | no | |
| 92 | +| arguments | no | |
| 93 | +| **icinga_command** |
| 94 | +| icinga_commands | no | [] |
| 95 | +| command_type | yes | PluginCheck |
| 96 | +| disabled | yes | false |
| 97 | +| imports | no | |
| 98 | +| zone | no | |
| 99 | +| vars | no | |
| 100 | +| **icinga_service_template** |
| 101 | +| icinga_service_templates | no | [] |
| 102 | +| display_name | no | |
| 103 | +| disabled | no | |
| 104 | +| check_command | no | |
| 105 | +| check_interval | no | |
| 106 | +| check_period | no | |
| 107 | +| check_timeout | no | |
| 108 | +| enable_active_checks | no | |
| 109 | +| enable_event_handler | no | |
| 110 | +| enable_notifications | no | |
| 111 | +| enable_passive_checks | no | |
| 112 | +| enable_perfdata | no | |
| 113 | +| groups | no | |
| 114 | +| imports | no | |
| 115 | +| max_check_attempts | no | |
| 116 | +| notes | no | |
| 117 | +| retry_interval | no | |
| 118 | +| use_agent | no | |
| 119 | +| vars | no | |
| 120 | +| volatile | no | |
| 121 | +| **icinga_service_apply** |
| 122 | +| icinga_service_applys | no | [] |
| 123 | +| display_name | no | |
| 124 | +| groups | no | |
| 125 | +| apply_for | no | |
| 126 | +| assign_filter | no | |
| 127 | +| imports | no | |
| 128 | +| vars | no | |
| 129 | +| notes | no | |
| 130 | +| notes_url | no | |
| 131 | +| **icinga_servicegroup** |
| 132 | +| icinga_servicegroups | no | [] |
| 133 | +| display_name | no | |
| 134 | +| assign_filter | no | |
| 135 | +| **icinga_notification** |
| 136 | +| icinga_notifications | no | [] |
| 137 | +| notification_interval | no | |
| 138 | +| types | no | |
| 139 | +| users | no | |
| 140 | +| apply_to | no | |
| 141 | +| assign_filter | no | |
| 142 | +| imports | no | |
| 143 | + |
| 144 | +## Example Playbook |
| 145 | + |
| 146 | +```bash |
| 147 | +--- |
| 148 | +- hosts: localhost |
| 149 | + gather_facts: false |
| 150 | + collections: |
| 151 | + - t_systems_mms.icinga_director |
| 152 | + roles: |
| 153 | + - ansible-icinga |
| 154 | + vars: |
| 155 | + icinga_url: "https://example.com" |
| 156 | + icinga_user: "{{ icinga_user }}" |
| 157 | + icinga_pass: "{{ icinga_pass }}" |
| 158 | + icinga_timeperiods: |
| 159 | + - timeperiod_object: |
| 160 | + - "8x5" |
| 161 | + ranges: |
| 162 | + monday: "09:00-17:00" |
| 163 | + tuesday: "09:00-17:00" |
| 164 | + wednesday: "09:00-17:00" |
| 165 | + thursday: "09:00-17:00" |
| 166 | + friday: "09:00-17:00" |
| 167 | + - timeperiod_object: |
| 168 | + - "24x7" |
| 169 | + ranges: |
| 170 | + monday: "00:00-24:00" |
| 171 | + tuesday: "00:00-24:00" |
| 172 | + wednesday: "00:00-24:00" |
| 173 | + thursday: "00:00-24:00" |
| 174 | + friday: "00:00-24:00" |
| 175 | + saturday: "00:00-24:00" |
| 176 | + sunday: "00:00-24:00" |
| 177 | + icinga_users: |
| 178 | + - user_object: |
| 179 | + - "service_abbreviation_email_24x7" |
| 180 | + pager: "SIP/xxx" |
| 181 | + email: "service_abbreviation@example.com" |
| 182 | + - user_object: |
| 183 | + - "service_abbreviation_8x5" |
| 184 | + email: "service_abbreviation@example.com" |
| 185 | + icinga_hostgroups: |
| 186 | + - hostgroup_object: |
| 187 | + - "service_abbreviation-environement" |
| 188 | + - "service_abbreviation-environement-web" |
| 189 | + icinga_hosts: |
| 190 | + - host_object: |
| 191 | + - "service_abbreviation-environement-web01" |
| 192 | +``` |
0 commit comments