Saltstack Official Salt Formula
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

81 行
1.9KB

  1. {% from "salt/package-map.jinja" import pkgs with context %}
  2. {% set salt = pillar.get('salt', {}) -%}
  3. {% set cloud = salt.get('cloud', {}) -%}
  4. python-pip:
  5. pkg.installed
  6. pycrypto:
  7. pip.installed:
  8. - require:
  9. - pkg: python-pip
  10. crypto:
  11. pip.installed:
  12. - require:
  13. - pkg: python-pip
  14. apache-libcloud:
  15. pip.installed:
  16. - require:
  17. - pkg: python-pip
  18. salt-cloud:
  19. pkg.installed:
  20. - name: {{ pkgs['salt-cloud'] }}
  21. - require:
  22. - pip: apache-libcloud
  23. - pip: pycrypto
  24. - pip: crypto
  25. {% for folder in cloud['folders'] %}
  26. {{ folder }}:
  27. file.directory:
  28. - name: /etc/salt/{{ folder }}
  29. - user: root
  30. - group: root
  31. - file_mode: 744
  32. - dir_mode: 755
  33. - makedirs: True
  34. {% endfor %}
  35. {% for cert in pillar.get('salt_cloud_certs', {}) %}
  36. {% for type in ['pem'] %}
  37. cloud-cert-{{ cert }}-pem:
  38. file.managed:
  39. - name: /etc/salt/cloud.providers.d/key/{{ cert }}.pem
  40. - source: salt://salt/files/key
  41. - template: jinja
  42. - user: root
  43. - group: root
  44. - mode: 600
  45. - defaults:
  46. key: {{ cert }}
  47. type: {{ type }}
  48. {% endfor %}
  49. {% endfor %}
  50. {% for providers in cloud['providers'] %}
  51. salt-cloud-profiles-{{ providers }}:
  52. file.managed:
  53. - name: /etc/salt/cloud.profiles.d/{{ providers }}.conf
  54. - template: jinja
  55. - source: salt://salt/files/cloud.profiles.d/{{ providers }}.conf
  56. {% endfor %}
  57. {% for providers in cloud['providers'] %}
  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. {% endfor %}
  64. {% for providers in cloud['providers'] %}
  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 %}