ansible playbooks for retailor.io infrastructure

This commit is contained in:
2025-03-03 19:33:36 +01:00
committed by KevinMidboe
commit 92cb10ba27
139 changed files with 33603 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
---
- name: Get fail2ban release download url
uri:
url: "https://gitlab.com/hctrdev/fail2ban-prometheus-exporter/-/releases/v{{ fail2ban_exporter_version }}/downloads/fail2ban_exporter_{{ fail2ban_exporter_version }}_linux_amd64.tar.gz"
follow_redirects: all
register: fail2ban_download_url
- name: Download fail2ban Exporter
get_url:
url: "{{ fail2ban_download_url.url }}"
dest: "/tmp/fail2ban_exporter.tar.gz"
- name: Extract fail2ban Exporter
unarchive:
src: "/tmp/fail2ban_exporter.tar.gz"
dest: "/tmp"
remote_src: yes
- name: Move fail2ban Exporter binary
copy:
src: "/tmp/fail2ban_exporter"
dest: "/usr/sbin/fail2ban_exporter"
remote_src: yes
mode: '0755'

View File

@@ -0,0 +1,3 @@
---
- include_tasks: install.yaml
- include_tasks: service.yml

View File

@@ -0,0 +1,23 @@
---
- name: Create fail2ban_exporter service file
template:
src: "fail2ban_exporter.service.j2"
dest: "/etc/systemd/system/fail2ban_exporter.service"
mode: '0644'
tags:
- create_service
- name: Reload systemd to pick up the fail2ban_exporter service
systemd:
daemon_reload: yes
tags:
- reload_systemd
- name: Enable and start the fail2ban_exporter service
systemd:
name: fail2ban_exporter
state: started
enabled: yes
tags:
- start_fail2ban_exporter