0
0
mirror of https://github.com/saltstack-formulas/salt-formula.git synced 2024-11-27 22:38:10 +01:00

Added pillar option to redirect profile and map folders.

This commit is contained in:
Andrew Vant 2015-04-03 17:33:25 -04:00
parent 1f43b96a00
commit fb1d7e8d3b
2 changed files with 16 additions and 12 deletions

View File

@ -82,6 +82,12 @@ salt:
- cloud.providers.d/key
- cloud.profiles.d
- cloud.maps.d
# You can take profile and map templates from an alternate location
# if desired.
profiles_src: salt://templates/cloud.profiles.d
maps_src: salt://templates/cloud.maps.d
providers:
- ec2
- gce

View File

@ -60,21 +60,19 @@ cloud-cert-{{ cert }}-pem:
{% endfor %}
{% for providers in salt_settings.cloud.providers %}
salt-cloud-profiles-{{ providers }}:
file.managed:
- name: /etc/salt/cloud.profiles.d/{{ providers }}.conf
- template: jinja
- source: salt://salt/files/cloud.profiles.d/{{ providers }}.conf
salt-cloud-providers-{{ providers }}:
file.managed:
- name: /etc/salt/cloud.providers.d/{{ providers }}.conf
- template: jinja
- source: salt://salt/files/cloud.providers.d/{{ providers }}.conf
salt-cloud-maps-{{ providers }}:
file.managed:
- name: /etc/salt/cloud.maps.d/{{ providers }}.conf
- template: jinja
- source: salt://salt/files/cloud.maps.d/{{ providers }}.conf
{% endfor %}
{%- for dir in ['profiles', 'maps'] %}
{%- set default_src = 'salt://salt/files/cloud.{}.d'.format(dir) %}
{%- set source = salt_settings.cloud.get(dir + "_src", default_src) %}
salt-cloud-{{ dir }}:
file.recurse:
- name: /etc/salt/cloud.{{ dir }}.d
- source: {{ source }}
- template: jinja
{%- endfor %}