|  | 
|  | 1 | +# freeipa_server_users | 
|  | 2 | + | 
|  | 3 | +Create superusers in FreeIPA. | 
|  | 4 | + | 
|  | 5 | +This role creates superuser accounts in a FreeIPA environment. It's used to establish administrative accounts that are then added to a specified group, typically the **admins** group, to ensure they have the necessary permissions. The role is highly configurable, allowing you to define one or more superusers with their personal details and passwords. | 
|  | 6 | + | 
|  | 7 | +## Requirements | 
|  | 8 | + | 
|  | 9 | +- A running and accessible **FreeIPA server**. | 
|  | 10 | +- The `ipaadmin_principal` must have permissions to create users and manage groups within the FreeIPA environment. | 
|  | 11 | +- Network connectivity from the Ansible controller (or the execution host) to the FreeIPA server. | 
|  | 12 | + | 
|  | 13 | +## Dependencies | 
|  | 14 | + | 
|  | 15 | +None. | 
|  | 16 | + | 
|  | 17 | +## Parameters | 
|  | 18 | + | 
|  | 19 | +| Variable | Type | Required | Default | Description | | 
|  | 20 | +| --- | --- | --- | --- | --- | | 
|  | 21 | +| `superuser_accounts` | `list` of `dict` | `False` | `[{'user': 'superuser', 'given_name': 'Cloudera', 'surname': 'Labs', 'password': 'superuser', 'display_name': 'Cloudera Labs Superuser'}]` | A list of superuser accounts to create. Each dictionary requires `user`, `given_name`, `surname`, and `password`. `display_name` is optional. | | 
|  | 22 | +| `superuser_group` | `str` | `False` | `admins` | The group to which the new superuser accounts will be added. | | 
|  | 23 | +| `ipaadmin_password` | `str` | `True` | | The password for the **FreeIPA** admin principal. This should be stored securely, for example, using Ansible Vault. | | 
|  | 24 | +| `ipaadmin_principal` | `str` | `False` | `admin` | The principal (username) for authenticating to the **FreeIPA** server. | | 
|  | 25 | +| `ipaserver_host` | `str` | `False` | `inventory_hostname` | The hostname or IP address of the **FreeIPA** server. | | 
|  | 26 | + | 
|  | 27 | +## Example Playbook | 
|  | 28 | + | 
|  | 29 | +```yaml | 
|  | 30 | +- hosts: ipaserver_host | 
|  | 31 | +  tasks: | 
|  | 32 | +    - name: Create default superuser | 
|  | 33 | +      ansible.builtin.import_role: | 
|  | 34 | +        name: cloudera.exe.freeipa_server_users | 
|  | 35 | +      vars: | 
|  | 36 | +        ipaadmin_password: "MySuperSecretAdminPassword" # Use Ansible Vault | 
|  | 37 | +        # All other values will use their defaults. | 
|  | 38 | + | 
|  | 39 | +    - name: Create multiple superusers and add to a custom group | 
|  | 40 | +      ansible.builtin.import_role: | 
|  | 41 | +        name: cloudera.exe.freeipa_server_users | 
|  | 42 | +      vars: | 
|  | 43 | +        ipaadmin_password: "MySuperSecretAdminPassword" # Use Ansible Vault | 
|  | 44 | +        superuser_group: "power_users" | 
|  | 45 | +        superuser_accounts: | 
|  | 46 | +          - user: "ops_admin" | 
|  | 47 | +            given_name: "Operations" | 
|  | 48 | +            surname: "Admin" | 
|  | 49 | +            password: "OpsAdminPassword123" | 
|  | 50 | +          - user: "dev_admin" | 
|  | 51 | +            given_name: "Development" | 
|  | 52 | +            surname: "Admin" | 
|  | 53 | +            password: "DevAdminPassword456" | 
|  | 54 | +``` | 
|  | 55 | +
 | 
|  | 56 | +## License | 
|  | 57 | +
 | 
|  | 58 | +``` | 
|  | 59 | +Copyright 2025 Cloudera, Inc. | 
|  | 60 | + | 
|  | 61 | + Licensed under the Apache License, Version 2.0 (the "License"); | 
|  | 62 | + you may not use this file except in compliance with the License. | 
|  | 63 | + You may obtain a copy of the License at | 
|  | 64 | + | 
|  | 65 | +     https://www.apache.org/licenses/LICENSE-2.0 | 
|  | 66 | + | 
|  | 67 | + Unless required by applicable law or agreed to in writing, software | 
|  | 68 | + distributed under the License is distributed on an "AS IS" BASIS, | 
|  | 69 | + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 
|  | 70 | + See the License for the specific language governing permissions and | 
|  | 71 | + limitations under the License. | 
|  | 72 | +``` | 
0 commit comments