diff --git a/plugins/action/system_certificate_export_info.py b/plugins/action/system_certificate_export_info.py index f45e274a2..41ba3ad67 100644 --- a/plugins/action/system_certificate_export_info.py +++ b/plugins/action/system_certificate_export_info.py @@ -23,13 +23,13 @@ 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( - 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"""