Skip to content

Instantly share code, notes, and snippets.

View c4t3l's full-sized avatar

Robert Callicotte c4t3l

View GitHub Profile
@terminalmage
terminalmage / README.md
Last active February 13, 2024 14:44
Salt Debugging Best Practices (SaltConf 18)

Salt Debugging Best Practices

These notes should prove useful for those looking for tips on how to find and fix bugs, as well as those who are developing Salt and would like to improve/streamline the process.

NOTE: These notes are written from the perspective of a developer working in a Linux environment. Those on MacOS may need to make some adjustments. Those on Windows may need to make several adjustments.

@whiteinge
whiteinge / complex_salt_orchestrate.sls
Last active November 11, 2024 22:04
An example of a complex, multi-host Salt Orchestrate state that performs status checks as it goes
# /srv/salt/upgrade_the_app.sls
# Example of a complex, multi-host Orchestration state that performs status checks as it goes.
# Note, this is untested and is meant to serve as an example.
# Run via: salt-run state.orch upgrade_the_app pillar='{nodes: [nodeA, nodeB], version: 123}'
{% set nodes = salt.pillar.get('nodes', []) %}
{% set all_grains = salt.saltutil.runner('cache.grains',
tgt=','.join(nodes), tgt_type='list') %}
{# Default version if not given at the CLI. #}