Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/raddessi/salt-git-diff

See which entries in salt top.sls were affected by last commit
https://github.com/raddessi/salt-git-diff

Last synced: 15 days ago
JSON representation

See which entries in salt top.sls were affected by last commit

Awesome Lists containing this project

README

        

# Salt git diff
See which hosts in top file were affected by latest git commit

# Usage
Navigate to your salt states or pillars location and run:

docker run -i -v $(pwd):/mnt/git tomologic/salt-git-diff

Default output format is YAML. You can get JSON instead:

docker run -i -v $(pwd):/mnt/git tomologic/salt-git-diff -o json

# Output
YAML format:

- '*'
- host2.example.com
- host3.example.com
- '*.subdomain.example.com'

JSON format (-o json):

[
"*",
"host2.example.com",
"host3.example.com",
"*.subdomain.example.com"
]

Plain text format (-o text)

*
host2.example.com
host3.example.com
*.subdomain.example.com

# Asterisk substitution

docker run -i -v $(pwd):/mnt/git tomologic/salt-git-diff -o text --replace-asterisks=something

something
host2.example.com
host3.example.com
something.subdomain.example.com

# Limitations
* Skips any selector with ":" in it in top file, like "os:CentOS"