Skip to content

Commit

Permalink
add distro information to automated server list (#282)
Browse files Browse the repository at this point in the history
  • Loading branch information
ewdurbin committed Sep 19, 2022
1 parent 3cc68cb commit 6171038
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
4 changes: 4 additions & 0 deletions pillar/dev/networking.sls
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,7 @@ mine_functions:

ipv6_addrs:
mine_function: network.ip_addrs6

osfinger:
- mine_function: grains.get
- osfinger
4 changes: 4 additions & 0 deletions pillar/prod/networking.sls
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,7 @@ mine_functions:
public_ipv4:
mine_function: network.ip_addrs
type: 'public'

osfinger:
- mine_function: grains.get
- osfinger
5 changes: 3 additions & 2 deletions salt/base/config/salt-server-list.rst.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@
{% endfor %}

.. csv-table::
:header: "Name", "Purpose", "Contact", "Datacener"
:header: "Name", "Purpose", "Contact", "Distro", "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 distro = salt['mine.get']("*", "osfinger").get(server, "") -%}
{% set roleconfig = salt["pillar.get"]("roles", {}).get(role, {}) %}
"{{ server }}", "{{ roleconfig.get("purpose", "") }}", "{{ roleconfig.get("contact", "") }}", "{{ datacenter }}"
"{{ server }}", "{{ roleconfig.get("purpose", "") }}", "{{ roleconfig.get("contact", "") }}", "{{ distro }}", "{{ datacenter }}"
{%- endfor %}

..
Expand Down

0 comments on commit 6171038

Please sign in to comment.