Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
salt-formula
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
salt
salt-formula
Commits
b3a3fa4d
Commit
b3a3fa4d
authored
9 years ago
by
Brad Thurber
Browse files
Options
Downloads
Patches
Plain Diff
Ability to create non-templated cloud config files (maps/providers/profiles).
parent
0a601fc3
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
pillar.example
+31
-0
31 additions, 0 deletions
pillar.example
salt/cloud.sls
+25
-0
25 additions, 0 deletions
salt/cloud.sls
with
56 additions
and
0 deletions
pillar.example
+
31
−
0
View file @
b3a3fa4d
...
...
@@ -84,6 +84,37 @@ salt:
cloud:
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
# if you want to write your own.
template_sources:
...
...
This diff is collapsed.
Click to expand it.
salt/cloud.sls
+
25
−
0
View file @
b3a3fa4d
{% 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:
pkg.installed
...
...
@@ -58,6 +62,27 @@ salt-cloud-{{ dir }}:
- makedirs: True
{%- 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:
file.directory:
- name: {{ salt_settings.config_path }}/cloud.providers.d
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment