Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add new option to panos_active_in_ha module #560

Merged
merged 9 commits into from
Apr 16, 2024
12 changes: 10 additions & 2 deletions plugins/modules/panos_active_in_ha.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
- A simple boolean check, verifies if a node is an active (B(true)) or passive (B(false)) node in an HA pair.
- If node does not belong to an HA pair or the pair is no configured correctly the module will fail.
author: "Łukasz Pawlęga (@fosix)"
version_added: '2.18.0'
version_added: '2.20.0'
acelebanski marked this conversation as resolved.
Show resolved Hide resolved
requirements:
- pan-python can be obtained from PyPI U(https://pypi.python.org/pypi/pan-python)
- pandevice can be obtained from PyPI U(https://pypi.python.org/pypi/pandevice)
Expand All @@ -53,6 +53,12 @@
node's current state in an HA pair. Can be useful when working with partially upgraded nodes. Use with caution.
type: bool
default: false
ignore_non_functional:
description:
- Use with caution, when set to `True` will ignore if device state is `non-functional` on one of the nodes. Helpful
when verifying a state of a partially upgraded HA pair with vmseries plugin version mismatch.
type: bool
default: false
# """

EXAMPLES = """
Expand Down Expand Up @@ -112,6 +118,7 @@ def main():
argument_spec=dict(
force_fail=dict(type="bool", default=False),
skip_config_sync=dict(type="bool", default=False),
ignore_non_functional=dict(type="bool", default=False),
),
panorama_error="This is a firewall only module",
)
Expand All @@ -123,7 +130,8 @@ def main():
firewall = FirewallProxy(firewall=helper.get_pandevice_parent(module))

is_active = CheckFirewall(firewall).check_is_ha_active(
skip_config_sync=module.params["skip_config_sync"]
skip_config_sync=module.params["skip_config_sync"],
ignore_non_functional=module.params["ignore_non_functional"],
)

if module.params["force_fail"]:
Expand Down
Loading