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

sphinx:
{%- set grains = {'sphinx': {'doc': {}}} %}
{%- for service_name, service in pillar.items() %} {%- for service_name, service in pillar.items() %}
{%- if service.get('_support', {}).get('sphinx', {}).get('enabled', False) %} {%- if service.get('_support', {}).get('sphinx', {}).get('enabled', False) %}
{%- set grains_fragment_file = service_name+'/meta/sphinx.yml' %} {%- set grains_fragment_file = service_name+'/meta/sphinx.yml' %}
{%- macro load_grains_file() %}{% include grains_fragment_file %}{% endmacro %} {%- macro load_grains_file() %}{% include grains_fragment_file %}{% endmacro %}
{%- set grains_yaml = load_grains_file()|load_yaml %} {%- 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 %} {%- endif %}
{%- endfor %} {%- endfor %}
{{ grains|yaml(False) }}

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

name: name:
value: {{ system.name }} value: {{ system.name }}
kernel: kernel:
value: {{ grains.kernel }} {{ grains.kernelrelease }}
value: {{ salt['grains.item']('kernel')['kernel'] }} {{ salt['grains.item']('kernelrelease')['kernelrelease'] }}
distribution: distribution:
value: {{ grains.lsb_distrib_description }}
value: {{ salt['grains.item']('lsb_distrib_description')['lsb_distrib_description'] }}
network: network:
name: Network name: Network
param: param:
value: {{ network.fqdn }} value: {{ network.fqdn }}
ip: ip:
name: IP Addresses name: IP Addresses
value: {{ grains.ipv4 }}
value: {{ salt['grains.item']('ipv4')['ipv4'] }}

Loading…
Cancel
Save