simple roles for ansible
Role for add sudoer user
Create remote user and copy rsa key
Params:
-username: User name will be created
Example ansible-playbook adduser.yml -e "hostname=test2" -e "ansible_user=root" -K
user test - root user on remote host
Role for notify about apt packages update
Params:
-mailto: mail for notify -mailon: 'changes' -dma_smarthost: smtp server
Example ansible-playbook cron-apt.yml -e "hostname=test2"
Role for mail notify on ssh logon
Params:
-domain: mail domain -recepient: recepient -dma_smarthost: smtp server
Example ansible-playbook logon-notify-mail.yml -e "hostname=test2"
Role to config zabbix for monitoring fail2ban
zabbix-agent install with task zabbix.yml and fail2ban must be install manual
Role automate steps from https://github.com/hermanekt/zabbix-fail2ban-discovery-
vars
zabbix_Server: "zabbix-server"
zabbix_ServerActive: "zabbix-server"
agent_Hostname: "client-host"
agent_TLSPSKIdentity: "client-host"
tasks/zabbix-install.yml
install/update zabbix-agent 5
create psk.key if not exist
configure zabbix_agentd.conf
open firewall port 10050
ytasks/zabbix.yml
add permit for /var/log/auth.log for read this from zabbix-server