New version of salt-formula from Saltstack
No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.

70 líneas
1.4KB

  1. {% from "salt/map.jinja" import control with context %}
  2. {%- if control.enabled and control.cloud_enabled is defined %}
  3. salt_control_cloud_packages:
  4. pkg.installed:
  5. - names: {{ control.cloud_pkgs }}
  6. /etc/salt/control.providers:
  7. file.managed:
  8. - source: salt://salt/files/providers.conf
  9. - user: root
  10. - group: root
  11. - template: jinja
  12. /etc/salt/control.profiles:
  13. file.managed:
  14. - source: salt://salt/files/profiles.conf
  15. - user: root
  16. - group: root
  17. - template: jinja
  18. /srv/salt/cloud/maps:
  19. file.directory:
  20. - makedirs: true
  21. /srv/salt/cloud/userdata:
  22. file.directory:
  23. - makedirs: true
  24. {%- for cluster_name, cluster in control.cluster.iteritems() %}
  25. {%- if cluster.engine == "cloud" %}
  26. /srv/salt/cloud/maps/{{ cluster_name }}:
  27. file.managed:
  28. - source: salt://salt/files/map
  29. - user: root
  30. - group: root
  31. - template: jinja
  32. - require:
  33. - file: /srv/salt/cloud/maps
  34. - defaults:
  35. cluster_name: "{{ cluster_name }}"
  36. /srv/salt/cloud/userdata/{{ cluster_name }}:
  37. file.directory:
  38. - makedirs: true
  39. {%- for node_name, node in cluster.node.iteritems() %}
  40. /srv/salt/cloud/userdata/{{cluster_name }}/{{ node_name }}.conf:
  41. file.managed:
  42. - source: salt://salt/files/userdata
  43. - user: root
  44. - group: root
  45. - template: jinja
  46. - require:
  47. - file: /srv/salt/cloud/userdata/{{ cluster_name }}
  48. - defaults:
  49. cluster_name: "{{ cluster_name }}"
  50. node_name: "{{ node_name }}"
  51. {%- endfor %}
  52. {%- endif %}
  53. {%- endfor %}
  54. {%- endif %}