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.

81 lines
1.9KB

  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-profiles-{{ providers }}:
  56. file.managed:
  57. - name: /etc/salt/cloud.profiles.d/{{ providers }}.conf
  58. - template: jinja
  59. - source: salt://salt/files/cloud.profiles.d/{{ providers }}.conf
  60. salt-cloud-providers-{{ providers }}:
  61. file.managed:
  62. - name: /etc/salt/cloud.providers.d/{{ providers }}.conf
  63. - template: jinja
  64. - source: salt://salt/files/cloud.providers.d/{{ providers }}.conf
  65. salt-cloud-maps-{{ providers }}:
  66. file.managed:
  67. - name: /etc/salt/cloud.maps.d/{{ providers }}.conf
  68. - template: jinja
  69. - source: salt://salt/files/cloud.maps.d/{{ providers }}.conf
  70. {% endfor %}