Browse Source

Add upgrade deployment metadata

The metadata will be used to get list of enabled applications
that implement formula based upgrades.

Change-Id: Ibc368d993aa1c3c8715598513467da78792c752b
pull/73/head
Vasyl Saienko 6 years ago
parent
commit
49511c1f76
1 changed files with 7 additions and 4 deletions
  1. +7
    -4
      salt/files/_orchestration.conf

+ 7
- 4
salt/files/_orchestration.conf View File

@@ -2,19 +2,22 @@
{%- if master.enabled %}
{%- for environment_name, environment in master.get('environment', {}).iteritems() %}
{%- set formulas = environment.get('formula', {}) %}
{%- set priorities = {'orchestration':{'deploy':{'applications':{}}}} %}
{%- set priorities = {'orchestration':{'deploy':{'applications':{}}, 'upgrade': {'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] }) %}
{%- if orch_yaml.orchestration.deploy is defined %}
{%- do priorities['orchestration']['deploy']['applications'].update({ formula_name: orch_yaml['orchestration']['deploy']['applications'][formula_name] }) %}
{%- endif %}
{%- if orch_yaml.orchestration.upgrade is defined %}
{%- do priorities['orchestration']['upgrade']['applications'].update({ formula_name: orch_yaml['orchestration']['upgrade']['applications'][formula_name] }) %}
{%- endif %}
{%- endif %}
{%- endif %}
{%- endfor %}
{%- if priorities.orchestration.deploy.applications -%}
{{ priorities|yaml(False) }}
{%- endif %}
{%- endfor %}
{%- endif %}

Loading…
Cancel
Save