Skip to content

Commit 86ba052

Browse files
authored
Add FreeIPA wildcard certificate profile role (#290)
Signed-off-by: Webster Mudge <[email protected]>
1 parent a5ff0fe commit 86ba052

File tree

13 files changed

+951
-1
lines changed

13 files changed

+951
-1
lines changed

docs/docsite/extra-docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
---
1616

17-
# sections:
17+
sections:
1818
# - title: Guides
1919
# toctree:
2020
# - design.md
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# freeipa_server_ecs
2+
3+
Install a wildcard certificate profile for FreeIPA
4+
5+
This role creates a certificate profile in FreeIPA specifically for issuing wildcard certificates. It configures a new profile to include a wildcard Subject Alternative Name (SAN), making it easy to generate certificates that secure multiple subdomains. This role is designed to be run directly on a FreeIPA server and will not modify an existing profile if one with the same name is already present.
6+
7+
## Requirements
8+
- The `ipaadmin_principal` must have permissions to manage certificate profiles in FreeIPA.
9+
- The role assumes it's being run on the FreeIPA server itself.
10+
11+
## Dependencies
12+
13+
None.
14+
15+
## Parameters
16+
| Variable| Type | Required | Default | Description |
17+
| --- | --- | --- | --- | --- |
18+
| `ipaadmin_principal` | `str` | `False` | `admin` | FreeIPA admin principal for authentication. |
19+
| `ipaadmin_password` | `str` | `True`| | FreeIPA admin password for authentication. This should be stored securely, e.g., using Ansible Vault. |
20+
| `ipaserver_domain` | `str` | `True` | | Domain name to use as the root zone for references within the profile (e.g., example.internal). |
21+
| `ipaserver_realm` | `str` | `True` | | Realm name to use for references within the profile (e.g., EXAMPLE.INTERNAL). |
22+
| `freeipa_wildcard_profile_name` | `str` | `False` | `wildcard` | The name of the wildcard certificate profile to create in FreeIPA. |
23+
24+
## Example Playbook
25+
26+
```yaml
27+
- hosts: ipaserver_host
28+
tasks:
29+
- name: Create the default wildcard certificate profile in FreeIPA
30+
ansible.builtin.import_role:
31+
name: cloudera.exe.freeipa_server_wildcard_profile
32+
vars:
33+
ipaadmin_password: "MySuperSecretAdminPassword" # Use Ansible Vault
34+
ipaserver_domain: "example.internal"
35+
ipaserver_realm: "EXAMPLE.INTERNAL"
36+
37+
- name: Create a custom named wildcard certificate profile
38+
ansible.builtin.import_role:
39+
name: cloudera.exe.freeipa_server_wildcard_profile
40+
vars:
41+
ipaadmin_password: "MySuperSecretAdminPassword"
42+
ipaserver_domain: "apps.example.internal"
43+
ipaserver_realm: "EXAMPLE.INTERNAL"
44+
freeipa_wildcard_profile_name: "custom_profile"
45+
```
46+
47+
## License
48+
49+
```
50+
Copyright 2025 Cloudera, Inc.
51+
52+
Licensed under the Apache License, Version 2.0 (the "License");
53+
you may not use this file except in compliance with the License.
54+
You may obtain a copy of the License at
55+
56+
https://www.apache.org/licenses/LICENSE-2.0
57+
58+
Unless required by applicable law or agreed to in writing, software
59+
distributed under the License is distributed on an "AS IS" BASIS,
60+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
61+
See the License for the specific language governing permissions and
62+
limitations under the License.
63+
```
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
# Copyright 2025 Cloudera, Inc.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# https://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
ipaadmin_principal: admin
17+
ipaadmin_password: "{{ undef(hint='Please define the FreeIPA adminstrator principal password') }}"
18+
19+
ipaserver_domain: "{{ undef(hint='Please define the DNS domain') }}"
20+
ipaserver_realm: "{{ undef(hint='Please define the Kerberos realm') }}"
21+
22+
freeipa_wildcard_profile_name: wildcard
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
---
2+
# Copyright 2025 Cloudera, Inc.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# https://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
argument_specs:
17+
main:
18+
short_description: Install a wildcard certificate profile for FreeIPA
19+
description:
20+
- Create a certificate profile for a wildcard certificate in FreeIPA.
21+
- This profile will add a wildcard subject alternative name (SAN) to the issued certificate.
22+
- This role expects to be run on a FreeIPA server and will not update an existing profile.
23+
author: Cloudera Labs
24+
version_added: 3.1.0
25+
options:
26+
ipaadmin_principal:
27+
description: FreeIPA admin principal used for authentication.
28+
default: admin
29+
ipaadmin_password:
30+
description: FreeIPA admin password used for authentication.
31+
required: true
32+
ipaserver_domain:
33+
description:
34+
- Domain name to use as the root zone for references within the profile.
35+
required: true
36+
ipaserver_realm:
37+
description:
38+
- Realm to use for references within the profile.
39+
required: true
40+
freeipa_wildcard_profile_name:
41+
description: The name of the wildcard certificate profile to create.
42+
required: false
43+
default: wildcard
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
# Copyright 2025 Cloudera, Inc.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# https://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
- name: Converge
17+
hosts: all
18+
gather_facts: true
19+
tasks:
20+
- name: Provision ECS DNS entries
21+
ansible.builtin.import_role:
22+
name: cloudera.exe.freeipa_server_wildcard_profile
23+
vars:

0 commit comments

Comments
 (0)