App PHP (php8.4-fpm) + nginx local, exposée par l'edge (auto-dérivé). Config par fichiers .ini (config/resources/authentication/roles + module icingadb), pas d'assistant. Base IcingaDB via resoudre_base. Auth LDAP direct (client_pki sur sup-01) — pas d'OIDC natif (SSO-proxy = raffinement). Prouvé : testmail (LDAP) se connecte (/dashboard), module IcingaDB affiche la supervision (hôte icinga). Déploiement failed=0 (frictions dans le simulateur curl, pas le rôle). Reste : module BPM. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
84 lines
2.5 KiB
YAML
84 lines
2.5 KiB
YAML
---
|
|
- name: Résoudre la base IcingaDB depuis le registre (rôle partagé)
|
|
ansible.builtin.include_role:
|
|
name: resoudre_base
|
|
vars:
|
|
resoudre_base_groupe: "{{ serveur_icingaweb2_icinga_groupe }}"
|
|
|
|
- name: Installer Icinga Web 2 + module IcingaDB + PHP-FPM + nginx
|
|
ansible.builtin.apt:
|
|
name: "{{ serveur_icingaweb2_paquets }}"
|
|
state: present
|
|
update_cache: true
|
|
|
|
- name: Ajouter www-data au groupe icingaweb2 (lecture de la config)
|
|
ansible.builtin.user:
|
|
name: www-data
|
|
groups: icingaweb2
|
|
append: true
|
|
notify: Redémarrer php-fpm
|
|
|
|
- name: Assurer le répertoire du module IcingaDB
|
|
ansible.builtin.file:
|
|
path: "{{ serveur_icingaweb2_config_dir }}/modules/icingadb"
|
|
state: directory
|
|
owner: root
|
|
group: icingaweb2
|
|
mode: "0750"
|
|
|
|
- name: Déployer la configuration icingaweb2 (.ini)
|
|
ansible.builtin.template:
|
|
src: "{{ item.s }}"
|
|
dest: "{{ serveur_icingaweb2_config_dir }}/{{ item.d }}"
|
|
owner: root
|
|
group: icingaweb2
|
|
mode: "0640"
|
|
no_log: "{{ item.secret | default(false) }}"
|
|
loop:
|
|
- { s: config.ini.j2, d: config.ini }
|
|
- { s: resources.ini.j2, d: resources.ini, secret: true }
|
|
- { s: authentication.ini.j2, d: authentication.ini }
|
|
- { s: roles.ini.j2, d: roles.ini }
|
|
- { s: icingadb-config.ini.j2, d: modules/icingadb/config.ini }
|
|
- { s: icingadb-redis.ini.j2, d: modules/icingadb/redis.ini }
|
|
loop_control:
|
|
label: "{{ item.d }}"
|
|
notify: Redémarrer php-fpm
|
|
|
|
- name: Activer le module IcingaDB
|
|
ansible.builtin.command: icingacli module enable icingadb
|
|
args:
|
|
creates: "{{ serveur_icingaweb2_config_dir }}/enabledModules/icingadb"
|
|
when: not ansible_check_mode
|
|
|
|
- name: Déployer le vhost nginx local d'Icinga Web 2
|
|
ansible.builtin.template:
|
|
src: nginx.conf.j2
|
|
dest: /etc/nginx/sites-available/icingaweb2.conf
|
|
owner: root
|
|
group: root
|
|
mode: "0644"
|
|
notify: Recharger nginx
|
|
|
|
- name: Activer le vhost Icinga Web 2
|
|
ansible.builtin.file:
|
|
src: /etc/nginx/sites-available/icingaweb2.conf
|
|
dest: /etc/nginx/sites-enabled/icingaweb2.conf
|
|
state: link
|
|
notify: Recharger nginx
|
|
|
|
- name: Retirer le site nginx par défaut
|
|
ansible.builtin.file:
|
|
path: /etc/nginx/sites-enabled/default
|
|
state: absent
|
|
notify: Recharger nginx
|
|
|
|
- name: Activer et démarrer PHP-FPM et nginx
|
|
ansible.builtin.systemd:
|
|
name: "{{ item }}"
|
|
enabled: true
|
|
state: started
|
|
loop:
|
|
- "{{ serveur_icingaweb2_php_fpm_service }}"
|
|
- "{{ serveur_icingaweb2_nginx_service }}"
|
|
when: not ansible_check_mode
|