saltstack-formulas / hostsfile-formula

Use minion IDs to keep /etc/hosts and hostnames consistent for clusters without DNS
http://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html
Other
33 stars 89 forks source link

Entry not updated on IP change #20

Open simonclausen opened 8 years ago

simonclausen commented 8 years ago

It seems that entries are only added when found, but not updated when the IP of a minion changes.

I have not read through the entire formula, so I am unsure if this is intended behavior, a general bug or maybe a bug specific to my setup.

I will provide details if needed.

blbradley commented 8 years ago

This is the correct behavior of this formula and state host.present which this formula uses. Read the note here. You're probably looking for state host.only which is available in salt v2016.3.0.

Personally, I hope that this formula moves to using host.only while preserving backwards compatibility.

gilou commented 5 years ago

Well, this is interesting, what about having something like an exclusive setting in pilllar to do this ? Also this probably only needs to apply on hosts coming from the mine, as otherwise one would probably put them in the host only list...

gilou commented 5 years ago

ah, that is not how hosts.only works.