-
-
Save ndobbs/459b910c930eb1dd0261564360c47d86 to your computer and use it in GitHub Desktop.
This file contains 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
# grains in /etc/salt/minion | |
grains: | |
roles: | |
- log-forwarder | |
# salt state to set additional grains | |
testing additional grains: | |
grains.list_present: | |
- name: roles | |
- value: | |
- nginx | |
# Salt grains state run | |
salt log_forwarder state.apply nginx | |
log_forwarder: | |
---------- | |
ID: nginx | |
Function: pkg.latest | |
Result: True | |
Comment: Package nginx is already up-to-date | |
Started: 13:34:40.226560 | |
Duration: 11133.219 ms | |
Changes: | |
---------- | |
ID: roles | |
Function: grains.list_present | |
Result: True | |
Comment: Append value nginx to grain roles | |
Started: 13:34:51.360453 | |
Duration: 10.621 ms | |
Changes: | |
---------- | |
new: | |
---------- | |
roles: | |
- log-forwarder | |
- nginx | |
Summary for log_forwarder | |
------------ | |
Succeeded: 2 (changed=1) | |
Failed: 0 | |
------------ | |
Total states run: 2 | |
Total run time: 11.144 s | |
# confirm grains | |
salt log_forwarder grains.item roles | |
log_forwarder: | |
---------- | |
roles: | |
- log-forwarder | |
# /etc/salt/grains | |
salt log_forwarder cp.get_file_str file:///etc/salt/grains | |
log_forwarder: | |
roles: | |
- log-forwarder | |
- nginx |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment