Browse Source

fix grains generation

tags/2016.12
Ales Komarek 9 years ago
parent
commit
f5e1777792
2 changed files with 6 additions and 5 deletions
  1. +3
    -2
      linux/files/sphinx.grain
  2. +3
    -3
      linux/meta/sphinx.yml

+ 3
- 2
linux/files/sphinx.grain View File

@@ -1,9 +1,10 @@
sphinx:
{%- set grains = {'sphinx': {'doc': {}}} %}
{%- for service_name, service in pillar.items() %}
{%- if service.get('_support', {}).get('sphinx', {}).get('enabled', False) %}
{%- set grains_fragment_file = service_name+'/meta/sphinx.yml' %}
{%- macro load_grains_file() %}{% include grains_fragment_file %}{% endmacro %}
{%- set grains_yaml = load_grains_file()|load_yaml %}
{{ service_name }}: {{ grains_yaml|yaml }}
{%- set _dummy = grains.sphinx.doc.update({ service_name: grains_yaml.doc }) %}
{%- endif %}
{%- endfor %}
{{ grains|yaml(False) }}

+ 3
- 3
linux/meta/sphinx.yml View File

@@ -9,9 +9,9 @@ doc:
name:
value: {{ system.name }}
kernel:
value: {{ grains.kernel }} {{ grains.kernelrelease }}
value: {{ salt['grains.item']('kernel')['kernel'] }} {{ salt['grains.item']('kernelrelease')['kernelrelease'] }}
distribution:
value: {{ grains.lsb_distrib_description }}
value: {{ salt['grains.item']('lsb_distrib_description')['lsb_distrib_description'] }}
network:
name: Network
param:
@@ -20,4 +20,4 @@ doc:
value: {{ network.fqdn }}
ip:
name: IP Addresses
value: {{ grains.ipv4 }}
value: {{ salt['grains.item']('ipv4')['ipv4'] }}

Loading…
Cancel
Save