Skip to content

Commit ec93280

Browse files
authored
Merge pull request #117 from Icinga/fix/icinga-config-host-name
Add icinga2_config_host var Add Documentation note
2 parents 15a39b4 + 109b48c commit ec93280

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

doc/role-icinga2/features/feature-api.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,7 @@ Create Signing Request to get a certificate managed by the parameter `ca_host` a
5252
set to the master/server hostname, FQDN or IP, the node setup tries to connect
5353
via API an retrieve the trusted certificate.
5454

55-
> **_NOTE:_** Ticket creation will be delegated, the host should accessible via the name or
56-
can defined as icinga2_delegate_host to match the Ansible alias.
55+
> **_NOTE:_** Ansible will delegate the ticket creation to the CA host. You can change this behaviour by setting 'icinga2_delegate_host' to match another Ansible alias.
5756
5857
```
5958
ca_host: icinga-server.localdomain

roles/icinga2/defaults/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@ icinga2_features:
1515
- name: mainlog
1616
icinga2_remote_objects: []
1717
_icinga2_custom_conf_paths: []
18+
icinga2_config_host: "{{ ansible_fqdn }}"

roles/icinga2/tasks/objects.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22

33
- name: collect all config objects for myself
44
set_fact:
5-
tmp_objects: "{{ tmp_objects| default([]) + hostvars[item]['icinga2_objects'][ansible_fqdn] }}"
5+
tmp_objects: "{{ tmp_objects| default([]) + hostvars[item]['icinga2_objects'][icinga2_config_host] }}"
66
with_items: "{{ groups['all'] }}"
7-
when: hostvars[item]['icinga2_objects'][ansible_fqdn] is defined
7+
when: hostvars[item]['icinga2_objects'][icinga2_config_host] is defined
88

99
- name: collect all config objects in play vars
1010
set_fact:
11-
tmp_objects: "{{ tmp_objects| default([]) + vars['icinga2_objects'][ansible_fqdn] }}"
12-
when: vars['icinga2_objects'][ansible_fqdn] is defined
11+
tmp_objects: "{{ tmp_objects| default([]) + vars['icinga2_objects'][icinga2_config_host] }}"
12+
when: vars['icinga2_objects'][icinga2_config_host] is defined
1313

1414
- icinga2_object:
1515
args: "{{ item }}"

0 commit comments

Comments
 (0)