$linuxjunkies
>

goss(1)

Goss is a quick and easy server validation tool that checks system state against a YAML specification file.

UbuntuDebianFedoraArch

Synopsis

goss [OPTION] COMMAND [ARG]...

Description

Goss is a serverspec alternative for validating a server's configuration. It reads a YAML specification file defining expected system state (packages, services, ports, files, users, etc.) and validates that the actual system matches that specification.

Unlike traditional testing frameworks, goss is lightweight, fast, and designed for quick validation during deployment, configuration management, and infrastructure testing. It outputs simple pass/fail results and can integrate into CI/CD pipelines.

Common options

FlagWhat it does
-g, --gossfile FILEPath to the goss specification file (default: goss.yaml)
-v, --vars FILEPath to variables YAML file for templating the gossfile
-o, --outputter FORMATOutput format: json, tap, junit, nagios, prometheus (default: rspecish)
-f, --format FORMATAlias for --outputter
--timeout DURATIONTimeout for each test, e.g. 5s, 2m (default: 5s)
-s, --sleep DURATIONSleep duration between retries for slow-to-start services
-r, --retry TIMESNumber of times to retry failed tests before giving up
--use-alphaEnable alpha features
-h, --helpDisplay help message

Examples

Run validation using default goss.yaml file in current directory

goss validate

Validate using a specific gossfile location

goss -g /etc/goss/server.yaml validate

Output validation results in JSON format and parse with jq

goss validate -o json | jq

Validate with variable substitution from vars.yaml file

goss -v vars.yaml validate

Interactively add and edit test specifications in the gossfile

goss edit

Display the parsed gossfile with variables substituted

goss render

Validate with 10-second timeout per test and retry failures 3 times

goss validate --timeout 10s --retry 3

Validate and check exit code for integration with monitoring systems

goss validate -o nagios && echo "Server OK" || echo "Server failed"

Related commands