Skip to content

Commit

Permalink
add installation for vspheredb
Browse files Browse the repository at this point in the history
  • Loading branch information
christoph2497 committed Oct 18, 2023
1 parent 0249677 commit 765bf30
Show file tree
Hide file tree
Showing 5 changed files with 91 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
major_changes:
- Added Installation of Vspheredb Module
55 changes: 55 additions & 0 deletions doc/role-icingaweb2/module-vspheredb.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
## Module Vspheredb

The module Icinga Vspheredb provides

## Configuration

The general module parameter like `enabled` and `source` can be applied here.

For every config file, create a dictionary with sections as keys and the parameters as values. For all parameters please check the [module documentation](https://icinga.com/docs/icinga-vsphere-integration/latest/doc/01-Installation/)

as Icinga Web 2 resource, please use the `icingaweb2_resources` variable to define
the resource.

Example:

```
icingaweb2_resources:
vspheredb:
type: db
db: mysql
host: localhost
dbname: vspheredb
username: vspheredb
password: vspheredb
charset: utf8mb4
icingaweb2_modules:
vspheredb:
enabled: true
source: package
config:
db:
resource: vspheredb
```

## Database

The database can be created using the Geerlingguy mysql role.

For more parameters please check the [role documentation](https://github.com/geerlingguy/ansible-role-mysql)

Example:

```
mysql_databases:
- name: vspheredb
encoding: utf8mb4
collation: utf8mb4_general_ci
pre_tasks:
- ansible.builtin.include_role:
name: geerlingguy.mysql
```
1 change: 1 addition & 0 deletions roles/icingaweb2/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ icingaweb2_config_dir: /etc/icingaweb2
icingaweb2_group: icingaweb2
icingaweb2_modules_config_dir: "{{ icingaweb2_config_dir }}/modules"
icingaweb2_director_service: icinga-director.service
icingaweb2_vspheredb_service: icinga-vspheredb.service

icingaweb2_groups:
icingaweb2:
Expand Down
30 changes: 30 additions & 0 deletions roles/icingaweb2/tasks/modules/vspheredb.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
- name: Module Vspheredb | Install
debug:
msg: Installed VsphereDB Modul



- name: Module Vspheredb | Ensure config directory
ansible.builtin.file:
state: directory
dest: "{{ icingaweb2_modules_config_dir }}/vspheredb"
owner: "{{ icingaweb2_httpd_user }}"
group: "{{ icingaweb2_group }}"
mode: "2770"

- name: Module Vspheredb | Manage config files
ansible.builtin.include_tasks: manage_module_config.yml
loop: "{{ _files }}"
loop_control:
loop_var: _file
when: vars['icingaweb2_modules'][_module][_file] is defined
vars:
_module: "{{ item.key }}"
_files:
- config

- name: Module Vspheredb | Ensure daemon is running
ansible.builtin.service:
name: "{{ icingaweb2_vspheredb_service }}"
state: started
enabled: yes
3 changes: 2 additions & 1 deletion roles/icingaweb2/vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
icingaweb2_module_packages:
icingadb: icingadb-web
director: icinga-director
businessprocess: icinga-businessprocess
businessprocess: icinga-businessprocess
vspheredb: icingaweb2-module-vspheredb

0 comments on commit 765bf30

Please sign in to comment.