Added support for downloading formulas from multiple baseurls into the same environment.
This commit is contained in:
parent
337c48b14c
commit
d1cbec3fe2
|
@ -160,9 +160,11 @@ salt_formulas:
|
||||||
# List of formulas to enable in each environment
|
# List of formulas to enable in each environment
|
||||||
list:
|
list:
|
||||||
base:
|
base:
|
||||||
|
https://github.com/saltstack-formulas:
|
||||||
- salt-formula
|
- salt-formula
|
||||||
- postfix-formula
|
- postfix-formula
|
||||||
dev:
|
dev:
|
||||||
|
https://github.com/saltstack-formulas
|
||||||
- salt-formula
|
- salt-formula
|
||||||
- postfix-formula
|
- postfix-formula
|
||||||
- openssh-formula
|
- openssh-formula
|
||||||
|
|
|
@ -16,10 +16,12 @@
|
||||||
|
|
||||||
{%- macro formulas_roots(env) -%}
|
{%- macro formulas_roots(env) -%}
|
||||||
{%- set value = [] -%}
|
{%- set value = [] -%}
|
||||||
{%- for dir in formulas.get(env, []) -%}
|
{%- for repo,f_name in formulas.get(env, {}).items() -%}
|
||||||
|
{%- for dir in f_name -%}
|
||||||
{%- set basedir = formulas_git_opt(env, 'basedir')|load_yaml -%}
|
{%- set basedir = formulas_git_opt(env, 'basedir')|load_yaml -%}
|
||||||
{%- do value.append('{0}/{1}'.format(basedir, dir)) -%}
|
{%- do value.append('{0}/{1}'.format(basedir, dir)) -%}
|
||||||
{%- endfor -%}
|
{%- endfor -%}
|
||||||
|
{%- endfor -%}
|
||||||
{{ value|yaml }}
|
{{ value|yaml }}
|
||||||
{%- endmacro -%}
|
{%- endmacro -%}
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,8 @@
|
||||||
{% from "salt/formulas.jinja" import formulas_git_opt with context %}
|
{% from "salt/formulas.jinja" import formulas_git_opt with context %}
|
||||||
|
|
||||||
# Loop over all formulas listed in pillar data
|
# Loop over all formulas listed in pillar data
|
||||||
{% for env, entries in salt['pillar.get']('salt_formulas:list', {}).items() %}
|
{% for env, elements in salt['pillar.get']('salt_formulas:list', {}).items() %}
|
||||||
|
{% for baseurl, entries in elements.items() %}
|
||||||
{% for entry in entries %}
|
{% for entry in entries %}
|
||||||
|
|
||||||
{% set basedir = formulas_git_opt(env, 'basedir')|load_yaml %}
|
{% set basedir = formulas_git_opt(env, 'basedir')|load_yaml %}
|
||||||
|
@ -26,7 +27,6 @@
|
||||||
{% if gitdir not in processed_gitdirs %}
|
{% if gitdir not in processed_gitdirs %}
|
||||||
{% do processed_gitdirs.append(gitdir) %}
|
{% do processed_gitdirs.append(gitdir) %}
|
||||||
{% set options = formulas_git_opt(env, 'options')|load_yaml %}
|
{% set options = formulas_git_opt(env, 'options')|load_yaml %}
|
||||||
{% set baseurl = formulas_git_opt(env, 'baseurl')|load_yaml %}
|
|
||||||
{{ gitdir }}:
|
{{ gitdir }}:
|
||||||
git.latest:
|
git.latest:
|
||||||
- name: {{ baseurl }}/{{ entry }}.git
|
- name: {{ baseurl }}/{{ entry }}.git
|
||||||
|
@ -43,3 +43,4 @@
|
||||||
|
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
{% endfor %}
|
||||||
|
|
Loading…
Reference in New Issue