2015-03-17 05:39:32 +01:00
|
|
|
{% from "salt/map.jinja" import salt_settings with context %}
|
2014-07-20 16:59:38 +02:00
|
|
|
|
|
|
|
python-pip:
|
|
|
|
pkg.installed
|
|
|
|
|
|
|
|
pycrypto:
|
|
|
|
pip.installed:
|
|
|
|
- require:
|
|
|
|
- pkg: python-pip
|
|
|
|
|
2014-11-13 02:56:15 +01:00
|
|
|
{% if grains['os_family'] not in ['Debian', 'RedHat'] %}
|
2014-11-05 20:59:26 +01:00
|
|
|
crypto:
|
|
|
|
pip.installed:
|
|
|
|
- require:
|
|
|
|
- pkg: python-pip
|
2014-11-06 19:33:53 +01:00
|
|
|
{% endif %}
|
2014-11-05 20:59:26 +01:00
|
|
|
|
2014-07-20 16:59:38 +02:00
|
|
|
apache-libcloud:
|
|
|
|
pip.installed:
|
|
|
|
- require:
|
|
|
|
- pkg: python-pip
|
|
|
|
|
2015-03-24 18:08:08 +01:00
|
|
|
{% if salt_settings.install_packages %}
|
2014-07-20 16:59:38 +02:00
|
|
|
salt-cloud:
|
|
|
|
pkg.installed:
|
2015-03-17 05:39:32 +01:00
|
|
|
- name: {{ salt_settings.salt_cloud }}
|
2014-07-20 16:59:38 +02:00
|
|
|
- require:
|
|
|
|
- pip: apache-libcloud
|
|
|
|
- pip: pycrypto
|
2014-11-13 02:56:15 +01:00
|
|
|
{% if grains['os_family'] not in ['Debian', 'RedHat'] %}
|
2014-11-05 20:59:26 +01:00
|
|
|
- pip: crypto
|
2014-11-06 19:33:53 +01:00
|
|
|
{% endif %}
|
2015-03-24 18:08:08 +01:00
|
|
|
{% endif %}
|
2014-07-20 16:59:38 +02:00
|
|
|
|
2015-03-30 19:54:50 +02:00
|
|
|
{% for cert in pillar.get('salt_cloud_certs', {}) %}
|
2014-07-20 16:59:38 +02:00
|
|
|
{% for type in ['pem'] %}
|
|
|
|
cloud-cert-{{ cert }}-pem:
|
|
|
|
file.managed:
|
2015-04-04 01:30:26 +02:00
|
|
|
- name: /etc/salt/pki/cloud/{{ cert }}.pem
|
2014-07-20 16:59:38 +02:00
|
|
|
- source: salt://salt/files/key
|
|
|
|
- template: jinja
|
|
|
|
- user: root
|
|
|
|
- group: root
|
|
|
|
- mode: 600
|
2015-04-04 01:30:26 +02:00
|
|
|
- makedirs: True
|
2014-07-20 16:59:38 +02:00
|
|
|
- defaults:
|
|
|
|
key: {{ cert }}
|
|
|
|
type: {{ type }}
|
|
|
|
{% endfor %}
|
|
|
|
{% endfor %}
|
|
|
|
|
2015-04-04 01:30:26 +02:00
|
|
|
{%- for dir in ['providers', 'profiles', 'maps'] %}
|
|
|
|
{%- set source = salt_settings.cloud.template_sources.get(dir) %}
|
2015-04-03 23:33:25 +02:00
|
|
|
salt-cloud-{{ dir }}:
|
|
|
|
file.recurse:
|
|
|
|
- name: /etc/salt/cloud.{{ dir }}.d
|
|
|
|
- source: {{ source }}
|
2014-07-20 16:59:38 +02:00
|
|
|
- template: jinja
|
2015-04-04 01:30:26 +02:00
|
|
|
- user: root
|
|
|
|
- group: root
|
|
|
|
- dir_mode: 755
|
|
|
|
- file_mode: 644
|
|
|
|
- makedirs: True
|
2015-04-03 23:33:25 +02:00
|
|
|
{%- endfor %}
|