bitwarden

This commit is contained in:
jaydee 2024-07-25 14:00:42 +02:00
parent a2ba1ae83e
commit 92f3fea8d0

View File

@ -1,7 +1,7 @@
- hosts: datacenter - hosts: datacenter
name: Install zabbix agent name: Install zabbix agent
vars: vars:
ZABBIX_SERVER_IP: "192.168.77.216" ZABBIX_SERVER: "zabbix-server.lan"
tasks: tasks:
- name: Combine list1 and list2 into a merged_list var - name: Combine list1 and list2 into a merged_list var
@ -85,7 +85,7 @@
ansible.builtin.lineinfile: ansible.builtin.lineinfile:
path: "{{ zabbix_agent_cfg }}" path: "{{ zabbix_agent_cfg }}"
regexp: "^ServerActive=.*" regexp: "^ServerActive=.*"
line: "ServerActive={{ ZABBIX_SERVER_IP }}" line: "ServerActive={{ ZABBIX_SERVER }}"
become: "{{ 'no' if inventory_hostname in groups['nas'] else 'yes' }}" become: "{{ 'no' if inventory_hostname in groups['nas'] else 'yes' }}"
- name: Reconfigure zabbix agent ListenPort - name: Reconfigure zabbix agent ListenPort
@ -108,11 +108,18 @@
- name: Reconfigure zabbix-agent2 hostname - name: Reconfigure zabbix-agent2 hostname
ansible.builtin.lineinfile: ansible.builtin.lineinfile:
path: "{{ zabbix_agent_cfg }}" path: "{{ zabbix_agent_cfg }}"
regexp: "^UserParameter=.*"
insertafter: '^# UserParameter=' insertafter: '^# UserParameter='
line: "UserParameter=system.temperature,vcgencmd measure_temp" line: "UserParameter=system.temperature,vcgencmd measure_temp"
become: "{{ 'no' if inventory_hostname in groups['nas'] else 'yes' }}" become: "{{ 'no' if inventory_hostname in groups['nas'] else 'yes' }}"
- name: Reconfigure zabbix-agent2 config
ansible.builtin.lineinfile:
path: "{{ zabbix_agent_cfg }}"
insertafter: '^# UserParameter='
line: "UserParameter=system.certs,python3 /share/ZFS530_DATA/.qpkg/ZabbixAgent/cert_check2.py"
become: "{{ 'no' if inventory_hostname in groups['nas'] else 'yes' }}"
when: inventory_hostname not in groups['nas']
- name: Reconfigure zabbix-agent2 hostname - name: Reconfigure zabbix-agent2 hostname
ansible.builtin.lineinfile: ansible.builtin.lineinfile:
path: "{{ zabbix_agent_cfg }}" path: "{{ zabbix_agent_cfg }}"