mirror of
https://gitlab.sectorq.eu/jaydee/ansible.git
synced 2025-01-23 12:38:11 +00:00
initial
This commit is contained in:
parent
0f72226de7
commit
5259f05665
@ -2,3 +2,4 @@
|
||||
ansible.builtin.service:
|
||||
name: docker.service
|
||||
state: restarted
|
||||
become: true
|
@ -77,8 +77,8 @@
|
||||
path: "{{ zabbix_agent_cfg }}"
|
||||
regexp: "^Server=.*"
|
||||
insertafter: '^# Server='
|
||||
line: "Server=192.168.77.0/24,192.168.80.0/28"
|
||||
become: "{{ false if inventory_hostname == 'nas.home.lan' else true }}"
|
||||
line: "Server=192.168.77.0/24,172.30.0.0/24"
|
||||
|
||||
|
||||
- name: Reconfigure zabbix agent ServerActive
|
||||
ansible.builtin.lineinfile:
|
||||
@ -86,6 +86,7 @@
|
||||
regexp: "^ServerActive=.*"
|
||||
line: "ServerActive={{ ZABBIX_SERVER }}"
|
||||
|
||||
|
||||
- name: Reconfigure zabbix agent ListenPort
|
||||
ansible.builtin.lineinfile:
|
||||
path: "{{ zabbix_agent_cfg }}"
|
||||
@ -97,19 +98,31 @@
|
||||
# regexp: "^ListenIP=.*"
|
||||
# line: "ListenIP=0.0.0.0"
|
||||
|
||||
|
||||
- name: Reconfigure zabbix-agent2 hostname
|
||||
ansible.builtin.lineinfile:
|
||||
path: "{{ zabbix_agent_cfg }}"
|
||||
regexp: "^Hostname=.*"
|
||||
line: "Hostname={{ inventory_hostname }}"
|
||||
|
||||
|
||||
- name: Reconfigure zabbix-agent2 config
|
||||
ansible.builtin.lineinfile:
|
||||
path: "{{ zabbix_agent_cfg }}"
|
||||
insertafter: '^# UserParameter='
|
||||
regexp: "^UserParameter=system.certs.*"
|
||||
line: "UserParameter=system.certs,python3 /share/ZFS530_DATA/.qpkg/ZabbixAgent/cert_check2.py"
|
||||
when: inventory_hostname == 'nas.home.lan' or inventory_hostname == 'm-server.home.lan'
|
||||
when: inventory_hostname == 'nas.home.lan'
|
||||
|
||||
|
||||
- name: Reconfigure zabbix-agent2 config
|
||||
ansible.builtin.lineinfile:
|
||||
path: "{{ zabbix_agent_cfg }}"
|
||||
insertafter: '^# UserParameter='
|
||||
regexp: "^UserParameter=system.certs.*"
|
||||
line: "UserParameter=system.certs,python3 /usr/bin/cert_check2.py"
|
||||
when: inventory_hostname == 'm-server.home.lan'
|
||||
|
||||
|
||||
- name: Reconfigure zabbix-agent2 config
|
||||
ansible.builtin.lineinfile:
|
||||
@ -118,12 +131,16 @@
|
||||
line: "UserParameter=rpi.hw.temp,/usr/bin/vcgencmd measure_temp"
|
||||
when: inventory_hostname == 'rpi5.home.lan'
|
||||
|
||||
|
||||
- name: Reconfigure zabbix-agent2 hostname
|
||||
ansible.builtin.lineinfile:
|
||||
path: "{{ zabbix_agent_cfg }}"
|
||||
regexp: "^HostMetadata=.*"
|
||||
insertafter: '^# HostMetadata='
|
||||
line: "HostMetadata=linux;jaydee"
|
||||
|
||||
|
||||
|
||||
- name: Reconfigure zabbix-agent2 hostname
|
||||
ansible.builtin.lineinfile:
|
||||
path: "{{ zabbix_agent_cfg }}"
|
||||
@ -132,6 +149,8 @@
|
||||
line: "HostMetadata=server;jaydee"
|
||||
when: inventory_hostname == 'nas.home.lan' or inventory_hostname == 'm-server.home.lan'
|
||||
|
||||
|
||||
|
||||
- name: Add the user 'to group video
|
||||
ansible.builtin.user:
|
||||
name: zabbix
|
||||
@ -139,6 +158,7 @@
|
||||
append: yes
|
||||
when: inventory_hostname != 'nas.home.lan'
|
||||
|
||||
|
||||
- name: Restart zabbix-agent2 service
|
||||
ansible.builtin.service:
|
||||
name: zabbix-agent2.service
|
||||
@ -146,9 +166,10 @@
|
||||
enabled: true
|
||||
when: inventory_hostname != 'nas.home.lan'
|
||||
|
||||
|
||||
- name: Restart agent
|
||||
ansible.builtin.shell: /etc/init.d/ZabbixAgent.sh restart
|
||||
when: inventory_hostname == 'nas.home.lan'
|
||||
|
||||
|
||||
become: true
|
||||
become: "{{ false if inventory_hostname == 'nas.home.lan' else true }}"
|
@ -1,5 +1,5 @@
|
||||
---
|
||||
- hosts: servers
|
||||
- hosts: containers
|
||||
roles:
|
||||
- name: common
|
||||
tags: common
|
||||
@ -21,3 +21,5 @@
|
||||
tags: ldap_client
|
||||
- name: ssh_banner
|
||||
tags: ssh_banner
|
||||
- name: omv_backup
|
||||
tags: omv_backup
|
Loading…
x
Reference in New Issue
Block a user