Supprimer tasks/install-proxy.yml
parent
f8cd9104cf
commit
2019da60b8
|
|
@ -1,100 +0,0 @@
|
|||
- name: Proxy - Install Debian Proxy packages
|
||||
ansible.builtin.apt:
|
||||
name: "{{ item }}"
|
||||
state: latest
|
||||
loop: "{{ debian_proxy_packages }}"
|
||||
tags:
|
||||
- install_proxy
|
||||
when: ansible_os_family == "Debian"
|
||||
|
||||
|
||||
- name: Proxy - Install RedHat packages
|
||||
ansible.builtin.dnf:
|
||||
name: "{{ item }}"
|
||||
state: latest
|
||||
loop: "{{ rhel_proxy_packages }}"
|
||||
tags:
|
||||
- install_proxy
|
||||
when: ansible_os_family == "RedHat"
|
||||
|
||||
- name: Proxy - Enable and start service mariadb
|
||||
ansible.builtin.service:
|
||||
name: mariadb
|
||||
state: started
|
||||
enabled: yes
|
||||
tags:
|
||||
- install_proxy
|
||||
|
||||
- name: Proxy - Generate mariadb proxy creation script
|
||||
ansible.builtin.template:
|
||||
src: create_proxy_db.j2
|
||||
dest: /tmp/create_proxy_db.sql
|
||||
tags:
|
||||
- install_proxy
|
||||
|
||||
- name: Proxy - Create mariadb proxy database
|
||||
ansible.builtin.shell: mysql -uroot < /tmp/create_proxy_db.sql
|
||||
tags:
|
||||
- install_proxy
|
||||
|
||||
- name: Proxy - Populate mariadb proxy database
|
||||
ansible.builtin.shell: 'cat /usr/share/zabbix/sql-scripts/mysql/proxy.sql | mysql --default-character-set=utf8mb4 -u{{proxy_db_user}} --password={{proxy_db_passwd}} {{proxy_db_name}}'
|
||||
tags:
|
||||
- install_proxy
|
||||
|
||||
- name: Find Group
|
||||
set_fact:
|
||||
my_group: "{{ group_names | first }}"
|
||||
|
||||
- name: Proxy - Génération la liste des servers
|
||||
set_fact:
|
||||
hotes_filtres: >-
|
||||
{{ groups[my_group] |
|
||||
map('extract', hostvars) |
|
||||
selectattr('role', 'in', 'srv') |
|
||||
map(attribute='inventory_hostname') |
|
||||
list }}
|
||||
|
||||
- name: Proxy - Set fact Server
|
||||
set_fact:
|
||||
Server: "{{ hotes_filtres | join(';') }}"
|
||||
|
||||
- name: Proxy - Generate config
|
||||
ansible.builtin.template:
|
||||
src: zabbix_proxy.conf.j2
|
||||
dest: /etc/zabbix/zabbix_proxy.conf
|
||||
owner: root
|
||||
group: zabbix
|
||||
mode: 400
|
||||
|
||||
tags:
|
||||
- install_proxy
|
||||
|
||||
- name: Proxy - Create certificats directory
|
||||
ansible.builtin.file:
|
||||
path: "/etc/zabbix/certs"
|
||||
state: directory
|
||||
recurse: yes
|
||||
owner: zabbix
|
||||
group: zabbix
|
||||
when: zabbix_crypt=="tls"
|
||||
|
||||
- name: Proxy - Copy certificats
|
||||
ansible.builtin.copy:
|
||||
src: "{{ item }}"
|
||||
dest: "/etc/zabbix/certs/{{ item }}"
|
||||
owner: zabbix
|
||||
group: zabbix
|
||||
loop:
|
||||
- "{{ zabbix_ca}}.crt"
|
||||
- "{{ zabbix_proxy}}.crt"
|
||||
- "{{ zabbix_proxy}}.key"
|
||||
when: zabbix_crypt=="tls"
|
||||
|
||||
- name: Proxy - Enable and start service zabbix proxy
|
||||
ansible.builtin.service:
|
||||
name: "{{ item }}"
|
||||
state: restarted
|
||||
enabled: true
|
||||
loop:
|
||||
- zabbix-proxy
|
||||
Loading…
Reference in New Issue