Advertisement
sschwartzOAK

Untitled

Oct 20th, 2014
257
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.20 KB | None | 0 0
  1. running salt-master -l debug, and calling, invokes:
  2.  
  3. [DEBUG ] Gathering reactors for tag salt/netapi/hook/ping
  4. [DEBUG ] Compiling reactions for tag salt/netapi/hook/ping
  5. [DEBUG ] Jinja search path: ['/var/cache/salt/master/files/base']
  6. [DEBUG ] Rendered data from file: /srv/salt/netapi/ping.sls:
  7.  
  8.  
  9. #
  10.  
  11.  
  12. pingtest:
  13. cmd.cmd.script:
  14. - tgt: base-lj-3
  15. - fun cmd.run
  16. - arg salt://srv/salt/netapi/test.sh
  17. - kwarg:
  18. user: root
  19. group: root
  20.  
  21. #
  22.  
  23. [DEBUG ] Results of YAML rendering:
  24. OrderedDict([('pingtest', OrderedDict([('cmd.cmd.script', [OrderedDict([('tgt', 'base-lj-3')]), 'fun cmd.run', 'arg salt://srv/salt/netapi/test.sh', OrderedDict([('kwarg', OrderedDict([('user', 'root'), ('group', 'root')]))])])]))])
  25. Process Reactor-4:
  26. Traceback (most recent call last):
  27. File "/usr/lib64/python2.6/multiprocessing/process.py", line 232, in _bootstrap
  28. self.run()
  29. File "/usr/lib/python2.6/site-packages/salt/utils/event.py", line 593, in run
  30. chunks = self.reactions(data['tag'], data['data'], reactors)
  31. File "/usr/lib/python2.6/site-packages/salt/utils/event.py", line 571, in reactions
  32. errors = self.verify_high(high)
  33. File "/usr/lib/python2.6/site-packages/salt/state.py", line 315, in verify_high
  34. body['__sls__']))
  35. KeyError: '__sls__'
  36.  
  37.  
  38. When I try the other version
  39.  
  40. {% set postdata = data.get('post', {}) %}
  41.  
  42. #{% if postdata.secretkey == "jenkins2salt" %}
  43.  
  44.  
  45. pingtest:
  46. cmd.cmd.script:
  47. - tgt: base-lj-3
  48. - fun test.ping
  49. - kwarg:
  50. user: root
  51. group: root
  52.  
  53. #{% endif %}
  54.  
  55. I get nothing.
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65. So what I now have for ping.sls:
  66.  
  67. {% set postdata = data.get('post', {}) %}
  68.  
  69. {% if data.post.secretkey == "<secret>" %}
  70.  
  71. pingtest:
  72. cmd.cmd.script:
  73. - tgt: base-lj-3
  74. - fun test.ping
  75. - kwarg:
  76. user: root
  77. group: root
  78.  
  79. {% endif %}
  80.  
  81.  
  82. This produces a "success=true" but no output.
  83.  
  84. I also tried:
  85.  
  86. {% set postdata = data.get('post', {}) %}
  87.  
  88. {% if data.post.secretkey == "<secret>" %}
  89.  
  90. pingtest:
  91. cmd.cmd.script:
  92. - tgt: base-lj-3
  93. - fun cmd.run
  94. - arg salt://srv/salt/netapi/test.sh
  95. - kwarg:
  96. user: root
  97. group: root
  98.  
  99. {% endif %}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement