|
| 1 | +# prereq_efm_database |
| 2 | + |
| 3 | +Set up database and user accounts for Edge Flow Manager |
| 4 | + |
| 5 | +This role automates the setup of a database and its associated user accounts specifically for Apache Edge Flow Manager services. The role creates the database and a dedicated user with ownership privileges, using sensible defaults that can be easily overridden. |
| 6 | + |
| 7 | +The role will: |
| 8 | +- Connect to the specified database server using administrative credentials. |
| 9 | +- Create a new database with the name specified by `efm_database`. |
| 10 | +- Create a new database user specified by `efm_username` with the password from `efm_password`. |
| 11 | +- Grant ownership and all necessary privileges to the `efm_username` for the new database. |
| 12 | +- Ensure the database is configured correctly for efm operations. |
| 13 | + |
| 14 | +# Requirements |
| 15 | + |
| 16 | +- A running and accessible database server of the specified `database_type`. |
| 17 | +- The `database_admin_user` must have sufficient administrative privileges to create new databases and users. |
| 18 | + |
| 19 | +# Dependencies |
| 20 | + |
| 21 | +None. |
| 22 | + |
| 23 | +# Parameters |
| 24 | + |
| 25 | +| Variable | Type | Required | Default | Description | |
| 26 | +| --- | --- | --- | --- | --- | |
| 27 | +| `database_type` | `str` | `True` | | Specifies the type of database to connect to. | |
| 28 | +| `database_host` | `str` | `True` | | The hostname or IP address of the database server. | |
| 29 | +| `database_admin_user` | `str` | `True` | | The username with administrative privileges used to manage the database. | |
| 30 | +| `database_admin_password` | `str` | `True` | | The password for the database administrative user. This variable is marked with `no_log: true` and will not be displayed in Ansible logs. | |
| 31 | +| `efm_username` | `str` | `False` | `efm` | The username for the efm database user. This user will also be the owner of the database. | |
| 32 | +| `efm_password` | `str` | `False` | `efm` | The password for the efm database user. It is highly recommended to override this default in production. | |
| 33 | +| `efm_database` | `str` | `False` | `efm` | The name of the database to be created for efm. | |
| 34 | + |
| 35 | +# Example Playbook |
| 36 | + |
| 37 | +```yaml |
| 38 | +- hosts: localhost |
| 39 | + tasks: |
| 40 | + - name: Set up efm database and user on PostgreSQL |
| 41 | + ansible.builtin.import_role: |
| 42 | + name: cloudera.exe.prereq_efm_database |
| 43 | + vars: |
| 44 | + database_type: "postgresql" |
| 45 | + database_host: "db-server.example.com" |
| 46 | + database_admin_user: "postgres" |
| 47 | + database_admin_password: "my_postgres_admin_password" |
| 48 | +``` |
| 49 | +
|
| 50 | +# License |
| 51 | +
|
| 52 | +``` |
| 53 | +Copyright 2025 Cloudera, Inc. |
| 54 | + |
| 55 | + Licensed under the Apache License, Version 2.0 (the "License"); |
| 56 | + you may not use this file except in compliance with the License. |
| 57 | + You may obtain a copy of the License at |
| 58 | + |
| 59 | + https://www.apache.org/licenses/LICENSE-2.0 |
| 60 | + |
| 61 | + Unless required by applicable law or agreed to in writing, software |
| 62 | + distributed under the License is distributed on an "AS IS" BASIS, |
| 63 | + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 64 | + See the License for the specific language governing permissions and |
| 65 | + limitations under the License. |
| 66 | +``` |
0 commit comments