Skip to content

Commit

Permalink
syslog support
Browse files Browse the repository at this point in the history
  • Loading branch information
leighmacdonald committed Nov 29, 2024
1 parent f4316eb commit 6766cc5
Show file tree
Hide file tree
Showing 10 changed files with 71 additions and 62 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,6 @@
[submodule "sm_plugins/TF2_EngineerPVE"]
path = sm_plugins/TF2_EngineerPVE
url = https://github.com/MoonlyDays/TF2_EngineerPVE.git
[submodule "playbooks/roles/hadret.rsyslog"]
path = playbooks/roles/hadret.rsyslog
url = https://github.com/hadret/ansible-role-rsyslog
11 changes: 11 additions & 0 deletions playbooks/metrics.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
---
- name: Setup rsyslog
hosts: all
become: true
vars:
ansible_python_interpreter: python3
roles:
- role: hadret.rsyslog
tags:
- promtail
- rsyslog

- name: Setup metrics
hosts: all
roles:
Expand Down
3 changes: 1 addition & 2 deletions playbooks/roles/gbans/tasks/gbans.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
env:
DATABASE_URL: "{{ gbans_web.database_dsn }}"
ports:
- 127.0.0.1:8081:8080
- "{{ vpn_hosts[inventory_hostname].ip }}:8081:8080"
labels:
logging: "promtail"
logging_jobname: "containerlogs"
Expand All @@ -67,7 +67,6 @@
become: true
community.general.ufw:
interface_in: "wg0"
interface_out: "wg0"
rule: allow
port: "27715"
proto: udp
1 change: 1 addition & 0 deletions playbooks/roles/hadret.rsyslog
Submodule hadret.rsyslog added at 30c034
9 changes: 8 additions & 1 deletion playbooks/roles/metrics/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,24 @@
ansible.builtin.import_tasks: node_exporter.yml
tags:
- metrics-client
-

- name: Setup srcds_watch
ansible.builtin.import_tasks: srcds_watch.yml
tags:
- srcds_watch
- metrics-server

- name: Setup minio
ansible.builtin.import_tasks: minio.yml
tags:
- metrics-server

- name: Setup promtail
ansible.builtin.import_tasks: promtail.yml
tags:
- metrics-server
- promtail

- name: Setup prometheus
ansible.builtin.import_tasks: prometheus.yml
tags:
Expand Down
4 changes: 2 additions & 2 deletions playbooks/roles/metrics/tasks/minio.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@
volumes:
- minio-data:/data
ports:
# - 127.0.0.1:9000:9000
- "9001:9001"
- "127.0.0.1:9001:9001"
- "{{ vpn_hosts[inventory_hostname].ip }}:9001:9001"
3 changes: 0 additions & 3 deletions playbooks/roles/metrics/tasks/promtail.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
---

# - name: Enable rsyslog
# ansible.builtin.include_role:
# name: hadret.rsyslog

- name: Generate /etc/promtail.yml
become: true
Expand Down
1 change: 0 additions & 1 deletion playbooks/roles/metrics/templates/promtail.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ clients:
- url: {{ vpn_hosts[metrics_hostname].dns }}:3100/api/prom/push

scrape_configs:

- job_name: docker
docker_sd_configs:
- host: unix:///var/run/docker.sock
Expand Down
97 changes: 44 additions & 53 deletions playbooks/system.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,32 @@
content: |
GOVERNOR="performance"
- name: Download docker gpg key
become: true
become_user: root
ansible.builtin.apt_key:
url: https://download.docker.com/linux/ubuntu/gpg
state: present

- name: Add specified repository into sources list
become: true
become_user: root
ansible.builtin.apt_repository:
repo: deb https://download.docker.com/linux/ubuntu focal stable
state: present

- name: Enable i386 architecture # noqa no-changed-when
ansible.builtin.command: dpkg --add-architecture i386
when: result_i386_check.rc == 1

- name: Setup rsyslog
become: true
ansible.builtin.import_role:
name: hadret.rsyslog
tags:
- promtail
- rsyslog

- name: Install gpg & dd dependencies
when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu'
ansible.builtin.apt:
Expand All @@ -61,6 +83,28 @@
- cpufrequtils
- dotnet-sdk-6.0
- python3-netaddr
- wget
- apt-transport-https
- ca-certificates
- curl
- gnupg
- docker-ce
- docker-ce-cli
- containerd.io
- python3-docker
- libc6:i386
- lib32stdc++6
- rsyslog-gnutls

- name: Install extra OS Dependencies (<24.04)
when: ansible_distribution == 'Ubuntu' and ansible_distribution_version != "24.04"
ansible.builtin.apt:
update_cache: true
cache_valid_time: 0
state: present
pkg:
# Doesnt exist on newer distro versions
- python3-distutils

# - name: Install xanmod-rt-v2
# when: old_cpu
Expand Down Expand Up @@ -99,59 +143,6 @@
state: directory
mode: '0755'

- name: Download docker gpg key
become: true
become_user: root
ansible.builtin.apt_key:
url: https://download.docker.com/linux/ubuntu/gpg
state: present

- name: Add specified repository into sources list
become: true
become_user: root
ansible.builtin.apt_repository:
repo: deb https://download.docker.com/linux/ubuntu focal stable
state: present

- name: Install OS Dependencies (<24.04)
when: ansible_distribution == 'Ubuntu' and ansible_distribution_version != "24.04"
ansible.builtin.apt:
update_cache: true
cache_valid_time: 0
state: present
pkg:
- wget
- apt-transport-https
- ca-certificates
- curl
- gnupg
- docker-ce
- docker-ce-cli
- containerd.io
- python3-docker
# Doesnt exist on newer distro versions
- python3-distutils
- libc6:i386
- lib32stdc++6

- name: Install OS Dependencies
when: ansible_distribution == 'Ubuntu' and ansible_distribution_version == "24.04"
ansible.builtin.apt:
update_cache: true
cache_valid_time: 0
state: present
pkg:
- wget
- apt-transport-https
- ca-certificates
- curl
- gnupg
- docker-ce
- docker-ce-cli
- containerd.io
- python3-docker
- libc6:i386
- lib32stdc++6

- name: Reload systemd daemon
become: true
Expand Down
1 change: 1 addition & 0 deletions playbooks/web.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---

- name: Web Services
hosts: metrics
roles:
Expand Down

0 comments on commit 6766cc5

Please sign in to comment.