ansible-ise icon indicating copy to clipboard operation
ansible-ise copied to clipboard

trusted_certificate_export_info needs the parameter hostname

Open bvargasre opened this issue 2 years ago • 1 comments

Prerequisites

  • [X] Have you tested the operation in the API directly?
  • [X] Do you have the latest ISE Collection version?

Describe the bug When I try to use cisco.ise.trusted_certificate_export_info to export certificates with ISE 3.2 and Ansible collection isco.ise 2.5.6 , it complains

Expected behavior Add hostname as a parameter

Screenshots

  msg: |-
    An error occured when executing operation. The error was: [400] - HostName should not be null
    {
      "status" : "Fail",
      "message" : "HostName should not be null"
    } 

image

Environment (please complete the following information):

  • ISE version and patch: 3.2
  • Ansible version: 2.12
  • ISE collection version: 2.4.0
  • OS version: macOS Monterey 12.0.1

bvargasre avatar Nov 02 '22 21:11 bvargasre

@1homas trusted_certificate_export_info in 3.1_patch_1 does not need HostName 3.2 is currently not supported

PLAY [ise_servers] ********************************************************************************************************

TASK [Get Trusted Certificate Export by id] *******************************************************************************
Attempt 1

Request
        URL: https://198.18.133.27/api/v1/certs/trusted-certificate/export/2ca80af4-286f-45f8-94d1-d73028f46198
        Method: GET
        Headers: 
                User-Agent: python-requests/2.27.1
                Accept-Encoding: gzip, deflate
                Accept: application/json
                Connection: keep-alive
                authorization: Basic YWRtaW46OTkzNDIy
                Content-type: application/json;charset=utf-8
        Params:
              {}
        Stream:
                True

Response
        Status: 200 - 
        Headers: 
                Content-Type: application/octet-stream
                Content-Length: 1192
                Connection: keep-alive
                Cache-Control: no-cache, no-store, must-revalidate, no-cache, no-store, must-revalidate
                Expires: Thu, 01 Jan 1970 00:00:00 GMT, 0
                Set-Cookie: JSESSIONIDSSO=CA099F59BA802E45607F8B31BD1C8874; Path=/; Secure; HttpOnly, APPSESSIONID=38616B1E37C48F6FABE756AF07858B0D; Path=/api; Secure; HttpOnly
                Pragma: no-cache, no-cache
                X-Request-ID: cebfb560-5aee-11ed-871d-665ae2ba47ca
                X-Frame-Options: SAMEORIGIN
                Strict-Transport-Security: max-age=31536000; includeSubDomains
                X-Content-Type-Options: nosniff
                X-Content-Security-Policy: default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; img-src 'self' data:;
                X-WebKit-CSP: default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; img-src 'self' data:;
                Content-Security-Policy: default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; img-src 'self' data:;
                X-XSS-Protection: 1; mode=block
                Content-Disposition: attachment; filename=CiscoRootCA2048.pem
                Accept-Ranges: bytes
                Date: Wed, 02 Nov 2022 20:42:03 GMT
                Server: 
ok: [ise_server]

TASK [ansible.builtin.debug] **********************************************************************************************
ok: [ise_server] => {
    "result": {
        "changed": false,
        "failed": false,
        "ise_response": {
            "data": "-----BEGIN CERTIFICATE-----\nMIIDQzCCAiugAwIBAgIQX/h7KCtU3I1CoxW1aMmt/zANBgkqhkiG9w0BAQUFADA1\nMRYwFAYDVQQKEw1DaXNjbyBTeXN0ZW1zMRswGQYDVQQDExJDaXNjbyBSb290IENB\nIDIwNDgwHhcNMDQwNTE0MjAxNzEyWhcNMjkwNTE0MjAyNTQyWjA1MRYwFAYDVQQK\nEw1DaXNjbyBTeXN0ZW1zMRswGQYDVQQDExJDaXNjbyBSb290IENBIDIwNDgwggEg\nMA0GCSqGSIb3DQEBAQUAA4IBDQAwggEIAoIBAQCwmrmrp68Kd6ficba0ZmKUeIhH\nxmJVhEAyv8CrLqUccda8bnuoqrpu0hWISEWdovyD0My5jOAmaHBKeN8hF570YQXJ\nFcjPFto1YYmUQ6iEqDGYeJu5Tm8sUxJszR2tKyS7McQr/4NEb7Y9JHcJ6r8qqB9q\nVvYgDxFUl4F1pyXOWWqCZe+36ufijXWLbvLdT6ZeYpzPEApk0E5tzivMW/VgpSdH\njWn0f84bcN5wGyDWbs2mAag8EtKpP6BrXruOIIt6keO1aO6g58QBdKhTCytKmg9l\nEg6CTY5j/e/rmxrbU6YTYK/CfdfHbBcl1HP7R2RQgYCUTOG/rksc35LtLgXfAgED\no1EwTzALBgNVHQ8EBAMCAYYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUJ/PI\nFR5umgIJFq0roIlgX9p7L6owEAYJKwYBBAGCNxUBBAMCAQAwDQYJKoZIhvcNAQEF\nBQADggEBAJ2dhISjQal8dwy3U8pORFBi71R803UXHOjgxkhLtv5MOhmBVrBW7hmW\nYqpao2TB9k5UM8Z3/sUcuuVdJcr18JOagxEu5sv4dEX+5wW4q+ffy0vhN4TauYuX\ncB7w4ovXsNgOnbFp1iqRe6lJT37mjpXYgyc81WhJDtSd9i7rp77rMKSsH0T8lasz\nBvt9YAretIpjsJyp8qS5UwGH0GikJ3+r/+n6yUA4iGe0OcaEb1fJU9u6ju7AQ7L4\nCYNu/2bPPu8Xs1gYJQk0XuPL1hS27PKSb3TkL4Eq1ZKR4OCXPDJoBYVL0fdX4lId\nkxpUnwVwwEpxYB5DC2Ae/qPOgRnhCzU=\n-----END CERTIFICATE-----\n",
            "dirpath": "/$PATH/CiscoISE/ansible-ise",
            "filename": "CiscoRootCA2048.pem",
            "path": "/$PATH/CiscoISE/ansible-ise/CiscoRootCA2048.pem"
        },
        "result": ""
    }
}

PLAY RECAP ****************************************************************************************************************
ise_server                 : ok=2    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0 

bvargasre avatar Nov 02 '22 22:11 bvargasre