Skip to content

Commit 1d45229

Browse files
authored
Merge pull request #222 from Icinga/feature/ticket-salt
Adds possibility to delegate ticket creation to satellites
2 parents 43c3880 + 0a1ef95 commit 1d45229

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
---
2+
minor_changes:
3+
- Added possibility to delegate ticket creation to satellites

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

+13-2
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,24 @@ 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:_** 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.
55+
> [!INFO]
56+
> 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.
5657
57-
```
58+
```yaml
5859
ca_host: icinga-server.localdomain
5960
ca_host_port: 5665
6061
```
6162
63+
> [!INFO]
64+
> In case your agent can't connect to the CA host, you can use the variables `icinga2_delegate_host`
65+
> and `ticket_salt` to delegate ticket creation to one of your satellites instead.
66+
67+
```yaml
68+
ca_host: icinga-server.localdomain
69+
icinga2_delegate_host: icinga-satellite.localdomain
70+
ticket_salt: "{{ icinga2_constants.ticket_salt }}"
71+
```
72+
6273
By default the FQDN is used as certificate common name, to put a name
6374
yourself:
6475

roles/icinga2/tasks/features/api.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
icinga2_ssl_cert: "{{ icinga2_dict_features.api.ssl_cert | default(omit) }}"
1313
icinga2_ssl_cacert: "{{ icinga2_dict_features.api.ssl_cacert | default(omit) }}"
1414
icinga2_ssl_key: "{{ icinga2_dict_features.api.ssl_key | default(omit) }}"
15+
icinga2_ticket_salt: "{{ icinga2_dict_features.api.ticket_salt | default(omit) }}"
1516

1617
- assert:
1718
that: ((icinga2_ssl_cacert is defined and icinga2_ssl_cert is defined and icinga2_ssl_key is defined) or (icinga2_ssl_cacert is undefined and icinga2_ssl_cert is undefined and icinga2_ssl_key is undefined and icinga2_ca_host is defined))
@@ -135,7 +136,7 @@
135136
{% if icinga2_ca_host != 'none' %} --cert "{{ icinga2_cert_path }}/{{ icinga2_cert_name }}.crt" {% else %} --csr "{{ icinga2_cert_path }}/{{ icinga2_cert_name }}.csr" {%- endif %}
136137
137138
- name: delegate ticket request to master
138-
shell: icinga2 pki ticket --cn "{{ icinga2_cert_name }}"
139+
shell: icinga2 pki ticket --cn "{{ icinga2_cert_name }}{% if icinga2_ticket_salt is defined %} --salt {{ icinga2_ticket_salt }}{% endif %}}"
139140
delegate_to: "{{ icinga2_delegate_host | default(icinga2_ca_host) }}"
140141
register: icinga2_ticket
141142
when: icinga2_ca_host != 'none'

0 commit comments

Comments
 (0)