Skip to content

Instantly share code, notes, and snippets.

@dginther
Created August 22, 2013 22:28
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 dginther/6313592 to your computer and use it in GitHub Desktop.
Save dginther/6313592 to your computer and use it in GitHub Desktop.
(init.sls)
check_mk-add-server:
cmd.run:
- name: salt-call event.fire_master 'west-add-server' 'wato'
(/srv/reactor/wato.sls)
{% if data['data'] == 'west-add-server' %}
{{ data['id'] }}:
cmd.run:
- name: salt 'monitor-ops1' file.append /etc/check_mk/conf.d/wato/vpc_west_stack/tmp.tmp \
"This is a test. This is only a test."
{% endif %}
2013-08-22 22:23:17,919 [salt.utils.event ][ERROR ] Failed to execute cmd: <bound method ReactWrap.cmd of <salt.utils.event.ReactWrap object at 0x2421d10>>
Traceback (most recent call last):
File "/usr/lib/pymodules/python2.7/salt/utils/event.py", line 434, in run
ret = l_fun(*f_call.get('args', ()), **f_call.get('kwargs', {}))
File "/usr/lib/pymodules/python2.7/salt/utils/event.py", line 448, in cmd
return local.cmd_async(*args, **kwargs)
TypeError: cmd_async() takes at least 3 arguments (2 given)
@auser
Copy link

auser commented Aug 22, 2013

Try:

  module.run:
     - name: event.fire_master
     - tag: west-add-server
     - data:
        name: wato

@dginther
Copy link
Author

2013-08-22 22:51:45,725 [salt.template ][DEBUG ] Rendered data from file: /srv/reactor/wato.sls:

west-vpc-prod-mail-outbound1:
cmd.cmd.run:

  • name: salt 'monitor-ops1' file.append /etc/check_mk/conf.d/wato/vpc_west_stack/tmp.tmp
    "This is a test. This is only a test."

2013-08-22 22:51:45,837 [salt.loaded.int.render.yaml][DEBUG ] Results of YAML rendering:
{'west-vpc-prod-mail-outbound1': {'cmd.cmd.run': [{'name': 'salt 'monitor-ops1' file.append /etc/check_mk/conf.d/wato/vpc_west_stack/tmp.tmp \ "This is a test. This is only a test."'}]}}
2013-08-22 22:51:45,838 [salt.config ][DEBUG ] Reading configuration from /etc/salt/master
2013-08-22 22:51:46,317 [salt.config ][DEBUG ] Missing configuration file: /root/.salt
2013-08-22 22:51:46,318 [salt.utils.event ][DEBUG ] LocalClientEvent PUB socket URI: ipc:///var/run/salt/master/master_event_pub.ipc
2013-08-22 22:51:46,318 [salt.utils.event ][DEBUG ] LocalClientEvent PULL socket URI: ipc:///var/run/salt/master/master_event_pull.ipc
2013-08-22 22:51:46,319 [salt.utils.event ][ERROR ] Failed to execute cmd: <bound method ReactWrap.cmd of <salt.utils.event.ReactWrap object at 0x1b04d10>>
Traceback (most recent call last):
File "/usr/lib/pymodules/python2.7/salt/utils/event.py", line 434, in run
ret = l_fun(_f_call.get('args', ()), *_f_call.get('kwargs', {}))
File "/usr/lib/pymodules/python2.7/salt/utils/event.py", line 448, in cmd
return local.cmd_async(_args, *_kwargs)
TypeError: cmd_async() takes at least 3 arguments (2 given)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment