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
Working | |
import salt.client | |
caller = salt.client.Caller() | |
schedules_list = caller.cmd('cmd.run', 'schtasks /query /fo list') | |
print schedules_list | |
Not working |
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
>>> import salt.client | |
>>> caller = salt.client.Caller() | |
>>> out = caller.cmd('cmd.run', 'some_command', shell=powershell) | |
>>> print out | |
>>> import salt.client | |
>>> caller = salt.client.Caller() |
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
{% set my_list = [ 'item1','item2','item3','item4'] %} | |
{% if grains['some_grain'] in my_list %} | |
# it's on the list, do something | |
{% else %} | |
# not on the list, do nothing |
OlderNewer