From ab78766167e3c5978406cc984bd34a29ce5fa8ff Mon Sep 17 00:00:00 2001 From: matt Date: Fri, 18 Oct 2024 20:55:22 +1000 Subject: [PATCH 1/2] System cet export doco and arg spec update --- .../action/system_certificate_export_info.py | 6 +-- .../modules/system_certificate_export_info.py | 37 ++++++++++++++++++- 2 files changed, 39 insertions(+), 4 deletions(-) diff --git a/plugins/action/system_certificate_export_info.py b/plugins/action/system_certificate_export_info.py index f45e274a2..3a0ffbf2f 100644 --- a/plugins/action/system_certificate_export_info.py +++ b/plugins/action/system_certificate_export_info.py @@ -27,9 +27,9 @@ argument_spec = ise_argument_spec() # Add arguments specific for this module argument_spec.update(dict( - export=dict(type="str"), - hostName=dict(type="str"), - id=dict(type="str"), + export=dict(type="str", choices=['CERTIFICATE', 'CERTIFICATE_WITH_PRIVATE_KEY']), + hostName=dict(type="str", required=True), + id=dict(type="str", required=True), password=dict(type="str", no_log=True), dirPath=dict(type="str"), saveFile=dict(type="bool"), diff --git a/plugins/modules/system_certificate_export_info.py b/plugins/modules/system_certificate_export_info.py index 0dd25efe5..e7bccff8d 100644 --- a/plugins/modules/system_certificate_export_info.py +++ b/plugins/modules/system_certificate_export_info.py @@ -14,7 +14,9 @@ version_added: '1.0.0' extends_documentation_fragment: - cisco.ise.module_info -author: Rafael Campos (@racampos) +author: + - Rafael Campos (@racampos) + - Matthew Dennett (@matthewdennett) options: dirPath: description: Directory absolute path. Defaults to the current working directory. @@ -22,6 +24,9 @@ export: description: System Certificate Export Info's export. type: str + choices: + - CERTIFICATE + - CERTIFICATE_WITH_PRIVATE_KEY filename: description: The filename used to save the download file. type: str @@ -29,9 +34,11 @@ description: Hostname of the Cisco ISE node in which self-signed certificate should be generated. type: str + required: true id: description: System Certificate Export Info's id. type: str + required: true password: description: System Certificate Export Info's password. type: str @@ -68,6 +75,34 @@ password: string saveFile: true +- name: Export Certificate + cisco.ise.system_certificate_export_info: + ise_hostname: "{{ise_hostname}}" + ise_username: "{{ise_username}}" + ise_password: "{{ise_password}}" + ise_verify: "{{ise_verify}}" + dirPath: /tmp/downloads/ + export: CERTIFICATE + filename: certificate.zip + hostName: ise-node-001 + id: "{{certificate_id}}" + password: "{{certificate_password}}" + saveFile: true + +- name: Export Certificate and private key + cisco.ise.system_certificate_export_info: + ise_hostname: "{{ise_hostname}}" + ise_username: "{{ise_username}}" + ise_password: "{{ise_password}}" + ise_verify: "{{ise_verify}}" + dirPath: /tmp/downloads/ + export: CERTIFICATE_WITH_PRIVATE_KEY + filename: certificate_and_key.zip + hostName: ise-node-001 + id: "{{certificate_id}}" + password: "{{certificate_password}}" + saveFile: true + """ RETURN = r""" From 5ade2245b568c5aac0e54ed13213b8f0c33a44ef Mon Sep 17 00:00:00 2001 From: matt Date: Fri, 18 Oct 2024 21:00:22 +1000 Subject: [PATCH 2/2] Fix spelling in comment --- plugins/action/system_certificate_export_info.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/action/system_certificate_export_info.py b/plugins/action/system_certificate_export_info.py index 3a0ffbf2f..41ba3ad67 100644 --- a/plugins/action/system_certificate_export_info.py +++ b/plugins/action/system_certificate_export_info.py @@ -23,7 +23,7 @@ ise_argument_spec, ) -# Get common arguements specification +# Get common arguments specification argument_spec = ise_argument_spec() # Add arguments specific for this module argument_spec.update(dict(