6 Commits

Author SHA1 Message Date
463b84b61c docs(role): Add reminders/comments why we're installing packages 2025-09-19 02:05:23 +02:00
1933e02290 feat(role): Collect sysstat data with sysstat.service unit
Arch-based systems will never automatically enable a systemd service
unit for the administrator. Check if 'sysstat.service' exists. Start
and enable it if so.
2025-09-19 01:48:24 +02:00
cc239de7a0 feat(role): Add packages aria2, lftp, rclone, sysstat, termshark, tshark 2025-09-19 01:34:23 +02:00
c57840bb11 fix(role): Delete tmux global config only if it exists
Do a aanity check if tmux global config exists.
2025-08-25 00:06:15 +02:00
5edb3c08a2 fix(role): Install tmux-resurrect on Arch Linux from AUR 2025-08-21 04:08:51 +02:00
54d2327ec8 fix(role): Make config deletion more robust
We previously attempted to delete a file even if none was present.
This is now fixed.
2025-08-21 04:08:31 +02:00
5 changed files with 73 additions and 10 deletions

View File

@@ -1,49 +1,100 @@
# SPDX-License-Identifier: MIT # SPDX-License-Identifier: MIT
packages_linux_common_all_families: packages_linux_common_all_families:
# A download manager more capable than wget
- 'aria2'
# Shell-based math operations
- 'bc' - 'bc'
# A nice system stats and health overview
- 'btop' - 'btop'
# Brings mkfs.fat and related tools for the rare occasion that we absolutely
# have to work with a FAT-formatted partition.
- 'dosfstools' - 'dosfstools'
# DHCP server response debugging
- 'dhcping' - 'dhcping'
# Fast host liveness scanner
- 'fping' - 'fping'
# Version control
- 'git' - 'git'
# Network bandwidth and performance measurement
- 'iperf3' - 'iperf3'
# Manipulate JSON
- 'jq' - 'jq'
# All things FTP, SFTP, FTP over SSL etc.
- 'lftp'
# Log file navigator
- 'lnav' - 'lnav'
# Process inspector
- 'lsof' - 'lsof'
# In-memory file transfer buffer
- 'mbuffer' - 'mbuffer'
# Advanced trace routes
- 'mtr' - 'mtr'
# ncurses disk usage
- 'ncdu' - 'ncdu'
# Network performance measurement
- 'netperf' - 'netperf'
# Run multiple processes in parallel, mostly when they don't do so natively
# to better utilize CPU resources for a performance boost
- 'parallel' - 'parallel'
# Partition editor
- 'parted' - 'parted'
# Apply patch files
- 'patch' - 'patch'
# Parallel gzip
- 'pigz' - 'pigz'
# Pipe viewer to visualize network throughput inbetween two shell pipes
- 'pv' - 'pv'
# Multi-purpose file transfer
- 'rclone'
# Best-in-class data sync
- 'rsync' - 'rsync'
# Hardware stress testing
- 'stress-ng' - 'stress-ng'
# E-mail transfer debugging
- 'swaks' - 'swaks'
# System statistics and load monitor
- 'sysstat'
# Network traffic inspector
- 'tcpdump' - 'tcpdump'
# Nice interface to WireShark CLI
- 'termshark'
# Terminal multiplexer
- 'tmux' - 'tmux'
# Basic trace routes
- 'traceroute' - 'traceroute'
# Print directory tree content
- 'tree' - 'tree'
# Unzip zip files
- 'unzip' - 'unzip'
# Basic file transfer utility
- 'wget' - 'wget'
packages_linux_common_archlinux: packages_linux_common_archlinux:
# We care about dig to debug DNS server responses
- 'bind' - 'bind'
# A nicer CLI diff tool
- 'difftastic' - 'difftastic'
# Better ls
- 'eza' - 'eza'
# YAML file manipulation, diffs, merges etc.
- 'go-yq' - 'go-yq'
# GPT disk editor
- 'gptfdisk' - 'gptfdisk'
# Send crafted TCP packets for debugging purposes
- 'openbsd-netcat' - 'openbsd-netcat'
# Allow a Proxmox VE hostto interact with a VM
- 'qemu-guest-agent' - 'qemu-guest-agent'
# Python manager
- 'uv' - 'uv'
# WireShark CLI
- 'wireshark-cli'
packages_linux_paru_archlinux: packages_linux_paru_archlinux:
- 'downgrade' - 'downgrade'
- 'flent' - 'flent'
- 'mmv' - 'mmv'
- 'paccache-hook' - 'paccache-hook'
- 'tmux-resurrect'
packages_linux_common_debian: packages_linux_common_debian:
- 'apt-file' - 'apt-file'
@@ -54,6 +105,7 @@ packages_linux_common_debian:
- 'gdisk' - 'gdisk'
- 'mmv' - 'mmv'
- 'netcat-openbsd' - 'netcat-openbsd'
- 'tshark'
- 'unattended-upgrades' - 'unattended-upgrades'
- 'xxd' - 'xxd'

