mirror of
https://github.com/FAUSheppy/no-secrets-athq-ansible
synced 2025-12-06 07:41:36 +01:00
chore: enable filebeat for all hosts
This commit is contained in:
@@ -16,8 +16,7 @@
|
||||
roles:
|
||||
- { role : signal, tags : [ "signal" ] }
|
||||
|
||||
- hosts:
|
||||
- kube1
|
||||
- hosts: all
|
||||
strategy: free
|
||||
roles:
|
||||
- { role : filebeat, tags : [ "filebeat" ] }
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
- apt-file
|
||||
- htop
|
||||
- ncdu
|
||||
- gpg
|
||||
|
||||
- name: Ensure Opt dir exists and accessible
|
||||
file:
|
||||
|
||||
5
roles/base/templates/wg-client.conf
Normal file
5
roles/base/templates/wg-client.conf
Normal file
@@ -0,0 +1,5 @@
|
||||
[Peer]
|
||||
PublicKey = {{ hypervisor_wg_public_key }}
|
||||
Endpoint= {{ hypervisor_internal_ip }}:51820
|
||||
AllowedIPs = 0.0.0.0/0
|
||||
PersistentKeepalive = 21
|
||||
11
roles/base/templates/wg-hypervisor.conf
Normal file
11
roles/base/templates/wg-hypervisor.conf
Normal file
@@ -0,0 +1,11 @@
|
||||
[Interface]
|
||||
PrivateKey = <server_private_key>
|
||||
Address = 10.0.0.1/24
|
||||
ListenPort = 51820
|
||||
|
||||
{% for client in clients %}
|
||||
# {{ client.name }}
|
||||
[Peer]
|
||||
PublicKey = <client1_public_key>
|
||||
AllowedIPs = 10.0.0.{{ loop.index + }}/32
|
||||
{% endfor %}
|
||||
4
roles/filebeat/handlers/main.yml
Normal file
4
roles/filebeat/handlers/main.yml
Normal file
@@ -0,0 +1,4 @@
|
||||
- name: restart filebeat
|
||||
systemd:
|
||||
name: filebeat
|
||||
state: restarted
|
||||
@@ -31,3 +31,10 @@
|
||||
ansible.builtin.systemd:
|
||||
name: filebeat
|
||||
enabled: yes
|
||||
|
||||
- name: copy filebeat config
|
||||
template:
|
||||
src: filebeat.yml
|
||||
dest: /etc/filebeat/filebeat.yml
|
||||
notify:
|
||||
- restart filebeat
|
||||
|
||||
@@ -1,10 +1,16 @@
|
||||
logging.level: error
|
||||
filebeat.inputs:
|
||||
|
||||
- type: filestream
|
||||
id: kube1-var-log
|
||||
enabled: true
|
||||
paths:
|
||||
- /var/log/*.log
|
||||
- /var/log/syslog
|
||||
fields:
|
||||
syslog: true
|
||||
processors:
|
||||
- syslog:
|
||||
field: message
|
||||
|
||||
- type: log
|
||||
paths:
|
||||
|
||||
Reference in New Issue
Block a user