# idrac_certificate Role to manage the iDRAC certificates - Generate Certificate Signing Request, Import/Export certificates, and Reset configuration - for PowerEdge servers. ## Requirements --- Requirements to develop and contribute to the role. ### Development ``` ansible docker molecule python ``` ### Production Requirements to use the role. ``` ansible python ``` ## Ansible collections Collections required to use the role. ``` dellemc.openmanage ``` ## Role Variables ---
Name Required Default Value Choices Type Description
hostname true str - iDRAC IP Address
username true str - iDRAC username
password true str - iDRAC user password.
https_port false 443 int - iDRAC port.
validate_certs false true bool - If C(false), the SSL certificates will not be validated.
- Configure C(false) only on personally controlled sites where self-signed certificates are used.
ca_path false path - The Privacy Enhanced Mail (PEM) file that contains a CA certificate to be used for the validation.
https_timeout false 30 int - The socket level timeout in seconds.
command false generate_csr 'import', 'export', 'generate_csr', 'reset' str - C(generate_csr), generate CSR. This requires I(cert_params) and I(certificate_path).
- C(import), import the certificate file. This requires I(certificate_path).
- C(export), export the certificate. This requires I(certificate_path).
- C(reset), reset the certificate to default settings. This is applicable only for C(HTTPS).
certificate_type false HTTPS 'HTTPS', 'CA', 'CSC', 'CLIENT_TRUST_CERTIFICATE', 'CUSTOMCERTIFICATE' str -Type of the iDRAC certificate:
- C(HTTPS) The Dell self-signed SSL certificate.
- C(CA) Certificate Authority(CA) signed SSL certificate.
- C(CSC) The custom signed SSL certificate.
- C(CLIENT_TRUST_CERTIFICATE) Client trust certificate.
- C(CUSTOMCERTIFICATE) The custom PKCS12 certificate and private key. Export of custom certificate is supported only on iDRAC firmware version 7.00.00.00 and above.
certificate_path false path - Absolute path of the certificate file if I(command) is C(import).
- Directory path with write permissions if I(command) is C(generate_csr) or C(export).
passpharse false str - The passphrase string if the certificate to be imported is passphrase protected.
ssl_key false path - Absolute path of the private or SSL key file.
- This is applicable only when I(command) is C(import) and I(certificate_type) is C(HTTPS).
- Uploading the SSL key on iDRAC is supported on version 6.00.02.00 and newer versions.
cert_params false dict
     common_name false str - The common name of the certificate.
     organization_unit false true str - The name associated with an organizational unit. For example, department name.
     locality_name false str - The city or other location where the entity applying for certification is located.
     state_name false str - The state where the entity applying for certification is located.
     country_code false str - The country code of the country where the entity applying for certification is located.
     email_address false str - The email associated with the CSR.
     organization_name false str - The name associated with an organization.
     subject_alt_name false [] list - The alternative domain names associated with the request.
resource_id false str - Redfish ID of the resource.
reset false true bool - To reset the iDRAC after the certificate operation.
- This is applicable when I(command) is C(import) or C(reset).
wait false 300 bool - Maximum wait time for iDRAC to start after the reset, in seconds.
- This is applicable when I(command) is C(import) or C(reset) and I(reset) is C(True).
## Fact variables
Name Sample Description
idrac_certificate_out { "certificate_path": "/root/Certs/192.168.0.1_202333_4130_HTTPS.pem", "changed": false, "msg": "Successfully performed the 'export' operation." } Module output of the cerificate export job.
## Examples --- ``` - name: Generate HTTPS certificate signing request ansible.builtin.import_role: name: idrac_certificate vars: hostname: "192.168.0.1" username: "user_name" password: "user_password" ca_path: "/path/to/ca_cert.pem" command: "generate_csr" certificate_type: "HTTPS" certificate_path: "/home/omam/mycerts" cert_params: common_name: "sample.domain.com" organization_unit: "OrgUnit" locality_name: "Bangalore" state_name: "Karnataka" country_code: "IN" email_address: "admin@domain.com" organization_name: "OrgName" subject_alt_name: - 192.198.2.1 ``` ``` - name: Importing certificate. ansible.builtin.import_role: name: idrac_certificate vars: hostname: "192.168.0.1" username: "user_name" password: "user_password" ca_path: "/path/to/ca_cert.pem" command: "import" certificate_type: "HTTPS" certificate_path: "/path/to/cert.pem" ``` ``` - name: Exporting certificate. ansible.builtin.import_role: name: idrac_certificate vars: hostname: "192.168.0.1" username: "user_name" password: "user_password" ca_path: "/path/to/ca_cert.pem" command: "export" certificate_type: "HTTPS" certificate_path: "/home/omam/mycert_dir" ``` ``` - name: Importing Custom Signing Certificate. ansible.builtin.import_role: name: idrac_certificate vars: hostname: "192.168.0.1" username: "user_name" password: "user_password" ca_path: "/path/to/ca_cert.pem" command: "import" certificate_type: "CSC" certificate_path: "/path/to/cert.pem" ``` ``` - name: Import an HTTPS certificate with private key. ansible.builtin.import_role: name: idrac_certificate vars: hostname: "192.168.0.1" username: "user_name" password: "user_password" ca_path: "/path/to/ca_cert.pem" command: "import" certificate_type: "HTTPS" certificate_path: "/path/to/cert.pem" ssl_key: "/path/to/ssl_key" ``` ``` - name: Exporting certificate. ansible.builtin.import_role: name: idrac_certificate vars: hostname: "192.168.0.1" username: "user_name" password: "user_password" ca_path: "/path/to/ca_cert.pem" command: "export" certificate_type: "CLIENT_TRUST_CERTIFICATE" certificate_path: "/home/omam/mycert_dir" ``` ## Author Information --- Dell Technologies
Shivam Sharma (Shivam.Sharma3@Dell.com) 2023
Jagadeesh N V (Jagadeesh.N.V@Dell.com) 2023