Debut de separation par distribution + ajout keepalived

This commit is contained in:
stef
2026-02-16 22:20:56 +00:00
parent 618c5ef1a0
commit f3855df1a8
15 changed files with 741 additions and 54 deletions

View File

@@ -2,73 +2,66 @@
# tasks file for zabbix
- name: check OS version
debug: var=ansible_os_family
- name: include os variables
include_vars: "{{ansible_os_family}}.yml"
tags: always
- name: Prepare RHEL
block:
- name: Alma Repo
ansible.builtin.shell:
cmd: rpm -Uvh https://repo.zabbix.com/zabbix/7.0/alma/9/x86_64/zabbix-release-latest.el9.noarch.rpm
cmd: "rpm -Uvh {{repo}}"
- name: disable firewall
ansible.builtin.service:
name: firewalld
state: stopped
enabled: false
name: firewalld
state: stopped
enabled: false
- name: clean repo
ansible.builtin.shell:
cmd: dnf clean all
when: ansible_os_family == "RedHat"
- name: Prepare Debian
block:
- name: Debian Repo
ansible.builtin.apt:
deb: https://repo.zabbix.com/zabbix/7.4/release/debian/pool/main/z/zabbix-release/zabbix-release_latest_7.4+debian13_all.deb
deb: "{{repo}}"
- name: Mise à jour le cache des paquets
ansible.builtin.apt:
update_cache: yes
when: ansible_os_family == "Debian"
- name: Install Database
- name: Database - Install
when: role == "db"
block:
- name: Install Zabbix DB
ansible.builtin.include_tasks: install-db.yml
ansible.builtin.include_tasks: "{{ansible_os_family}}/install-db.yml"
when: role == "db"
tags:
- database
tags:
- install_db
- name: Install server
- name: Server - Install
ansible.builtin.include_tasks: "{{ansible_os_family}}/install-srv.yml"
when: role == "srv"
block:
- name: Install Zabbix Server
ansible.builtin.include_tasks: install-srv.yml
when: role == "srv"
tags:
- install_srv
- name: Install zabbix_proxy
when: role == "proxy"
block:
- name: Install Zabbix Proxy
ansible.builtin.include_tasks: install-proxy.yml
when: role == "proxy"
- name: Proxy - Install
ansible.builtin.include_tasks: "{{ansible_os_family}}/install-proxy.yml"
tags:
- install_proxy
when: role == "proxy"
- name: Install Front
when: role == "front"
block:
- name: Install Zabbix Front
ansible.builtin.include_tasks: install-front.yml
when: role == "front"
- name: Front - Install
ansible.builtin.include_tasks: "{{ansible_os_family}}/install-front.yml"
when: role == "srv"
tags:
- install_front
- name: Install Agent
block:
- name: Install Zabbix Agent
ansible.builtin.include_tasks: install-agent2.yml
ansible.builtin.include_tasks: "{{ansible_os_family}}/install-agent2.yml"
tags:
- install_agent
- never