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.

72 lines
1.5KB

  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 cert in pillar.get('salt_cloud_certs', {}) %}
  30. {% for type in ['pem'] %}
  31. cloud-cert-{{ cert }}-pem:
  32. file.managed:
  33. - name: /etc/salt/pki/cloud/{{ cert }}.pem
  34. - source: salt://{{ slspath }}/files/key
  35. - template: jinja
  36. - user: root
  37. - group: root
  38. - mode: 600
  39. - makedirs: True
  40. - defaults:
  41. key: {{ cert }}
  42. type: {{ type }}
  43. {% endfor %}
  44. {% endfor %}
  45. {%- for dir, templ_path in salt_settings.cloud.template_sources.items() %}
  46. salt-cloud-{{ dir }}:
  47. file.recurse:
  48. - name: /etc/salt/cloud.{{ dir }}.d
  49. - source: {{ templ_path }}
  50. - template: jinja
  51. - makedirs: True
  52. {%- endfor %}
  53. salt-cloud-providers-permissions:
  54. file.directory:
  55. - name: /etc/salt/cloud.providers.d
  56. - user: root
  57. - group: root
  58. - file_mode: 600
  59. - dir_mode: 700
  60. - recurse:
  61. - user
  62. - group
  63. - mode