feat: non-interactive mode and firewall/batch CLI options to set firewalls to be upgraded #137
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.
Checklist for This Pull Request
🚨Please adhere to the guidelines for contributing to this repository.
Pull Request Description
This PR introduces
--non-interactive
option to firewall and batch commands as well as CLI options to set firewalls to be upgraded.Non interactive option
With the
--non-interactive
flag it is possible to upgrade firewalls non-interactively without being prompted for confirmations.Non-interactive mode requires parameters like hostname, username, password to be passed in order to avoid prompts.
Dry run behaviour adjusted to be the default selection in interactive mode, additionally when
--dry-run
option is set "dry run" prompts are avoided.You can only disable dry run by answering the dry run prompts as "no" or running the tool in non-interactive mode.
Firewall
--peer
and Batch--inventory
options to set firewalls to be upgraded--peer
CLI option introduced infirewall
command in order to allow specifying peer hostname/IP if auto-detected management IP is not accessible.--inventory
CLI option introduced inbatch
command to allow specifying the list of firewalls to upgrade in CLI.Usage
Non-interactive HA upgrade with firewall command and peer IP:
Non-interactive HA upgrade with batch command and inventory option:
Non-interactive standalone upgrade with firewall command:
What does this pull request accomplish?
Are there any breaking changes included?
Is there anything the reviewers should know?
Needed to change
common_setup
method to set dirs and logging only, and callconnect_to_host
separately because--dry-run
option should be overridden if--non-interactive
flag is set, and it should be prompted if--non-interactive
flag is NOT set at the very beginning of the method. This requiredlogging
which wasn't possible before callingcommon_setup
but setting up the connection was not necessary at this time.