mschuchard.general.goss_serve (1.0.1) — module

Module to serve a GoSS health endpoint.

| "added in version" 1.0.0 of mschuchard.general"

Authors: Matthew Schuchard (@mschuchard)

Install collection

Install with ansible-galaxy collection install mschuchard.general:==1.0.1


Add to requirements.yml

  collections:
    - name: mschuchard.general
      version: 1.0.1

Description

Serve a GoSS health endpoint for validating systems.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# serve a health endpoint with a gossfile at /path/to/my_gossfile.yaml
- name: Serve a health endpoint with a gossfile at /path/to/my_gossfile.yaml
  mschuchard.general.goss_serve:
    gossfile: /path/to/my_gossfile.yaml
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# serve a health endpoint with a default location gossfile, a var file at /path/to/vars.yaml, and a json format output
- name: Serve a health endpoint with a default location gossfile, a var file at /path/to/vars.yaml, and a pretty json format output
  mschuchard.general.goss_serve:
    format: json
    format_opts: pretty
    vars: /path/to/vars.yaml
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# serve a health endpoint with a default location gossfile at localhost:8765/check and cache the results for one minute
- name: Serve a health endpoint with a default location gossfile at localhost:8765/check and cache the results for one minute
  mschuchard.general.goss_serve:
    cache: 1m
    endpoint: /check
    port: 8765
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# serve a health endpoint with a default location gossfile and its corresponding golang template with inline variables and rpm package
- name: Serve a health endpoint with a default location gossfile and its corresponding golang template with inline variables and rpm package
  mschuchard.general.goss_serve:
    package: rpm
    vars_inline:
      my_service: httpd
      my_package: apache

Inputs

    
port:
    default: 8080
    description: Address to listen on.
    required: false
    type: int

vars:
    description: Path to YAMl or JSON format file containing variables for template.
    required: false
    type: bool

cache:
    default: 5s
    description: Time to cache the results
    required: false
    type: str

format:
    default: rspecish
    description: Output format for validation report.
    required: false
    type: str

package:
    description: The package type to use.
    required: false
    type: str

endpoint:
    default: /healthz
    description: Endpoint to expose.
    required: false
    type: str

gossfile:
    default: goss.yaml
    description: The specific gossfile used for serveing the output.
    required: false
    type: str

max_concur:
    default: 50
    description: Max number of tests to run concurrently
    required: false
    type: int

format_opts:
    description: Extra options passed to the formatter. Valid options are perfdata, pretty,
      or verbose.
    required: false
    type: str

vars_inline:
    description: Variables for the template.
    required: false
    type: dict

Outputs

command:
  description: The raw GoSS command executed by Ansible.
  returned: always
  type: str