Ability to create non-templated cloud config files (maps/providers/profiles).
This commit is contained in:
parent
0a601fc310
commit
b3a3fa4d72
|
@ -83,6 +83,37 @@ salt:
|
||||||
# salt cloud config
|
# salt cloud config
|
||||||
cloud:
|
cloud:
|
||||||
master: salt
|
master: salt
|
||||||
|
|
||||||
|
# For non-templated custom cloud provider/profile/map files
|
||||||
|
providers:
|
||||||
|
provider-filename1.conf:
|
||||||
|
vmware-prod:
|
||||||
|
driver: vmware
|
||||||
|
user: myusernameprod
|
||||||
|
password: mypassword
|
||||||
|
vmware-nonprod:
|
||||||
|
driver: vmware
|
||||||
|
user: myusernamenonprod
|
||||||
|
password: mypassword
|
||||||
|
profiles:
|
||||||
|
profile-filename1.conf:
|
||||||
|
server-non-prod:
|
||||||
|
clonefrom: rhel6xtemplatenp
|
||||||
|
grains:
|
||||||
|
platform:
|
||||||
|
name: salt
|
||||||
|
realm: lab
|
||||||
|
subscription_level: standard
|
||||||
|
memory: 8GB
|
||||||
|
num_cpus: 4
|
||||||
|
password: sUpErsecretey
|
||||||
|
provider: vmware-nonprod
|
||||||
|
maps:
|
||||||
|
map-filename1.map:
|
||||||
|
server-non-prod:
|
||||||
|
- host.mycompany.com:
|
||||||
|
grains:
|
||||||
|
environment: dev1
|
||||||
|
|
||||||
# You can take profile and map templates from an alternate location
|
# You can take profile and map templates from an alternate location
|
||||||
# if you want to write your own.
|
# if you want to write your own.
|
||||||
|
|
|
@ -1,5 +1,9 @@
|
||||||
{% from "salt/map.jinja" import salt_settings with context %}
|
{% from "salt/map.jinja" import salt_settings with context %}
|
||||||
|
|
||||||
|
{% set cloudmaps = salt['pillar.get']('salt:cloud:maps', {}) -%}
|
||||||
|
{% set cloudprofiles = salt['pillar.get']('salt:cloud:profiles', {}) -%}
|
||||||
|
{% set cloudproviders = salt['pillar.get']('salt:cloud:providers', {}) -%}
|
||||||
|
|
||||||
python-pip:
|
python-pip:
|
||||||
pkg.installed
|
pkg.installed
|
||||||
|
|
||||||
|
@ -58,6 +62,27 @@ salt-cloud-{{ dir }}:
|
||||||
- makedirs: True
|
- makedirs: True
|
||||||
{%- endfor %}
|
{%- endfor %}
|
||||||
|
|
||||||
|
{% for key, value in cloudmaps.items() %}
|
||||||
|
/etc/salt/cloud.maps.d/{{ key }}:
|
||||||
|
file.managed:
|
||||||
|
- contents: |
|
||||||
|
{{ value|yaml(False) | indent(8) }}
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
|
{% for key, value in cloudprofiles.items() %}
|
||||||
|
/etc/salt/cloud.profiles.d/{{ key }}:
|
||||||
|
file.managed:
|
||||||
|
- contents: |
|
||||||
|
{{ value|yaml(False) | indent(8) }}
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
|
{% for key, value in cloudproviders.items() %}
|
||||||
|
/etc/salt/cloud.providers.d/{{ key }}:
|
||||||
|
file.managed:
|
||||||
|
- contents: |
|
||||||
|
{{ value|yaml(False) | indent(8) }}
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
salt-cloud-providers-permissions:
|
salt-cloud-providers-permissions:
|
||||||
file.directory:
|
file.directory:
|
||||||
- name: {{ salt_settings.config_path }}/cloud.providers.d
|
- name: {{ salt_settings.config_path }}/cloud.providers.d
|
||||||
|
|
Loading…
Reference in New Issue