소스 검색

Revert "Revert "Generate salt minion orchestration config""

This reverts commit a84007cf9e.

Change-Id: I547d741da0699abe3e645a0b767d55d5d53e0dbb
pull/73/head
Vasyl Saienko 6 년 전
부모
커밋
4a780bc836
2개의 변경된 파일29개의 추가작업 그리고 0개의 파일을 삭제
  1. +20
    -0
      salt/files/_orchestration.conf
  2. +9
    -0
      salt/master/minion.sls

+ 20
- 0
salt/files/_orchestration.conf 파일 보기

{%- from "salt/map.jinja" import master with context %}
{%- if master.enabled %}
{%- for environment_name, environment in master.get('environment', {}).iteritems() %}
{%- set formulas = environment.get('formula', {}) %}
{%- set priorities = {'orchestration':{'deploy':{'applications':{}}}} %}
{%- for formula_name, formula in formulas.iteritems() %}
{%- if salt['file.file_exists'](master.dir.files+'/'+environment_name+'/'+formula_name+'/meta/salt.yml') %}
{%- set orch_fragment_file = formula_name+'/meta/salt.yml' %}
{%- macro load_orch_file() %}{% include orch_fragment_file %}{% endmacro %}
{%- set orch_yaml = load_orch_file()|load_yaml %}
{%- if orch_yaml.orchestration is defined %}
{%- do priorities['orchestration']['deploy']['applications'].update({ formula_name: orch_yaml['orchestration']['deploy']['applications'][formula_name] }) %}
{%- endif %}
{%- endif %}
{%- endfor %}
{%- if priorities.orchestration.deploy.applications -%}
{{ priorities|yaml(False) }}
{%- endif %}
{%- endfor %}
{%- endif %}

+ 9
- 0
salt/master/minion.sls 파일 보기

include: include:
- salt.master.service - salt.master.service


/etc/salt/minion.d/_orchestration.conf:
file.managed:
- source: salt://salt/files/_orchestration.conf
- user: root
- template: jinja
- makedirs: true
- require:
- {{ master.install_state }}

{%- if master.minion is defined %} {%- if master.minion is defined %}


/srv/salt/minion_keys: /srv/salt/minion_keys:

Loading…
취소
저장