2
0

Merge pull request #216 from centromere/driver-version-check

Added version check for provider/driver backwards compatibility
This commit is contained in:
Wolodja Wentland 2016-04-01 08:22:01 +02:00
commit 633ce3630f
4 changed files with 16 additions and 0 deletions

View File

@ -15,5 +15,9 @@ ec2_ubuntu_public:
location: eu-west-1
availability_zone: eu-west-1a
ssh_username: ubuntu
{%- if grains.saltversioninfo[0] >= 2016 or (grains.saltversioninfo[0] >= 2015 and grains.saltversioninfo[1] >= 8) %}
driver: ec2
{%- else %}
provider: ec2
{%- endif %}
{%- endif %}

View File

@ -10,5 +10,9 @@ gce:
master: {{ cloud.get('master', 'salt') }}
grains:
test: True
{%- if grains.saltversioninfo[0] >= 2016 or (grains.saltversioninfo[0] >= 2015 and grains.saltversioninfo[1] >= 8) %}
driver: gce
{%- else %}
provider: gce
{%- endif %}
{%- endif %}

View File

@ -14,7 +14,11 @@ rsos_{{ region|lower }}:
compute_name: cloudServersOpenStack
protocol: ipv4
compute_region: {{ region }}
{%- if grains.saltversioninfo[0] >= 2016 or (grains.saltversioninfo[0] >= 2015 and grains.saltversioninfo[1] >= 8) %}
driver: openstack
{%- else %}
provider: openstack
{%- endif %}
user: {{ cloud.get('rsos_user', 'DEFAULT') }}
tenant: {{ cloud.get('rsos_tenant', 'DEFAULT') }}
apikey: {{ cloud.get('rsos_apikey', 'DEFAULT') }}

View File

@ -3,6 +3,10 @@
{% set cloud = salt['pillar.get']('salt:cloud', {}) -%}
saltify:
{%- if grains.saltversioninfo[0] >= 2016 or (grains.saltversioninfo[0] >= 2015 and grains.saltversioninfo[1] >= 8) %}
driver: saltify
{%- else %}
provider: saltify
{%- endif %}
minion:
master: {{ cloud.get('master', 'salt') }}