Kaynağa Gözat

ec2/gce profiles/providers are no longer configured if they are not used.

Needed because salt-cloud will attempt to load them even if they are
filled with invalid default values, creating error spam.
master
Andrew Vant 9 yıl önce
ebeveyn
işleme
a01249a7fc
4 değiştirilmiş dosya ile 13 ekleme ve 3 silme
  1. +4
    -1
      salt/files/cloud.profiles.d/ec2.conf
  2. +4
    -1
      salt/files/cloud.profiles.d/gce.conf
  3. +2
    -0
      salt/files/cloud.providers.d/ec2.conf
  4. +3
    -1
      salt/files/cloud.providers.d/gce.conf

+ 4
- 1
salt/files/cloud.profiles.d/ec2.conf Dosyayı Görüntüle

@@ -1,4 +1,6 @@
# This file managed by Salt, do not edit by hand!!
{% set cloud = salt['pillar.get']('salt:cloud', {}) -%}
{% if 'aws_key' in cloud %}
base_ubuntu_ec2:
provider: ec2_ubuntu_public
image: ami-cb4986bc
@@ -13,4 +15,5 @@ base_ubuntu_ec2:
SecurityGroupId:
- sg-6ec11d3b
tag: {'Environment': 'production', 'Role': 'ubuntu'}
sync_after_install: grains
sync_after_install: grains
{% endif %}

+ 4
- 1
salt/files/cloud.profiles.d/gce.conf Dosyayı Görüntüle

@@ -1,4 +1,6 @@
# This file managed by Salt, do not edit by hand!!
{%- set cloud = salt['pillar.get']('salt:cloud', {}) -%}
{%- if 'gce_project' in cloud %}
base_debian_gce:
image: debian-7-wheezy
size: g1-small
@@ -10,4 +12,5 @@ base_debian_gce:
delete_boot_pd: True
deploy: True
make_master: False
provider: gce
provider: gce
{%- endif %}

+ 2
- 0
salt/files/cloud.providers.d/ec2.conf Dosyayı Görüntüle

@@ -1,5 +1,6 @@
# This file managed by Salt, do not edit by hand!!
{% set cloud = salt['pillar.get']('salt:cloud', {}) -%}
{% if 'aws_key' in cloud %}
ec2_ubuntu_public:
minion:
master: {{ cloud.get('master', 'salt') }}
@@ -14,3 +15,4 @@ ec2_ubuntu_public:
availability_zone: eu-west-1a
ssh_username: ubuntu
provider: ec2
{% endif %}

+ 3
- 1
salt/files/cloud.providers.d/gce.conf Dosyayı Görüntüle

@@ -1,5 +1,6 @@
# This file managed by Salt, do not edit by hand!!
{% set cloud = salt['pillar.get']('salt:cloud', {}) -%}
{%- set cloud = salt['pillar.get']('salt:cloud', {}) -%}
{%- if 'gce_project' in cloud %}
gce:
project: "{{ cloud.get('gce_project', 'DEFAULT') }}"
service_account_email_address: "{{ cloud.get('gce_service_account_email_address', 'DEFAULT') }}"
@@ -9,3 +10,4 @@ gce:
grains:
test: True
provider: gce
{%- endif %}

Yükleniyor…
İptal
Kaydet