This restores the original structure/behavior of the
`salt_formulas` Pillar key.
This commit is contained in:
Matthew X. Economou 2016-02-16 10:20:42 -05:00
parent b47fec3564
commit e8021220b8
3 changed files with 11 additions and 13 deletions

View File

@ -135,6 +135,9 @@ salt_formulas:
# environment, if an option is missing in a given environment, the
# value from "default" is used instead.
default:
# URL where the formulas git repositories are downloaded from
# it will be suffixed with <formula-name>.git
baseurl: https://github.com/saltstack-formulas
# Directory where Git repositories are downloaded
basedir: /srv/formulas
# Update the git repository to the latest version (False by default)
@ -157,11 +160,9 @@ salt_formulas:
# List of formulas to enable in each environment
list:
base:
https://github.com/saltstack-formulas:
- salt-formula
- postfix-formula
dev:
https://github.com/saltstack-formulas:
- salt-formula
- postfix-formula
- openssh-formula

View File

@ -16,12 +16,10 @@
{%- macro formulas_roots(env) -%}
{%- set value = [] -%}
{%- for repo,f_name in formulas.get(env, {}).items() -%}
{%- for dir in f_name -%}
{%- for dir in formulas.get(env, []) -%}
{%- set basedir = formulas_git_opt(env, 'basedir')|load_yaml -%}
{%- do value.append('{0}/{1}'.format(basedir, dir)) -%}
{%- endfor -%}
{%- endfor -%}
{{ value|yaml }}
{%- endmacro -%}

View File

@ -4,8 +4,7 @@
{% from "salt/formulas.jinja" import formulas_git_opt with context %}
# Loop over all formulas listed in pillar data
{% for env, elements in salt['pillar.get']('salt_formulas:list', {}).items() %}
{% for baseurl, entries in elements.items() %}
{% for env, entries in salt['pillar.get']('salt_formulas:list', {}).items() %}
{% for entry in entries %}
{% set basedir = formulas_git_opt(env, 'basedir')|load_yaml %}
@ -27,6 +26,7 @@
{% if gitdir not in processed_gitdirs %}
{% do processed_gitdirs.append(gitdir) %}
{% set options = formulas_git_opt(env, 'options')|load_yaml %}
{% set baseurl = formulas_git_opt(env, 'baseurl')|load_yaml %}
{{ gitdir }}:
git.latest:
- name: {{ baseurl }}/{{ entry }}.git
@ -43,4 +43,3 @@
{% endfor %}
{% endfor %}
{% endfor %}