Skip to content

Commit

Permalink
Allow to specify different reactors for minions and masters
Browse files Browse the repository at this point in the history
  • Loading branch information
javierbertoli committed May 22, 2017
1 parent eaf9fc9 commit 442806a
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 3 deletions.
22 changes: 19 additions & 3 deletions pillar.example
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,13 @@ salt:
type: runner
cmd: jobs.list_jobs

# optional: these reactors will be configured on the master
# They override reactors configured in
# 'salt:reactors' or the old 'salt:reactor' parameters
reactors:
- 'master/deploy':
- /srv/salt/reactors/deploy.sls

# salt minion config:
minion:

Expand Down Expand Up @@ -171,6 +178,12 @@ salt:
- 1.0
interval: 10

# Optional reactors: these reactors will be configured on the minion
# They override reactors configured in
# 'salt:reactors' or the old 'salt:reactor' parameters
reactors:
- 'master/deploy':
- /srv/salt/reactors/deploy.sls

# salt cloud config
cloud:
Expand Down Expand Up @@ -229,9 +242,7 @@ salt:
- IAD
- SYD
- HKG
reactor:
- 'deploy':
- /srv/salt/reactors/deploy.sls

ssh_roster:
prod1:
host: host.example.com
Expand All @@ -249,6 +260,11 @@ salt:
pub: |
...........

# These reactors will be configured both to the minion and the master
reactors:
- 'deploy':
- /srv/salt/reactors/deploy.sls

salt_cloud_certs:
aws:
pem: |
Expand Down
4 changes: 4 additions & 0 deletions salt/files/master.d/reactor.conf
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
#
# This file is managed by Salt! Do not edit by hand!
#
{# The parameter reactor is kept for backward compatibility -#}
{%- set reactors = salt['pillar.get']('salt:reactor') -%}
{%- set reactors = salt['pillar.get']('salt:reactors', default=reactors, merge=True) -%}
{%- set reactors = salt['pillar.get']('salt:master:reactors', default=reactors, merge=True) -%}

{%- if reactors %}
reactor:
{%- for reactor in reactors %}
Expand Down
4 changes: 4 additions & 0 deletions salt/files/minion.d/reactor.conf
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
#
# This file is managed by Salt! Do not edit by hand!
#
{# The parameter reactor is kept for backward compatibility -#}
{%- set reactors = salt['pillar.get']('salt:reactor') -%}
{%- set reactors = salt['pillar.get']('salt:reactors', default=reactors, merge=True) -%}
{%- set reactors = salt['pillar.get']('salt:minion:reactors', default=reactors, merge=True) -%}

{%- if reactors %}
reactor:
{%- for reactor in reactors %}
Expand Down

0 comments on commit 442806a

Please sign in to comment.