Skip to content

Commit 8d5b6eb

Browse files
committed
Add option to enable icinga2 api
1 parent 38206b4 commit 8d5b6eb

File tree

3 files changed

+27
-0
lines changed

3 files changed

+27
-0
lines changed

icinga2-ansible-no-ui/defaults/main.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,6 @@ icinga2_yum:
2525

2626
icinga2_main_conf: "/etc/icinga2/icinga2.conf"
2727
icinga2_conf_d: "/etc/icinga2/conf.d"
28+
29+
icinga2_enable_api: false
30+
icinga2_master_zone: localdomain
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
- name: Enable Icinga2 API
3+
command: >
4+
icinga2 node setup
5+
--master
6+
--accept-config
7+
args:
8+
creates: "/etc/icinga2/pki/{{ icinga2_master_zone }}.crt"
9+
notify:
10+
restart icinga2
11+
# --zone arg The name of the local zone
12+
# --master_host arg The name of the master host for auto-signing the csr;
13+
# syntax: host[,port]
14+
# --endpoint arg Connect to remote endpoint; syntax: cn[,host,port]
15+
# --listen arg Listen on host,port
16+
# --ticket arg Generated ticket number for this request
17+
# --trustedcert arg Trusted master certificate file
18+
# --cn arg The certificate's common name
19+
# --accept-config Accept config from master
20+
# --accept-commands Accept commands from master
21+
# --master Use setup for a master instance

icinga2-ansible-no-ui/tasks/main.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,6 @@
1616
- include: icinga2_configure.yml
1717
tags:
1818
- icinga2_configure
19+
20+
- include: icinga2_enable_api.yml
21+
when: icinga2_enable_api

0 commit comments

Comments
 (0)