Add force reconnection feature to NAPALM Proxy Minions #48948
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR do?
One of the major disadvantages of the Proxy Minions is their rigidity in terms of connectivity: the connection with the remote device is established with the remote device at the time of the Minion startup and that connection is going to be used forever.
If one would execute a command on the device using different parameters (due to various causes, such as unable to authenticate with the user specified in the Pillar and the authentication system - say TACACS+ is not available, or the user has a DNS in the Pillar and the resolver is currently down and would like to use temporarily the IP address instead, etc.), it requires a updating the Pillar data and Proxy Minion process restart. This is less than ideal.
Salt fortunately is as always flexible enough and we can add a magic argument, say
force_reconnect
which tells to establish a separate connection with the args specified in-line. Example:Regular behaviour:
With
force_reconnect
:The above was used as an example proving that when
force_reconnect=True
it would indeed attempt to initiate a separate connection.