-
-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #244 from python/generate_automated_server_list
Generate template for automated server list
- Loading branch information
Showing
8 changed files
with
41 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
.. | ||
START AUTOMATED SECTION **DO NOT DIRECTLY EDIT - Salt will blow away your changes!!!** | ||
|
||
{% set role_mapping = {} -%} | ||
{% for role, config in salt["pillar.get"]("roles", {}).items() -%} | ||
{% set x=role_mapping.__setitem__(config["pattern"], role) -%} | ||
{% endfor %} | ||
|
||
.. csv-table:: | ||
:header: "Name", "Purpose", "Contact", "Datacener" | ||
|
||
{% for server in salt['minion.list']()['minions']|sort -%} | ||
{% set role = salt['match.filter_by'](role_mapping, minion_id=server) -%} | ||
{% set datacenter = salt['mine.get']("*", "psf_dc").get(server, "") -%} | ||
{% set roleconfig = salt["pillar.get"]("roles", {}).get(role, {}) %} | ||
"{{ server }}", "{{ roleconfig.get("purpose", "") }}", "{{ roleconfig.get("contact", "") }}", "{{ datacenter }}" | ||
{%- endfor %} | ||
|
||
.. | ||
END AUTOMATED SECTION **DO NOT DIRECTLY EDIT - Salt will blow away your changes!!!** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters