Split reactor files

There now are reactor files to run highstate on:

* New nodes only
* Master nodes
* Minion nodes
This commit is contained in:
Pieter Noordhuis 2014-10-12 14:24:01 -07:00
parent d51c071982
commit 1152471db7
8 changed files with 30 additions and 17 deletions

View File

@ -38,7 +38,7 @@ cat <<EOF >/etc/salt/master.d/reactor.conf
# React to new minions starting by running highstate on them.
reactor:
- 'salt/minion/*/start':
- /srv/reactor/start.sls
- /srv/reactor/highstate-new.sls
EOF
# Install Salt

View File

@ -1,9 +0,0 @@
# This runs highstate on the ALL nodes.
#
# Used from the vSphere provider. The IP addresses of the minons are passed to
# the apiserver as arguments and every minion has static routes to every other
# minion. This means every node should be refreshed when a node is added.
#
highstate_run:
cmd.state.highstate:
- tgt: '*'

View File

@ -0,0 +1,10 @@
# This runs highstate on the master node(s).
#
# Some of the cluster deployment scripts pass the list of minion addresses to
# the apiserver as a command line argument. This list needs to be updated if a
# new minion is started, so run highstate on the master(s) when this happens.
#
highstate_master:
cmd.state.highstate:
- tgt: 'roles:kubernetes-master'
- expr_form: grain

View File

@ -0,0 +1,11 @@
# This runs highstate on the minion nodes.
#
# Some of the cluster deployment scripts use the list of minions on the minions
# themselves (for example: every minion is configured with static routes to
# every other minion on a vSphere deployment). To propagate changes throughout
# the pool, run highstate on all minions whenever a single minion starts.
#
highstate_minions:
cmd.state.highstate:
- tgt: 'roles:kubernetes-pool'
- expr_form: grain

View File

@ -0,0 +1,4 @@
# This runs highstate only on the NEW node, regardless of type.
highstate_new:
cmd.state.highstate:
- tgt: {{ data['id'] }}

View File

@ -1,5 +0,0 @@
# This runs highstate on the target node
highstate_run:
cmd.state.highstate:
- tgt: {{ data['id'] }}

View File

@ -92,7 +92,7 @@ cat <<EOF >/etc/salt/master.d/reactor.conf
# React to new minions starting by running highstate on them.
reactor:
- 'salt/minion/*/start':
- /srv/reactor/start.sls
- /srv/reactor/highstate-new.sls
EOF
cat <<EOF >/etc/salt/master.d/salt-output.conf

View File

@ -42,7 +42,9 @@ cat <<EOF >/etc/salt/master.d/reactor.conf
# React to new minions starting by running highstate on them.
reactor:
- 'salt/minion/*/start':
- /srv/reactor/highstate-all.sls
- /srv/reactor/highstate-new.sls
- /srv/reactor/highstate-masters.sls
- /srv/reactor/highstate-minions.sls
EOF
mkdir -p /srv/salt/nginx