|
| 1 | +# freeipa_server_enrolled_tls |
| 2 | + |
| 3 | +Issue a TLS certificate and private key for an enrolled host |
| 4 | + |
| 5 | +This role issues a **TLS certificate and private key** for a host that is enrolled in FreeIPA. This is useful for hosts that are already members of the FreeIPA domain and need TLS certificates for their services. The process includes generating a private key and Certificate Signing Request (CSR), and then requesting a certificate from FreeIPA's Certificate Authority (CA) using the host's enrolled identity. |
| 6 | + |
| 7 | +The role will: |
| 8 | + |
| 9 | + * Authenticate to the FreeIPA server using the provided administrative credentials. |
| 10 | + * Generate a private key and CSR directly on the target host. |
| 11 | + * Request a TLS certificate from FreeIPA's CA for the enrolled host. |
| 12 | + * The certificate and key will be saved directly to their final locations. |
| 13 | + |
| 14 | + |
| 15 | +## Requirements |
| 16 | + |
| 17 | + * The target host must be already enrolled in the FreeIPA domain. |
| 18 | + * The `ipaadmin_principal` must have permissions to issue certificates in FreeIPA. |
| 19 | + * Write access to the specified certificate and key paths on the FreeIPA server. |
| 20 | + |
| 21 | +## Dependencies |
| 22 | + |
| 23 | +None. |
| 24 | + |
| 25 | +## Parameters |
| 26 | + |
| 27 | +| Variable | Type | Required | Default | Description | |
| 28 | +| --- | --- | --- | --- | --- | |
| 29 | +| `ipaadmin_password` | `str` | `True` | | **FreeIPA** admin password for authentication. | |
| 30 | +| `ipaadmin_principal` | `str` | `False` | `admin` | **FreeIPA** admin principal for authentication. | |
| 31 | +| `enrolled_hostname` | `str` | `True` | | The hostname for which the certificate will be issued. Must be an enrolled FreeIPA client. | |
| 32 | +| `enrolled_principal_type` | `str` | `False` | `host` | The type of principal for certificate request (e.g., host, service). | |
| 33 | +| `enrolled_cert_key_path` | `path` | `False` | `/etc/pki/tls/private/host.key` | The path on the target host to save the generated private key file. | |
| 34 | +| `enrolled_cert_csr_path` | `path` | `False` | `/etc/pki/tls/private/host.csr` | The path on the target host to save the generated CSR file. | |
| 35 | +| `enrolled_cert_path` | `path` | `False` | `/etc/pki/tls/certs/host.crt` | The path on the target host to save the issued TLS certificate. | |
| 36 | + |
| 37 | +## Example Playbook |
| 38 | + |
| 39 | +```yaml |
| 40 | +- hosts: enrolled_hosts |
| 41 | + tasks: |
| 42 | + - name: Issue a TLS certificate and private key for enrolled host |
| 43 | + ansible.builtin.import_role: |
| 44 | + name: cloudera.exe.freeipa_server_enrolled_tls |
| 45 | + vars: |
| 46 | + enrolled_hostname: "hostname.example.internal" |
| 47 | + ipaadmin_password: "password" |
| 48 | + enrolled_cert_key_path: "/etc/pki/tls/private/gateway.key" |
| 49 | + enrolled_cert_path: "/etc/pki/tls/certs/gateway.crt" |
| 50 | +``` |
| 51 | +
|
| 52 | +## License |
| 53 | +
|
| 54 | +``` |
| 55 | +Copyright 2025 Cloudera, Inc. |
| 56 | + |
| 57 | + Licensed under the Apache License, Version 2.0 (the "License"); |
| 58 | + you may not use this file except in compliance with the License. |
| 59 | + You may obtain a copy of the License at |
| 60 | + |
| 61 | + https://www.apache.org/licenses/LICENSE-2.0 |
| 62 | + |
| 63 | + Unless required by applicable law or agreed to in writing, software |
| 64 | + distributed under the License is distributed on an "AS IS" BASIS, |
| 65 | + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 66 | + See the License for the specific language governing permissions and |
| 67 | + limitations under the License. |
| 68 | +``` |
0 commit comments