Browse Source

Merge pull request #49 from salt-formulas/soa

SOA relations modeling
doc/update-readme-tursted-ca-minions
Filip Pytloun 7 years ago
parent
commit
ea842b65c3
2 changed files with 45 additions and 1 deletions
  1. +31
    -0
      salt/meta/meta.yml
  2. +14
    -1
      salt/meta/salt.yml

+ 31
- 0
salt/meta/meta.yml View File

graph:
{%- if pillar.get('salt', {}).minion is defined %}
{%- from "salt/map.jinja" import minion with context %}
- host: {{ grains.id }}
service: salt.minion
type: software-config
relations:
{%- if minion.master is defined %}
- service: salt-master
{%- if minion.master.host in ['127.0.0.1', 'localhost'] %}
host: {{ grains.id }}
{%- else %}
host_from_target: {{ minion.master.host }}
{%- endif %}
direction: source
type: tcp-0mq
{%- endif %}
{%- endif %}
{%- if pillar.get('salt', {}).master is defined %}
{%- from "salt/map.jinja" import master with context %}
- host: {{ grains.id }}
service: salt.master
type: software-config
relations:
{%- if master.pillar.engine == 'reclass' %}
- host: {{ grains.id }}
service: reclass.storage
direction: source
type: local-file
{%- endif %}
{%- endif %}

+ 14
- 1
salt/meta/salt.yml View File

{%- set service_grains = {'salt': {'graph': []}} %}
{%- for service_name, service in pillar.items() %}
{%- set grains_fragment_file = service_name+'/meta/meta.yml' %}
{%- macro load_grains_file() %}{% include grains_fragment_file ignore missing %}{% endmacro %}
{%- set grains_yaml = load_grains_file()|load_yaml %}
{%- if grains_yaml is mapping %}
{%- for node in grains_yaml.graph %}
{%- do service_grains.salt.graph.append(node) %}
{%- endfor %}
{%- endif %}
{%- endfor %}
grain:
salt:
{{ service_grains|yaml(False)|indent(4) }}
orchestrate: orchestrate:
master: master:
priority: 60 priority: 60
priority: 400 priority: 400
require: require:
- salt: salt.master - salt: salt.master

minion: minion:
{%- if pillar.get('salt', {}).get('minion', {}).get('ca') %} {%- if pillar.get('salt', {}).get('minion', {}).get('ca') %}
pki: pki:

Loading…
Cancel
Save