:_mod-docs-content-type: PROCEDURE
[id="resolving-missing-HSM-file-prerequisites_{context}"]

= Resolving missing HSM file prerequisites

[role="_abstract"]
If the adoption fails because hardware security module (HSM) certificates or client software cannot be found, verify that the files exist and are accessible, and then re-create the Kubernetes secrets with the correct file paths.

Example error:

----
TASK [Validate Proteccio prerequisites exist] ****
fatal: [localhost]: FAILED! => {
    "msg": "Proteccio client ISO not found: /opt/proteccio/Proteccio3.06.05.iso"
}
----

.Procedure

. Verify that all required HSM files exist on the host where you are running the adoption commands:
+
[source,bash]
----
$ ls -la <path_to_client_cert>
$ ls -la <path_to_client_key>
$ ls -la <path_to_server_cert>
$ ls -la <path_to_hsm_config>
----
+
where:

`<path_to_client_cert>`::
Specifies the path to the HSM client certificate file.
`<path_to_client_key>`::
Specifies the path to the HSM client key file.
`<path_to_server_cert>`::
Specifies the path to the HSM server certificate file.
`<path_to_hsm_config>`::
Specifies the path to the `proteccio.rc` configuration file.

. If the files are in different locations than expected, delete and re-create the `proteccio-data` secret with the correct paths:
+
[source,bash]
----
$ oc delete secret proteccio-data -n openstack
$ oc create secret generic proteccio-data \
  --from-file=client.crt=<path_to_client_cert> \
  --from-file=client.key=<path_to_client_key> \
  --from-file=<hsm_server_cert_filename>=<path_to_server_cert> \
  --from-file=proteccio.rc=<path_to_hsm_config> \
  -n openstack
----

. Verify that the secret was created with the expected keys:
+
[source,bash]
----
$ oc get secret proteccio-data -n openstack -o jsonpath='{.data}' | python3 -c "import sys,json; print(list(json.load(sys.stdin).keys()))"
----
