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

79 line
1.8KB

  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. salt-cloud:
  19. pkg.installed:
  20. - name: {{ salt_settings.salt_cloud }}
  21. - require:
  22. - pip: apache-libcloud
  23. - pip: pycrypto
  24. {% if grains['os_family'] not in ['Debian', 'RedHat'] %}
  25. - pip: crypto
  26. {% endif %}
  27. {% for folder in salt_settings.cloud.folders %}
  28. {{ folder }}:
  29. file.directory:
  30. - name: /etc/salt/{{ folder }}
  31. - user: root
  32. - group: root
  33. - file_mode: 744
  34. - dir_mode: 755
  35. - makedirs: True
  36. {% endfor %}
  37. {% for cert in salt_settings.salt_cloud_certs %}
  38. {% for type in ['pem'] %}
  39. cloud-cert-{{ cert }}-pem:
  40. file.managed:
  41. - name: /etc/salt/cloud.providers.d/key/{{ cert }}.pem
  42. - source: salt://salt/files/key
  43. - template: jinja
  44. - user: root
  45. - group: root
  46. - mode: 600
  47. - defaults:
  48. key: {{ cert }}
  49. type: {{ type }}
  50. {% endfor %}
  51. {% endfor %}
  52. {% for providers in salt_settings.cloud.providers %}
  53. salt-cloud-profiles-{{ providers }}:
  54. file.managed:
  55. - name: /etc/salt/cloud.profiles.d/{{ providers }}.conf
  56. - template: jinja
  57. - source: salt://salt/files/cloud.profiles.d/{{ providers }}.conf
  58. salt-cloud-providers-{{ providers }}:
  59. file.managed:
  60. - name: /etc/salt/cloud.providers.d/{{ providers }}.conf
  61. - template: jinja
  62. - source: salt://salt/files/cloud.providers.d/{{ providers }}.conf
  63. salt-cloud-maps-{{ providers }}:
  64. file.managed:
  65. - name: /etc/salt/cloud.maps.d/{{ providers }}.conf
  66. - template: jinja
  67. - source: salt://salt/files/cloud.maps.d/{{ providers }}.conf
  68. {% endfor %}