Skip to content
Snippets Groups Projects
Commit 23fd8b64 authored by Niels Abspoel's avatar Niels Abspoel
Browse files

Fix #39 multi master support to minion

This will fix #39

And it will be backwards compatible with the current pillar configuration.
parent 22fe873c
Branches
No related tags found
No related merge requests found
...@@ -30,7 +30,15 @@ salt: ...@@ -30,7 +30,15 @@ salt:
# salt minion config: # salt minion config:
minion: minion:
# single master setup
master: salt master: salt
# multi master setup
master:
- salt_master_1
- salt_master_2
fileserver_backend: fileserver_backend:
- git - git
- roots - roots
......
...@@ -23,7 +23,26 @@ ...@@ -23,7 +23,26 @@
# Set the location of the salt master server. If the master server cannot be # Set the location of the salt master server. If the master server cannot be
# resolved, then the minion will fail to start. # 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') }} {{ get_config('master', 'salt') }}
{%- endif -%}
{%- endif %}
# If multiple masters are specified in the 'master' setting, the default behavior # 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 # is to always try to connect to them in the order they are listed. If random_master is
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment