Skip to content

Commit

Permalink
Fix #39 multi master support to minion
Browse files Browse the repository at this point in the history
This will fix #39

And it will be backwards compatible with the current pillar configuration.
  • Loading branch information
aboe76 committed Feb 6, 2015
1 parent 22fe873 commit 23fd8b6
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pillar.example
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,15 @@ salt:

# salt minion config:
minion:

# single master setup
master: salt

# multi master setup
master:
- salt_master_1
- salt_master_2

fileserver_backend:
- git
- roots
Expand Down
19 changes: 19 additions & 0 deletions salt/files/minion.d/_defaults.conf
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,26 @@

# Set the location of the salt master server. If the master server cannot be
# resolved, then the minion will fail to start.
# master:salt
{%- if 'master' in cfg_minion -%}
{%- if cfg_minion['master'] is not string %}
master:
{% for name in cfg_minion['master'] -%}
- {{ name }}
{% endfor -%}
{%- else %}
{{ get_config('master', 'salt') }}
{%- endif %}
{% elif 'master' in cfg_salt -%}
{%- if cfg_salt['master'] is not string %}
master:
{% for name in cfg_salt['master'] -%}
- {{ name }}
{% endfor -%}
{%- else %}
{{ get_config('master', 'salt') }}
{%- endif -%}
{%- endif %}

# If multiple masters are specified in the 'master' setting, the default behavior
# is to always try to connect to them in the order they are listed. If random_master is
Expand Down

0 comments on commit 23fd8b6

Please sign in to comment.