New version of salt-formula from Saltstack
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. {%- from "salt/map.jinja" import minion with context %}
  2. {%- if minion.enabled %}
  3. include:
  4. - salt.minion.service
  5. salt_minion_grains_dir:
  6. file.directory:
  7. - name: /etc/salt/grains.d
  8. - mode: 700
  9. - makedirs: true
  10. - user: root
  11. - require:
  12. - {{ minion.install_state }}
  13. salt_minion_grains_files:
  14. file.managed:
  15. - names:
  16. - /etc/salt/grains
  17. - /etc/salt/grains.d/placeholder
  18. - replace: False
  19. - require:
  20. - file: salt_minion_grains_dir
  21. {%- set new_grains = salt['cmd.run']('cat /etc/salt/grains.d/*') %}
  22. {%- set old_grains = salt['cmd.run']('cat /etc/salt/grains') %}
  23. {%- if new_grains != old_grains %}
  24. salt_minion_grains_file:
  25. cmd.run:
  26. - name: cat /etc/salt/grains.d/* > /etc/salt/grains
  27. - require:
  28. - file: salt_minion_grains_files
  29. salt_minion_grains_publish:
  30. module.run:
  31. - name: mine.update
  32. - require:
  33. - cmd: salt_minion_grains_file
  34. {%- endif %}
  35. {%- endif %}