mirror of
https://github.com/FAUSheppy/no-secrets-athq-ansible
synced 2025-12-06 17:41:36 +01:00
chore: enable filebeat for all hosts
This commit is contained in:
@@ -16,8 +16,7 @@
|
|||||||
roles:
|
roles:
|
||||||
- { role : signal, tags : [ "signal" ] }
|
- { role : signal, tags : [ "signal" ] }
|
||||||
|
|
||||||
- hosts:
|
- hosts: all
|
||||||
- kube1
|
|
||||||
strategy: free
|
strategy: free
|
||||||
roles:
|
roles:
|
||||||
- { role : filebeat, tags : [ "filebeat" ] }
|
- { role : filebeat, tags : [ "filebeat" ] }
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
- apt-file
|
- apt-file
|
||||||
- htop
|
- htop
|
||||||
- ncdu
|
- ncdu
|
||||||
|
- gpg
|
||||||
|
|
||||||
- name: Ensure Opt dir exists and accessible
|
- name: Ensure Opt dir exists and accessible
|
||||||
file:
|
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:
|
ansible.builtin.systemd:
|
||||||
name: filebeat
|
name: filebeat
|
||||||
enabled: yes
|
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:
|
filebeat.inputs:
|
||||||
|
|
||||||
- type: filestream
|
- type: filestream
|
||||||
id: kube1-var-log
|
id: kube1-var-log
|
||||||
enabled: true
|
enabled: true
|
||||||
paths:
|
paths:
|
||||||
- /var/log/*.log
|
- /var/log/syslog
|
||||||
|
fields:
|
||||||
|
syslog: true
|
||||||
|
processors:
|
||||||
|
- syslog:
|
||||||
|
field: message
|
||||||
|
|
||||||
- type: log
|
- type: log
|
||||||
paths:
|
paths:
|
||||||
|
|||||||
Reference in New Issue
Block a user