Supprimer tasks/install-agent2.yml

main
stef 2026-02-18 22:29:13 +01:00
parent 92bd2ccc24
commit 34b0e277c1
1 changed files with 0 additions and 76 deletions

View File

@ -1,76 +0,0 @@
- name: Install Agent2 Debian packages
ansible.builtin.apt:
name: "{{ item }}"
state: latest
loop: "{{ debian_agent_packages }}"
tags:
- install_srv
when: ansible_os_family == "Debian"
- name: Install packages
ansible.builtin.dnf:
name: "{{ item }}"
state: latest
loop: "{{ rhel_agent_packages }}"
tags:
- install_srv
when: ansible_os_family == "RedHat"
- name: Find Group
set_fact:
my_group: "{{ group_names | first }}"
- name: Créer la liste des hôtes correspondant aux rôles cibles
set_fact:
hotes_filtres: >-
{{ groups[my_group] |
map('extract', hostvars) |
selectattr('role', 'in', roles_cibles) |
map(attribute='inventory_hostname') |
list }}
- name: Generate Server List
set_fact:
Server: "{{ hotes_filtres | join(',') }}"
- name: Generate ActiveServer List
set_fact:
ServerActive: "{{ hotes_filtres | join(';') }}"
- name: Generate agent2 config
ansible.builtin.template:
src: zabbix_agent2.conf.j2
dest: /etc/zabbix/zabbix_agent2.conf
owner: zabbix
group: zabbix
mode: 0640
- name: Create cert directory if zabbix_crypt=="tls"
ansible.builtin.file:
path: "/etc/zabbix/certs"
state: directory
recurse: yes
owner: zabbix
group: zabbix
when: zabbix_crypt=="tls"
- name: Copy Certificats
ansible.builtin.copy:
src: "{{ item }}"
dest: "/etc/zabbix/certs/{{ item }}"
owner: zabbix
group: zabbix
loop:
- "{{ zabbix_ca }}.crt"
- "{{ zabbix_agent }}.crt"
- "{{ zabbix_agent }}.key"
when: zabbix_crypt=="tls"
- name: Enable and start service zabbix agent2
ansible.builtin.service:
name: "{{ item }}"
state: restarted
enabled: true
loop:
- zabbix-agent2