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.

cloud.sls 1.4KB

9 years ago
9 years ago
9 years ago
9 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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 %}