mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Minions check dns when re-connecting to a master
Check for a chainging dns record anytime a minion gets disconnected from it's master. See github issue #63654 #61482.
This commit is contained in:
parent
b1754eeb63
commit
d2c59f45b6
1 changed files with 75 additions and 105 deletions
|
@ -2826,27 +2826,6 @@ class Minion(MinionBase):
|
|||
# we are not connected anymore
|
||||
self.connected = False
|
||||
log.info("Connection to master %s lost", self.opts["master"])
|
||||
|
||||
if self.opts["master_type"] != "failover":
|
||||
# modify the scheduled job to fire on reconnect
|
||||
if self.opts["transport"] != "tcp":
|
||||
schedule = {
|
||||
"function": "status.master",
|
||||
"seconds": self.opts["master_alive_interval"],
|
||||
"jid_include": True,
|
||||
"maxrunning": 1,
|
||||
"return_job": False,
|
||||
"kwargs": {
|
||||
"master": self.opts["master"],
|
||||
"connected": False,
|
||||
},
|
||||
}
|
||||
self.schedule.modify_job(
|
||||
name=master_event(type="alive", master=self.opts["master"]),
|
||||
schedule=schedule,
|
||||
)
|
||||
else:
|
||||
# delete the scheduled job to don't interfere with the failover process
|
||||
if self.opts["transport"] != "tcp":
|
||||
self.schedule.delete_job(name=master_event(type="alive"))
|
||||
|
||||
|
@ -2914,28 +2893,19 @@ class Minion(MinionBase):
|
|||
},
|
||||
}
|
||||
self.schedule.modify_job(
|
||||
name=master_event(
|
||||
type="alive", master=self.opts["master"]
|
||||
),
|
||||
name=master_event(type="alive", master=self.opts["master"]),
|
||||
schedule=schedule,
|
||||
)
|
||||
|
||||
if (
|
||||
self.opts["master_failback"]
|
||||
and "master_list" in self.opts
|
||||
):
|
||||
if self.opts["master_failback"] and "master_list" in self.opts:
|
||||
if self.opts["master"] != self.opts["master_list"][0]:
|
||||
schedule = {
|
||||
"function": "status.ping_master",
|
||||
"seconds": self.opts[
|
||||
"master_failback_interval"
|
||||
],
|
||||
"seconds": self.opts["master_failback_interval"],
|
||||
"jid_include": True,
|
||||
"maxrunning": 1,
|
||||
"return_job": False,
|
||||
"kwargs": {
|
||||
"master": self.opts["master_list"][0]
|
||||
},
|
||||
"kwargs": {"master": self.opts["master_list"][0]},
|
||||
}
|
||||
self.schedule.modify_job(
|
||||
name=master_event(type="failback"),
|
||||
|
|
Loading…
Add table
Reference in a new issue