This section shows how to configure the Ansible instance to integrate with the Futurex PKCS #11 library.Documentation Index
Fetch the complete documentation index at: https://docs.futurex.com/llms.txt
Use this file to discover all available pages before exploring further.
Create a key pair
Perform the tasks in the following sections to create a key pair on the KMES Series 3:Set Futurex PKCS #11 environment variables
Perform the following steps to set Futurex PKCS #11 environment variables:Create a key pair on the KMES Series 3 by using pkcs11-tool
Perform the following steps to create a key pair on the KMES Series 3 by using pkcs11-tool:Ansible Playbooks
In Ansible, Playbooks perform automated tasks. You can reference the Futurex PKCS #11 library when performing these tasks inside the Playbook file to perform various functions, such as SSH and signing data. For more information on Ansible Playbooks, see the Ansible documentation.SSH example
The following example uses Futurex PKCS #11 with Ansible:Create an inventory file.The following code shows an example inventory file that uses localhost:
Shell
Shell
Create a The following code shows an example Ansible Playbook file for testing SSH referencing the private key created in the previous section (ansible_rsa_privatekey):
playbook.yml file.Shell
Shell
- Replace
pkcs11modulewith the location of the Futurex PKCS #11 library on your system. - Replace
pkcs11pinwith the password you configured for the identity created for this integration. - Replace
pkcs11keyidwith the label of the key you set when creating the key pair through pkcs11-tool.
To execute the Playbook and reference the private key stored on the HSM during SSH connection, run the following command, setting the username, inventory, and Playbook file information according to your setup:When prompted, enter thebecome_password in Ansible. The become directive escalates privileges when running tasks, similar to using sudo in the command line. The become_password is the password for the user specified in become_user (which defaults to root if not specified).
Shell
When prompted for the password of the user you are connecting to the machine with through SSH, enter it to complete the process.
If successful, you should see a response similar to the following:
Shell
Signing data example
The following example uses PKCS #11 with Ansible:Create an inventory file.The following code shows an example inventory file that uses localhost:
Shell
Shell
Create a The following code shows an example Ansible Playbook file for signing data referencing the private key created in the previous section (ansible_rsa_privatekey):
playbook.yml file.Shell
Shell
- Replace
pkcs11modulewith the location of the Futurex PKCS #11 library on your system. - Replace
pkcs11pinwith the password you configured for the identity created for this integration. - Replace
pkcs11keyidwith the label of the key you set when creating the key pair through pkcs11-tool.
To execute the Playbook and reference the private key stored on the HSM during SSH connection, run the following command, setting the username, inventory, and Playbook file information according to your setup:When prompted, enter the become_password in Ansible. The become directive escalates privileges when running tasks, similar to using sudo in the command line. The become_password is the password for the user specified in become_user (which defaults to root if not specified).
Shell
When prompted for the password of the user you are connecting to the machine with through SSH, enter it to complete the process.
If successful, you should see a response similar to the following:
Shell