View File

@@ -31,7 +31,7 @@
path: '{{ pkg.global_config_file }}' path: '{{ pkg.global_config_file }}'
- name: 'Remove per-package config' - name: 'Remove per-package config'
when: 'stat_result.pkg.name not in ansible_facts.packages' when: 'stat_result.pkg.name not in ansible_facts.packages and stat_result.stat.exists'
loop_control: loop_control:
loop_var: 'stat_result' loop_var: 'stat_result'
label: 'If ''{{ stat_result.pkg.name }}'' package is absent and system-wide config file ''{{ stat_result.pkg.global_config_file }}'' is present remove config file' label: 'If ''{{ stat_result.pkg.name }}'' package is absent and system-wide config file ''{{ stat_result.pkg.global_config_file }}'' is present remove config file'

View File

@@ -0,0 +1,10 @@
# SPDX-License-Identifier: MIT
- name: 'Gather service facts'
ansible.builtin.service_facts:
- name: 'If ''sysstat.service'' exists make sure it''s running'
when: '''sysstat.service'' in ansible_facts[''services'']'
ansible.builtin.service:
name: 'sysstat.service'
state: 'started'
enabled: true

View File

@@ -10,21 +10,21 @@
create: true create: true
block: '{{ tmux_global_config_resurrect }}' block: '{{ tmux_global_config_resurrect }}'
- name: 'If Arch Linux and ''tmux-resurrect'' package is absent never auto-load tmux-resurrect on tmux start system-wide' - name: 'Get stats of ''{{ tmux_global_config_file }}'''
when: '(ansible_facts[''os_family''] | lower == ''archlinux'') and (''tmux-resurrect'' not in ansible_facts.packages)' ansible.builtin.stat:
path: '{{ tmux_global_config_file }}'
register: 'role_common_packages__tmux_global_config_file_stats'
- name: 'If Arch Linux and ''tmux-resurrect'' package is absent and system-wide config file ''{{ tmux_global_config_file }}'' is present remove config block from file'
when: '(ansible_facts[''os_family''] | lower == ''archlinux'') and (''tmux-resurrect'' not in ansible_facts.packages) and (role_common_packages__tmux_global_config_file_stats.stat.exists)'
ansible.builtin.blockinfile: ansible.builtin.blockinfile:
marker: '# {mark} ANSIBLE MANAGED BLOCK - tmux-resurrect' marker: '# {mark} ANSIBLE MANAGED BLOCK - tmux-resurrect'
path: '{{ tmux_global_config_file }}' path: '{{ tmux_global_config_file }}'
state: 'absent' state: 'absent'
block: '{{ tmux_global_config_resurrect }}' block: '{{ tmux_global_config_resurrect }}'
- name: 'Get stats of ''{{ tmux_global_config_file }}''' - name: 'If ''{{ tmux_global_config_file }}'' exists and is 0 bytes delete it'
ansible.builtin.stat: when: '(role_common_packages__tmux_global_config_file_stats.stat.exists) and (role_common_packages__tmux_global_config_file_stats.stat.size == 0)'
path: '{{ tmux_global_config_file }}'
register: 'role_common_packages__tmux_global_config_file_stats'
- name: 'If ''{{ tmux_global_config_file }}'' is 0 bytes delete it'
when: 'role_common_packages__tmux_global_config_file_stats.stat.size == 0'
ansible.builtin.file: ansible.builtin.file:
path: '{{ tmux_global_config_file }}' path: '{{ tmux_global_config_file }}'
state: 'absent' state: 'absent'

View File

@@ -1,3 +1,4 @@
# SPDX-License-Identifier: MIT # SPDX-License-Identifier: MIT
- import_tasks: 'base-package-auxiliary-settings-sysstat.yml'
- import_tasks: 'base-package-auxiliary-settings-tmux.yml' - import_tasks: 'base-package-auxiliary-settings-tmux.yml'
- import_tasks: 'base-package-auxiliary-settings-single-package-single-config.yml' - import_tasks: 'base-package-auxiliary-settings-single-package-single-config.yml'