Skip to content

Instantly share code, notes, and snippets.

@paha
Last active August 29, 2015 14:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save paha/03c967d82365da731dfa to your computer and use it in GitHub Desktop.
Save paha/03c967d82365da731dfa to your computer and use it in GitHub Desktop.
Passing arguments to salt runner
from reactor:
start_container:
runner.lxc.init:
- host: salt-master
- arg:
- lxc-test
- kwarg:
template: ubuntu
start: true
[DEBUG ] ThreadPool executing func: <bound method RunnerClient.low of <salt.runner.Run
nerClient object at 0x7ffdfcb30a50>> with args:('lxc.init', {'name': 'start_container', 'state': 'r
unner', 'host': 'salt-master', 'kwarg': OrderedDict([('template', 'ubuntu'), ('start', T
rue)]), '__id__': 'start_container', 'arg': ['lxc-test'], 'order': 1}) kwargs{}
[DEBUG ] init takes at least 1 argument (0 given)
Another variation:
start_container:
runner.lxc.init:
- host: salt-master
- lxc-test
- kwarg:
template: ubuntu
start: true
[DEBUG ] Results of YAML rendering:
OrderedDict([('start_container', OrderedDict([('runner.lxc.init', [OrderedDict([('host', 'salt-master')]), 'lxc-test', OrderedDict([('kwarg', OrderedDict([('template', 'ubuntu'), ('start', True)]))])])]))])
Process Reactor-4:
Traceback (most recent call last):
File "/usr/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap
self.run()
File "/usr/lib/python2.7/dist-packages/salt/utils/event.py", line 691, in run
chunks = self.reactions(data['tag'], data['data'], reactors)
File "/usr/lib/python2.7/dist-packages/salt/utils/event.py", line 662, in reactions
errors = self.verify_high(high)
File "/usr/lib/python2.7/dist-packages/salt/state.py", line 424, in verify_high
'SLS {1!r}'.format(state, body['__sls__'])
KeyError: '__sls__'
[INFO ] Process <class 'salt.utils.event.Reactor'> (2865) died with exit status None, restarting...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment