Skip to content

Commit 068bbb5

Browse files
committed
Finishes vSphereDB module integration
1 parent 765bf30 commit 068bbb5

File tree

3 files changed

+62
-7
lines changed

3 files changed

+62
-7
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
d /run/icinga-vspheredb 0755 icingavspheredb icingaweb2 -
+61-6
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,72 @@
1-
- name: Module Vspheredb | Install
2-
debug:
3-
msg: Installed VsphereDB Modul
1+
---
2+
# Needed because the role sets different permissions for modules and git fails when checking it in task #2
3+
- name: Module vSphereDB | Clean up module directory
4+
ansible.builtin.file:
5+
state: absent
6+
path: "{{ icingaweb2_config.global.module_path }}/{{ module }}"
7+
loop:
8+
- vspheredb
9+
- incubator
10+
loop_control:
11+
loop_var: module
12+
13+
- name: Module vSphereDB | Install modules from source
14+
ansible.builtin.git:
15+
name: https://github.com/icinga/icingaweb2-module-{{ repo_info.name }}
16+
dest: "{{ icingaweb2_config.global.module_path }}/{{ repo_info.name }}"
17+
version: "{{ repo_info.version }}"
18+
loop:
19+
- name: vspheredb
20+
version: v1.7.1
21+
- name: incubator
22+
version: v0.20.0
23+
loop_control:
24+
loop_var: repo_info
25+
26+
- name: Module vSphereDB | Ensure incubator is enabled
27+
ansible.builtin.command: icingacli module enable incubator
28+
29+
- name: Module vSphereDB | Ensure service user exists
30+
ansible.builtin.user:
31+
name: icingavspheredb
32+
group: icingaweb2
33+
system: true
34+
home: /var/lib/icingavspheredb
35+
shell: /bin/false
36+
37+
- name: Module vSphereDB | Ensure service user home exists
38+
ansible.builtin.file:
39+
state: directory
40+
dest: /var/lib/icingavspheredb
41+
owner: icingavspheredb
42+
group: icingaweb2
43+
mode: "0750"
44+
45+
- name: Module vSphereDB | Ensure service file is installed
46+
ansible.builtin.copy:
47+
src: "{{ icingaweb2_config.global.module_path }}/vspheredb/contrib/systemd/icinga-vspheredb.service"
48+
dest: "/etc/systemd/system/{{ icingaweb2_vspheredb_service }}"
49+
remote_src: true
50+
mode: "0644"
451

52+
- name: Module vSphereDB | Ensure socket file is copied
53+
ansible.builtin.copy:
54+
src: icinga-vspheredb.conf
55+
dest: /etc/tmpfiles.d/{{ icingaweb2_vspheredb_service.replace('.service', '') }}.con
56+
mode: 0644
557

58+
- name: Module vSphereDB | Ensure socket file is installed
59+
ansible.builtin.command: systemd-tmpfiles --create /etc/tmpfiles.d/{{ icingaweb2_vspheredb_service.replace('.service', '') }}.conf
660

7-
- name: Module Vspheredb | Ensure config directory
61+
- name: Module vSphereDB | Ensure config directory
862
ansible.builtin.file:
963
state: directory
1064
dest: "{{ icingaweb2_modules_config_dir }}/vspheredb"
1165
owner: "{{ icingaweb2_httpd_user }}"
1266
group: "{{ icingaweb2_group }}"
1367
mode: "2770"
1468

15-
- name: Module Vspheredb | Manage config files
69+
- name: Module vSphereDB | Manage config files
1670
ansible.builtin.include_tasks: manage_module_config.yml
1771
loop: "{{ _files }}"
1872
loop_control:
@@ -23,8 +77,9 @@
2377
_files:
2478
- config
2579

26-
- name: Module Vspheredb | Ensure daemon is running
80+
- name: Module vSphereDB | Ensure daemon is running
2781
ansible.builtin.service:
2882
name: "{{ icingaweb2_vspheredb_service }}"
2983
state: started
3084
enabled: yes
85+
failed_when: false # this is a bit buggy because we only activate the module later in the role

roles/icingaweb2/vars/main.yml

-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,3 @@ icingaweb2_module_packages:
33
icingadb: icingadb-web
44
director: icinga-director
55
businessprocess: icinga-businessprocess
6-
vspheredb: icingaweb2-module-vspheredb

0 commit comments

Comments
 (0)