diff --git a/states/roles/maintain/saltmaster/master b/states/roles/maintain/saltmaster/master index 3d6caa3..aea5fa0 100644 --- a/states/roles/maintain/saltmaster/master +++ b/states/roles/maintain/saltmaster/master @@ -441,7 +441,15 @@ file_roots: # To specify the order in which environments are merged, set the ordering # in the env_order option. Given a conflict, the last matching value will # win. -env_order: ['qual', 'prod'] +{% if pillar['branches'] is defined -%} +{%- if pillar['branches']['saltmaster'] is defined -%} +env_order: [ +{%- for branch in pillar['branches']['saltmaster'] -%} + '{{-branch}}', +{%- endfor -%} +'null'] +{%- endif %} +{%- endif %} # If top_file_merging_strategy is set to 'same' and an environment does not # contain a top file, the top file in the environment specified by default_top