From 662e6d30df2557caaf7719bd375e465f2a40dbf8 Mon Sep 17 00:00:00 2001 From: Gregory Ballantine Date: Thu, 6 Aug 2026 13:07:55 -0400 Subject: [PATCH] Adding initial generic configs to systems --- README.md | 28 +++++++++++++-- bin/salt-lint.sh | 4 +++ pillar/common.sls | 90 +++++++++++++++++++++++++++++++++++++++++++++++ pillar/top.sls | 4 +++ sfm.yaml | 29 +++++++++++++++ states/top.sls | 12 +++++++ 6 files changed, 165 insertions(+), 2 deletions(-) create mode 100755 bin/salt-lint.sh create mode 100644 pillar/common.sls create mode 100644 pillar/top.sls create mode 100644 sfm.yaml create mode 100644 states/top.sls diff --git a/README.md b/README.md index cb60d32..c77514b 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,27 @@ -# benchmark-states +# Bit Goblin Benchmarking States -A collection of SaltStack states to configure benchmarking systems consistently. \ No newline at end of file +A collection of SaltStack states to configure benchmarking systems consistently. + +## Deploying + +The only thing required for deploying and running these states is [Salt Formula Manager](https://git.metaunix.net/Metaunix/salt-formula-manager). + +To install the formulas with SFM: `sfm` + +## Running States + +The states in this collection are intended to be run via Salt SSH, or a Salt run locally. You *can* run them via a Salt minion/master setup, **but you should verify the minion is disabled before benchmarks are run** to make sure it doesn't impact benchmarks. + +## Available States + +* `gaming` - installs software needed for running gaming benchmarks (e.g. Steam, MangoHUD) +* `cpu_compute` - installs benchmarks/tools needed for running CPU compute benchmarks +* `gpu_compute` - installs benchmarks/tools needed for running GPU compute benchmarks + +## Development + +To run the Salt Linter, use the script in `./bin/salt-lint.sh`: + +`./bin/salt-lint.sh` + +This requires installing Docker. diff --git a/bin/salt-lint.sh b/bin/salt-lint.sh new file mode 100755 index 0000000..fb10cb8 --- /dev/null +++ b/bin/salt-lint.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +docker run -v $(pwd):/src:ro --entrypoint=/bin/bash -it warpnetbv/salt-lint:v0.9.2 \ + -c 'find /src -type f -name "*.sls" -print0 | xargs -0 --no-run-if-empty salt-lint' diff --git a/pillar/common.sls b/pillar/common.sls new file mode 100644 index 0000000..4e5e3f4 --- /dev/null +++ b/pillar/common.sls @@ -0,0 +1,90 @@ +# NTP (chrony) client configs +chrony: + ntpservers: + - virginia.time.system76.com + - ohio.time.system76.com + - oregon.time.system76.com + options: 'iburst nts' + allow: + - 127.0.0.1 + +# Common packages to install everywhere - this is self-explanatory +packages: + pkgs: + wanted: + - bash + - curl + - git + - gzip + - rsync + - screen + - unzip + - wget + - zip + +# SSH server config +openssh: + banner_string: | + # ____ _ _ ____ _ _ _ + # | __ )(_) |_ / ___| ___ | |__ | (_)_ __ + # | _ \| | __| | | _ / _ \| '_ \| | | '_ \ + # | |_) | | |_ | |_| | (_) | |_) | | | | | | + # |____/|_|\__| \____|\___/|_.__/|_|_|_| |_| + # + # The machine you are currently attempting to access is + # restricted to only those within the Bit Goblin organization and + # those otherwise granted permission to do so. Unauthorized access + # is prohibited. This system is monitored, and actions are logged. + # +sshd_config: + ListenAddress: '0.0.0.0' + Port: 22 + Protocol: 2 + Banner: '/etc/ssh/banner' + HostKey: + - '/etc/ssh/ssh_host_rsa_key' + - '/etc/ssh/ssh_host_ecdsa_key' + - '/etc/ssh/ssh_host_ed25519_key' + SyslogFacility: 'AUTHPRIV' + LogLevel: 'INFO' + LoginGraceTime: 120 + PermitRootLogin: 'without-password' + PasswordAuthentication: 'yes' + PubkeyAuthentication: 'yes' + PermitEmptyPasswords: 'no' + X11Forwarding: 'yes' + PrintMotd: 'yes' + UsePAM: 'yes' + UseDNS: 'yes' + +# Timezone configuration - self-explanatory, but turns off UTC system clock +timezone: + name: 'America/New_York' + utc: True + +# Host vim configuration - tries to set sane defaults +vim: + managed_vimrc: False + config: + syntax: 'on' + + settings: + bs: indent,eol,start + cindent: + nocompatible: + smartindent: + laststatus: 2 + tabstop: 4 + softtabstop: 4 + shiftwidth: 4 + noexpandtab: + nowrap: + swapsync: '' + + mappings: + : :tabp + : :tabn + : j + : k + : h + : l diff --git a/pillar/top.sls b/pillar/top.sls new file mode 100644 index 0000000..faa776e --- /dev/null +++ b/pillar/top.sls @@ -0,0 +1,4 @@ +base: + ## Common stuff + '*': + - common diff --git a/sfm.yaml b/sfm.yaml new file mode 100644 index 0000000..446aeb0 --- /dev/null +++ b/sfm.yaml @@ -0,0 +1,29 @@ +--- + +# the default formula url +formulas_url: https://github.com/saltstack-formulas/ + +# where to store the new formulas (relative to current directory) +formulas_dir: /srv/salt/formulas + +# remove unmanaged formulas +purge_formulas: true + +# list of formulas to import +formulas: + - chrony: + version: v1.3.0 + - openssh: + version: v3.0.1 + - packages: + version: v0.13.0 + - salt: + version: v1.13.0 + - sudoers: + version: v0.23.3 + - timezone: + version: v0.4.4 + - users: + version: v0.48.6 + - vim: + version: v0.15.4 diff --git a/states/top.sls b/states/top.sls new file mode 100644 index 0000000..1ec7415 --- /dev/null +++ b/states/top.sls @@ -0,0 +1,12 @@ +base: + ## Common stuff + '*': + # base system configuration; these need to run early and in a specific order + - timezone + - chrony + - openssh + - openssh.banner + - openssh.config + - vim + # keep this at the end of the common stuff since these are one-off installs + - packages