New version of salt-formula from Saltstack
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

47 lines
1.0KB

  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 %}