migrate from github

This commit is contained in:
donotos
2021-09-05 19:31:17 +02:00
commit 4151d0b348
10 changed files with 139 additions and 0 deletions

40
zabbix_add_script.yml Normal file
View File

@@ -0,0 +1,40 @@
---
- name: Modifier zabbix_agentd.conf et sudoer pour que zabbix puisse executer des scripts sur l'hote.
hosts: all
tasks:
- name: Ajouter "AllowKey=system.run[*]" a /etc/zabbix/zabbix_agentd.conf
lineinfile:
path: /etc/zabbix/zabbix_agentd.conf
state: present
line: "AllowKey=system.run[*]"
regexp: "AllowKey=system.run[*]"
insertbefore: "### Option: LogRemoteCommands"
- name: Commenter "DenyKey=system.run[*]" dans /etc/zabbix/zabbix_agentd.conf
lineinfile:
path: /etc/zabbix/zabbix_agentd.conf
state: present
firstmatch: yes
regexp: '^DenyKey='
line: "#DenyKey=system.run[*]"
backrefs: yes
- name: Make sure we have a 'zabbix' group
group:
name: zabbix
state: present
- name: Allow 'zabbix' group to have passwordless sudo
lineinfile:
path: /etc/sudoers
state: present
regexp: '%zabbix'
insertafter: '^%sudo'
line: '%zabbix ALL=(ALL) NOPASSWD:{{ sudo_call_path }}'
validate: visudo -cf %s
- name: Redemarrer le process "zabbix_agent"
systemd:
name: zabbix-agent
state: restarted