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 |
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
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
[atiliomedina as root@hllibisphtrac:~ ]$ salt-call pillar.items | |
local: | |
---------- | |
_errors: | |
- Rendering Primary Top file failed, render error: | |
Jinja error: campusd.sls | |
Traceback (most recent call last): | |
File "/usr/lib/python2.7/site-packages/salt/utils/templates.py", line 368, in render_jinja_tmpl | |
output = template.render(**decoded_context) | |
File "/usr/lib/python2.7/site-packages/jinja2/environment.py", line 969, in render |
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
[atiliomedina as root@hllibisphtrac:~ ]$ salt-call state.show_top | |
local: | |
---------- | |
base: | |
- campusd.basis_states | |
- campusd.schedules | |
- campusd.users | |
- campusd.groups | |
- campusd.security | |
- campusd.core |
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
- Rendering SLS 'base:stats.syslog.syslog' failed: Jinja error: argument of type 'function' is not iterable | |
Traceback (most recent call last): | |
File "/usr/lib/python2.7/site-packages/salt/utils/templates.py", line 368, in render_jinja_tmpl | |
output = template.render(**decoded_context) | |
File "/usr/lib/python2.7/site-packages/jinja2/environment.py", line 969, in render | |
return self.environment.handle_exception(exc_info, True) | |
File "/usr/lib/python2.7/site-packages/jinja2/environment.py", line 742, in handle_exception | |
reraise(exc_type, exc_value, tb) | |
File "<template>", line 38, in top-level template code | |
TypeError: argument of type 'function' is not iterable |
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
file-on-master-exists: | |
file.exists: | |
- name: salt://some/file/or/directory |
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
config_update: | |
file.managed: | |
- name: /etc/somedir/someconfig | |
- source: salt://base/somedir/someconfig | |
- user: root | |
- group: root | |
- mode: 644 | |
- replace: False | |
- order: 1 | |
- require: |
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
config_update: | |
file.managed: | |
- name: /etc/somedir/someconfig | |
- source: salt://base/somedir/someconfig | |
- user: root | |
- group: root | |
- mode: 644 | |
- replace: False | |
- order: 1 | |
- require: |
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
somefileline: | |
file.line: | |
- name: /root/some_test_file.txt | |
- content: New text to add | |
- match: ^Existing | |
- mode: replace | |
- backup: True | |
NewerOlder