Saltstack Official Salt Formula
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.

cloud.sls 1.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. {% from "salt/map.jinja" import salt_settings with context %}
  2. python-pip:
  3. pkg.installed
  4. pycrypto:
  5. pip.installed:
  6. - require:
  7. - pkg: python-pip
  8. {% if grains['os_family'] not in ['Debian', 'RedHat'] %}
  9. crypto:
  10. pip.installed:
  11. - require:
  12. - pkg: python-pip
  13. {% endif %}
  14. apache-libcloud:
  15. pip.installed:
  16. - require:
  17. - pkg: python-pip
  18. {% if salt_settings.install_packages %}
  19. salt-cloud:
  20. pkg.installed:
  21. - name: {{ salt_settings.salt_cloud }}
  22. - require:
  23. - pip: apache-libcloud
  24. - pip: pycrypto
  25. {% if grains['os_family'] not in ['Debian', 'RedHat'] %}
  26. - pip: crypto
  27. {% endif %}
  28. {% endif %}
  29. {% for folder in salt_settings.cloud.folders %}
  30. {{ folder }}:
  31. file.directory:
  32. - name: /etc/salt/{{ folder }}
  33. - user: root
  34. - group: root
  35. - file_mode: 744
  36. - dir_mode: 755
  37. - makedirs: True
  38. {% endfor %}
  39. {% for cert in pillar.get('salt_cloud_certs', {}) %}
  40. {% for type in ['pem'] %}
  41. cloud-cert-{{ cert }}-pem:
  42. file.managed:
  43. - name: /etc/salt/cloud.providers.d/key/{{ cert }}.pem
  44. - source: salt://salt/files/key
  45. - template: jinja
  46. - user: root
  47. - group: root
  48. - mode: 600
  49. - defaults:
  50. key: {{ cert }}
  51. type: {{ type }}
  52. {% endfor %}
  53. {% endfor %}
  54. {% for providers in salt_settings.cloud.providers %}
  55. salt-cloud-providers-{{ providers }}:
  56. file.managed:
  57. - name: /etc/salt/cloud.providers.d/{{ providers }}.conf
  58. - template: jinja
  59. - source: salt://salt/files/cloud.providers.d/{{ providers }}.conf
  60. {% endfor %}
  61. {%- for dir in ['profiles', 'maps'] %}
  62. {%- set default_src = 'salt://salt/files/cloud.{}.d'.format(dir) %}
  63. {%- set source = salt_settings.cloud.get(dir + "_src", default_src) %}
  64. salt-cloud-{{ dir }}:
  65. file.recurse:
  66. - name: /etc/salt/cloud.{{ dir }}.d
  67. - source: {{ source }}
  68. - template: jinja
  69. {%- endfor %}