add roles

This commit is contained in:
2023-09-23 18:47:53 +02:00
parent d143c47875
commit fce433a83a
3 changed files with 120 additions and 3 deletions

35
all.yml
View File

@@ -31,10 +31,43 @@
- { role: willshersystems.sshd, tags: ssh }
- { role: claranet.apt, tags: apt }
- { role: robertdebock.fail2ban, tags: ban }
- { role: ome.rsync_server, tags: rsync }
- { role: nickhammond.logrotate, tags: log,
vars: "{{ logrotate_files }}"
}
tasks:
- name: Ensure scripts directory exist
file:
path: /usr/local/scripts/
state: directory
owner: root
group: root
mode: 0755
tags:
- alerts
- name: create the main alertings bash script file
template:
src: "../templates/alerts.sh.j2"
dest: "/usr/local/scripts/alerts.sh"
owner: root
group: root
mode: 0744
tags:
- alerts
- name: Creates a cron file for alerts under /etc/cron.d
ansible.builtin.cron:
name: "{{ item.name }}"
weekday: "{{ item.weekday }}"
minute: "{{ item.minute }}"
hour: "{{ item.hour }}"
user: "{{ item.user }}"
job: "{{ item.job }}"
cron_file: "{{ item.cron_file }}"
loop: "{{ alerts_cron }}"
# - name: Show ssh backup
# debug:
# msg: "{{ ssh_backup }}"