Advertisement
techhat

Python Salt Reactor

Feb 17th, 2014
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. [root@dufresne ~]# tail -n 4 /etc/salt/master
  2. reactor:
  3. - 'tag/for/my/reactor':
  4. - '/srv/reactor/custom-reactor.sls'
  5.  
  6. [root@dufresne ~]# cat /srv/reactor/custom-reactor.sls
  7. #!py
  8.  
  9. import pprint
  10.  
  11. with open('/tmp/custom-reactor', 'w') as fh_:
  12. fh_.write(pprint.pformat(data) +'\n')
  13.  
  14. [root@dufresne ~]# salt dufresne event.fire_master '{"key1": "val1"}' 'tag/for/my/reactor'; cat /tmp/custom-reactor
  15. dufresne:
  16. True
  17. {'_stamp': '2014-02-17_16:33:45.174641',
  18. 'cmd': '_minion_event',
  19. 'data': {'key1': 'val1'},
  20. 'id': 'dufresne',
  21. 'pretag': None,
  22. 'tag': 'tag/for/my/reactor'}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement