Created
November 10, 2021 04:19
-
-
Save tuaris/b1659f02e3d233723edeac60bb8b6879 to your computer and use it in GitHub Desktop.
Saltstack Multiple roles
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Pillar Data | |
root@master:~# salt 'monitor.*' pillar.items | |
monitor.prod.domain.tld: | |
---------- | |
role: | |
- collector | |
- metabase | |
- grafana | |
- prometheus | |
# Trying to Target | |
salt -I 'role:collector' test.version | |
<fails> | |
# Then in a salt state file: | |
{% if salt['pillar.get']('role') == 'collector' %} | |
Do something | |
{% else %} | |
Do something else | |
{% endif %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment