|
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" |
4 | 51 |
|
| 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 |
5 | 57 |
|
| 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 |
6 | 60 |
|
7 |
| -- name: Module Vspheredb | Ensure config directory |
| 61 | +- name: Module vSphereDB | Ensure config directory |
8 | 62 | ansible.builtin.file:
|
9 | 63 | state: directory
|
10 | 64 | dest: "{{ icingaweb2_modules_config_dir }}/vspheredb"
|
11 | 65 | owner: "{{ icingaweb2_httpd_user }}"
|
12 | 66 | group: "{{ icingaweb2_group }}"
|
13 | 67 | mode: "2770"
|
14 | 68 |
|
15 |
| -- name: Module Vspheredb | Manage config files |
| 69 | +- name: Module vSphereDB | Manage config files |
16 | 70 | ansible.builtin.include_tasks: manage_module_config.yml
|
17 | 71 | loop: "{{ _files }}"
|
18 | 72 | loop_control:
|
|
23 | 77 | _files:
|
24 | 78 | - config
|
25 | 79 |
|
26 |
| -- name: Module Vspheredb | Ensure daemon is running |
| 80 | +- name: Module vSphereDB | Ensure daemon is running |
27 | 81 | ansible.builtin.service:
|
28 | 82 | name: "{{ icingaweb2_vspheredb_service }}"
|
29 | 83 | state: started
|
30 | 84 | enabled: yes
|
| 85 | + failed_when: false # this is a bit buggy because we only activate the module later in the role |
0 commit comments