New version of salt-formula from Saltstack
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

cluster.sls 1.0KB

9 years ago
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. {% from "salt/map.jinja" import control with context %}
  2. {%- if control.enabled %}
  3. /srv/salt/cloud/maps:
  4. file.directory:
  5. - makedirs: true
  6. /srv/salt/cloud/userdata:
  7. file.directory:
  8. - makedirs: true
  9. {%- for cluster_name, cluster in control.cluster.iteritems() %}
  10. /srv/salt/cloud/maps/{{ cluster_name }}:
  11. file.managed:
  12. - source: salt://salt/files/map
  13. - user: root
  14. - group: root
  15. - template: jinja
  16. - require:
  17. - file: /srv/salt/cloud/maps
  18. - defaults:
  19. cluster_name: "{{ cluster_name }}"
  20. /srv/salt/cloud/userdata/{{ cluster_name }}:
  21. file.directory:
  22. - makedirs: true
  23. {%- for node_name, node in cluster.node.iteritems() %}
  24. /srv/salt/cloud/userdata/{{cluster_name }}/{{ node_name }}.conf:
  25. file.managed:
  26. - source: salt://salt/files/userdata
  27. - user: root
  28. - group: root
  29. - template: jinja
  30. - require:
  31. - file: /srv/salt/cloud/userdata/{{ cluster_name }}
  32. - defaults:
  33. cluster_name: "{{ cluster_name }}"
  34. node_name: "{{ node_name }}"
  35. {%- endfor %}
  36. {%- endfor %}
  37. {%- endif %}