If the mine function specified under hostsfile:alias returns nothing for a given
minion, the state 1. always returns dirty, and 2. appends multiple
copies of some other host in the hosts file -- I think always the last
one present, but I'm not sure. So you get something like this, assuming
there are four hosts and host4 is the one with no valid return:
Configuring the pillar as above and rigging the alias to return None for
minion should reproduce the problem.
Expected behaviour
Probably offending hosts should be ignored, or the state should return
an error, or something. In any case some check should be done that what
we're trying to add is really an IP address.
Attempts to fix the bug
I haven't poked around it yet.
Additional context
I am not sure if the underlying bug is in the formula or in salt itself.
Your setup
Formula commit hash / release tag
02c5de72b32e5b14ced692ead558f74964c09841
Versions reports (master & minion)
Master is 3001.1, minion is 3000.3:
Minion
Master
Pillar / config used
Pillar config is minimal:
And the alias:
Bug details
Describe the bug
If the mine function specified under
hostsfile:alias
returns nothing for a given minion, the state 1. always returns dirty, and 2. appends multiple copies of some other host in the hosts file -- I think always the last one present, but I'm not sure. So you get something like this, assuming there are four hosts andhost4
is the one with no valid return:Steps to reproduce the bug
Configuring the pillar as above and rigging the alias to return None for minion should reproduce the problem.
Expected behaviour
Probably offending hosts should be ignored, or the state should return an error, or something. In any case some check should be done that what we're trying to add is really an IP address.
Attempts to fix the bug
I haven't poked around it yet.
Additional context
I am not sure if the underlying bug is in the formula or in salt itself.