Skip to content

Commit

Permalink
Add build/lint workflows and fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
leighmacdonald committed Sep 29, 2024
1 parent 17ba35c commit 17d6186
Show file tree
Hide file tree
Showing 18 changed files with 58 additions and 43 deletions.
3 changes: 3 additions & 0 deletions .ansible-lint
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ exclude_paths:
- group_vars/*
- hosts.yml
- .ansible-lint
- sm_plugins/*
- playbooks/roles/githubixx.ansible_role_wireguard/*

skip_list:
- schema
Expand All @@ -16,6 +18,7 @@ skip_list:
- risky-shell-pipe
- name[casing]
- name[play]
- ignore-errors

kinds:
- tasks: "*/tasks/*.yml"
44 changes: 25 additions & 19 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,30 @@ on: [push, pull_request]

jobs:
lint:
runs-on: ubuntu-20.04
name: Ansible Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

# publish:
# runs-on: ubuntu-20.04
# needs: [lint]
# steps:
# - uses: actions/checkout@v2
#
# - name: Build srcds image
# uses: arillso/action.playbook@master
- uses: actions/checkout@v4
- name: Run ansible-lint
uses: ansible/ansible-lint@main
# # optional (see below):
# with:
# limit: localhost
# vault_password: ${{ secrets.VAULT_SECRET}}
# playbook: playbooks/srcds_github.yml
# inventory: hosts.yml
# galaxy_file: collections/requirements.yml
# env:
# ANSIBLE_HOST_KEY_CHECKING: 'false'
# ANSIBLE_DEPRECATION_WARNINGS: 'false'
# args: ""
# setup_python: "true"
# working_directory: ""
# requirements_file: ""

sourcemod:
name: Build Plugins
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup SourcePawn Compiler
uses: rumblefrog/setup-sp@master
with:
version: "1.12.x"

- name: Ensure plugin builds
working-directory: ./sourcemod/scripting
run: ./compile.sh
9 changes: 9 additions & 0 deletions .github/workflows/sourcemod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: Build Sourcemod

on:
push:
pull_request:

permissions: write-all

jobs:
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ format:
@find ./roles/sourcemod/files/addons/sourcemod/scripting -regex '.*\.\(sp\)' -exec clang-format -style=file -i {} \;

lint:
@ansible-lint
@ansible-lint --exclude sm_plugins watcher

deps:
@ansible-galaxy collection install -r collections/requirements.yml
Expand Down
8 changes: 4 additions & 4 deletions playbooks/roles/gbans/tasks/postgres.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,16 @@
"-c", "password_encryption=md5",
"-c", "max_connections=125",
"-c", "shared_buffers=1GB",
#"-c", "effective_cache_size=6GB",
#"-c", "maintenance_work_mem=2GB",
# "-c", "effective_cache_size=6GB",
# "-c", "maintenance_work_mem=2GB",
"-c", "checkpoint_completion_target=0.9",
"-c", "wal_buffers=16MB",
"-c", "default_statistics_target=100",
"-c", "random_page_cost=1.1",
"-c", "effective_io_concurrency=200",
"-c", "work_mem=10485kB",
#"-c", "min_wal_size=1GB",
#"-c", "max_wal_size=4GB",
# "-c", "min_wal_size=1GB",
# "-c", "max_wal_size=4GB",
"-c", "max_worker_processes=8",
"-c", "max_parallel_workers_per_gather=4",
"-c", "max_parallel_workers=8",
Expand Down
2 changes: 1 addition & 1 deletion playbooks/roles/gbans/tasks/tf2bdd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@
logging_jobname: "containerlogs"
networks:
- name: caddy_net
ignore_errors: true
# ignore_errors: true
1 change: 0 additions & 1 deletion playbooks/roles/metrics/tasks/grafana.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,4 +101,3 @@
- 127.0.0.1:3000:3000
tags:
- grafana

1 change: 0 additions & 1 deletion playbooks/roles/metrics/tasks/loki.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,3 @@
- "{{ vpn_hosts[metrics_hostname].ip }}:3100:3100"
tags:
- loki

2 changes: 1 addition & 1 deletion playbooks/roles/metrics/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
tags:
- metrics-server

#- name: mimir
# - name: mimir
# import_tasks: mimir.yml
# tags:
# - metrics-server
Expand Down
2 changes: 1 addition & 1 deletion playbooks/roles/metrics/tasks/mimir.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
restart: true
purge_networks: true
restart_policy: unless-stopped
command: [ "--config.file=/etc/mimir.yml" ]
command: ["--config.file=/etc/mimir.yml"]
labels:
logging: "promtail"
logging_jobname: "containerlogs"
Expand Down
2 changes: 1 addition & 1 deletion 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
# - 127.0.0.1:9000:9000
- "9001:9001"
2 changes: 1 addition & 1 deletion playbooks/roles/metrics/tasks/promtail.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---

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

Expand Down
2 changes: 1 addition & 1 deletion playbooks/roles/metrics/tasks/tempo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
docker_container:
name: tempo
image: grafana/tempo:latest
command: [ "-config.file=/etc/tempo.yml" ]
command: ["-config.file=/etc/tempo.yml"]
restart: true
pull: true
purge_networks: true
Expand Down
6 changes: 3 additions & 3 deletions playbooks/roles/sourcemod/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
src: "{{ metamod_download|default(\"https://mms.alliedmods.net/mmsdrop/1.12/mmsource-1.12.0-git1194-linux.tar.gz\") }}"

Check warning on line 16 in playbooks/roles/sourcemod/tasks/main.yml

View workflow job for this annotation

GitHub Actions / Ansible Lint

jinja[spacing]

Jinja2 spacing could be improved: {{ metamod_download|default("https://mms.alliedmods.net/mmsdrop/1.12/mmsource-1.12.0-git1194-linux.tar.gz") }} -> {{ metamod_download | default("https://mms.alliedmods.net/mmsdrop/1.12/mmsource-1.12.0-git1194-linux.tar.gz") }}

Check warning on line 16 in playbooks/roles/sourcemod/tasks/main.yml

View workflow job for this annotation

GitHub Actions / Ansible Lint

jinja[spacing]

Jinja2 spacing could be improved: {{ metamod_download|default("https://mms.alliedmods.net/mmsdrop/1.12/mmsource-1.12.0-git1194-linux.tar.gz") }} -> {{ metamod_download | default("https://mms.alliedmods.net/mmsdrop/1.12/mmsource-1.12.0-git1194-linux.tar.gz") }}
dest: ~/build_sourcemod/
remote_src: true
#creates: ~/build_sourcemod/addons/metamod
# creates: ~/build_sourcemod/addons/metamod

- name: Download latest sourcemod
ansible.builtin.unarchive:
src: "{{ sm_download|default(\"https://sm.alliedmods.net/smdrop/1.12/sourcemod-1.12.0-git7137-linux.tar.gz\") }}"

Check warning on line 23 in playbooks/roles/sourcemod/tasks/main.yml

View workflow job for this annotation

GitHub Actions / Ansible Lint

jinja[spacing]

Jinja2 spacing could be improved: {{ sm_download|default("https://sm.alliedmods.net/smdrop/1.12/sourcemod-1.12.0-git7137-linux.tar.gz") }} -> {{ sm_download | default("https://sm.alliedmods.net/smdrop/1.12/sourcemod-1.12.0-git7137-linux.tar.gz") }}

Check warning on line 23 in playbooks/roles/sourcemod/tasks/main.yml

View workflow job for this annotation

GitHub Actions / Ansible Lint

jinja[spacing]

Jinja2 spacing could be improved: {{ sm_download|default("https://sm.alliedmods.net/smdrop/1.12/sourcemod-1.12.0-git7137-linux.tar.gz") }} -> {{ sm_download | default("https://sm.alliedmods.net/smdrop/1.12/sourcemod-1.12.0-git7137-linux.tar.gz") }}
dest: ~/build_sourcemod/
remote_src: true
#creates: ~/build_sourcemod/addons/sourcemod
# creates: ~/build_sourcemod/addons/sourcemod

- name: Copy extensions & plugin sources [remote]
when: inventory_hostname != "localhost"
Expand All @@ -47,4 +47,4 @@
chdir: ~/build_sourcemod/addons/sourcemod/scripting
cmd: bash build.sh
tags:
- game_config
- game_config
8 changes: 4 additions & 4 deletions playbooks/roles/srcds/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
unarchive:
src: https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz
dest: ~/steamcmd
remote_src: yes
remote_src: true
creates: ~/steamcmd/steamcmd.sh

- name: steamcmd update script
Expand Down Expand Up @@ -80,7 +80,7 @@
loop: "{{ services }}"
when: item.config == "pve"
# Perform the copy from the *remote* sourcemod build output
#delegate_to: "{{ inventory_hostname }}"
# delegate_to: "{{ inventory_hostname }}"

- name: Copy attach.sh
ansible.builtin.copy:
Expand All @@ -105,7 +105,7 @@
src: curated_maplist.txt.j2
dest: ~/srcds-{{ item.server_name_short }}/tf/addons/sourcemod/configs/curated_maplist.txt
mode: 0655
when: item.curated_pool != ""
when: item.curated_pool
tags:
- game_config
loop: "{{ services }}"
Expand Down Expand Up @@ -482,4 +482,4 @@
loop_control:
index_var: loop0
when: ansible_distribution == 'Ubuntu'
tags: cron
tags: cron
4 changes: 2 additions & 2 deletions playbooks/system.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,14 @@
- python3-netaddr

- name: Install xanmod-rt-v2
when: old_cpu == true
when: old_cpu
ansible.builtin.apt:
state: present
pkg:
- linux-xanmod-rt-x64v2

- name: Install xanmod-rt-v3
when: old_cpu == false
when: not old_cpu
ansible.builtin.apt:
state: present
pkg:
Expand Down
1 change: 0 additions & 1 deletion playbooks/update_srcds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@
hosts: tf2
roles:
- srcds
- tf2
2 changes: 1 addition & 1 deletion requirements.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ collections:
- community.general
- community.docker
- ansible.posix
- githubixx.ansible_role_wireguard

0 comments on commit 17d6186

Please sign in to comment.