Skip to content

Commit

Permalink
feat(panos_import): Add private key blocking to keypair import (#417)
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesholland-uk committed Jun 14, 2023
1 parent 378d5a6 commit 3fd5bac
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions plugins/modules/panos_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,11 @@
description:
- Passphrase used to decrypt the certificate and/or private key.
type: str
block_private_key_export:
description:
- When I(category=keypair), controls if the private key is allowed to be exported from PAN-OS in future.
- If this parameter is left undefined, the effective value with be no.
type: bool
custom_logo_location:
description:
- When I(category=custom-logo), import this logo file here.
Expand Down Expand Up @@ -286,6 +291,7 @@ def main():
certificate_name=dict(type="str"),
format=dict(type="str", choices=["pem", "pkcs12"]),
passphrase=dict(type="str", no_log=True),
block_private_key_export=dict(type="bool"),
custom_logo_location=dict(
type="str",
choices=[
Expand Down Expand Up @@ -334,6 +340,14 @@ def main():
params["certificate-name"] = module.params["certificate_name"]
params["format"] = module.params["format"]
params["passphrase"] = module.params["passphrase"]
src = "block_private_key_export"
dst = "block-private-key"
if module.params[src] is None:
params[dst] = None
elif module.params[src]:
params[dst] = "yes"
else:
params[dst] = "no"

elif category == "custom-logo":
params["where"] = module.params["custom_logo_location"]
Expand Down

0 comments on commit 3fd5bac

Please sign in to comment.