Saltstack Official Salt Formula
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

85 行
2.0KB

  1. {% from "salt/map.jinja" import salt with context %}
  2. {% do salt.update(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. {% if grains['os_family'] not in ['Debian', 'RedHat'] %}
  11. crypto:
  12. pip.installed:
  13. - require:
  14. - pkg: python-pip
  15. {% endif %}
  16. apache-libcloud:
  17. pip.installed:
  18. - require:
  19. - pkg: python-pip
  20. salt-cloud:
  21. pkg.installed:
  22. - name: {{ salt['salt-cloud'] }}
  23. - require:
  24. - pip: apache-libcloud
  25. - pip: pycrypto
  26. {% if grains['os_family'] not in ['Debian', 'RedHat'] %}
  27. - pip: crypto
  28. {% endif %}
  29. {% for folder in 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 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. {% endfor %}
  61. {% for providers in cloud['providers'] %}
  62. salt-cloud-providers-{{ providers }}:
  63. file.managed:
  64. - name: /etc/salt/cloud.providers.d/{{ providers }}.conf
  65. - template: jinja
  66. - source: salt://salt/files/cloud.providers.d/{{ providers }}.conf
  67. {% endfor %}
  68. {% for providers in cloud['providers'] %}
  69. salt-cloud-maps-{{ providers }}:
  70. file.managed:
  71. - name: /etc/salt/cloud.maps.d/{{ providers }}.conf
  72. - template: jinja
  73. - source: salt://salt/files/cloud.maps.d/{{ providers }}.conf
  74. {% endfor %}