saltstack/salt — pull request #13039 by felskrone (2014-05-26 14:01:00+00:00)
Title: Master from module

Currently the minion takes the salt-master ip from the minions config in a static way. There is no option to have the minion derive its master-ip from a module or in any other dynamic way. This does not scale in bigger environments where you might have multiple master and the need to distribute them evenly among your masters. You rather would not want to have several configs for several minions groups in which just the masters ip is different.

This patch allows the minion to define 'master_type' in its config. If 'master_type' is set to 'func', 'master' can be set to a modules function to have the minion load its master address from the given module. With a simple resync of the modules and a minion restart, the master can be switched and enables quite easy sharding of the minions to many masters dynamically.

This is probably not the prettiest way (raw module loading), but it works well. If you dont like it (what i'll understand) but still like the general idea, a hint on how to add this would be nice.