diff --git a/changelogs/fragments/pdbadmin.yml b/changelogs/fragments/pdbadmin.yml new file mode 100644 index 000000000..15730d2cc --- /dev/null +++ b/changelogs/fragments/pdbadmin.yml @@ -0,0 +1,3 @@ +--- +minor_changes: + - "oradb_manage_pdb: added missing defaults for pdbadmin_user and pdbadmin_password (oravirt#426)" diff --git a/extensions/molecule/shared_config/inventory/group_vars/all/oracle_db.yml b/extensions/molecule/shared_config/inventory/group_vars/all/oracle_db.yml index 98728197b..70091808b 100644 --- a/extensions/molecule/shared_config/inventory/group_vars/all/oracle_db.yml +++ b/extensions/molecule/shared_config/inventory/group_vars/all/oracle_db.yml @@ -164,6 +164,7 @@ oracle_pdbs: - cdb: DB1 home: db19-si-ee pdb_name: ORCLPDB + pdbadmin_user: PDBROOT listener_port: 1521 state: present datafile_dest: /u01/app/oracle/oradata diff --git a/extensions/molecule/shared_config/inventory/group_vars/all/password.yml b/extensions/molecule/shared_config/inventory/group_vars/all/password.yml index 1750c7702..7bf3fabd9 100644 --- a/extensions/molecule/shared_config/inventory/group_vars/all/password.yml +++ b/extensions/molecule/shared_config/inventory/group_vars/all/password.yml @@ -3,8 +3,8 @@ oracle_wallet_password: wallet1: "aA_{{ ansible_machine_id }}" default_dbpass: Oracle_123 -# dbpasswords: -# DB1: -# sys: Oracle_123 -# ORCLPDB: -# sys: Oracle_123 +dbpasswords: + DB1: + SYS: Oracle123 + ORCLPDB: + PDBROOT: pdb diff --git a/roles/oradb_manage_pdb/README.md b/roles/oradb_manage_pdb/README.md index 9d5e3219f..b8b2a5fca 100644 --- a/roles/oradb_manage_pdb/README.md +++ b/roles/oradb_manage_pdb/README.md @@ -5,6 +5,9 @@ Manage pluggable databases in Oracle ## Table of content - [Requirements](#requirements) +- [Default Variables](#default-variables) + - [pdbadmin_password](#pdbadmin_password) + - [pdbadmin_user](#pdbadmin_user) - [Discovered Tags](#discovered-tags) - [Dependencies](#dependencies) - [License](#license) @@ -16,6 +19,32 @@ Manage pluggable databases in Oracle - Minimum Ansible version: `2.14.0` +## Default Variables + +### pdbadmin_password + +Password for pdb_admin user. + +#### Default value + +```YAML +pdbadmin_password: >- + {{ dbpasswords[odb.1.cdb][odb.1.pdb_name][pdbadmin_user] | default(default_dbpass) + }} +``` + +### pdbadmin_user + +Default pdb_admin user for newly created PDBs. + +Could be set in `oracle_pdbs` to define different pdb_admin user for each PDB. + +#### Default value + +```YAML +pdbadmin_user: >- + {{ odb[1].pdbadmin_user | default('PDBADMIN') }} +``` ## Discovered Tags diff --git a/roles/oradb_manage_pdb/defaults/main.yml b/roles/oradb_manage_pdb/defaults/main.yml index ed97d539c..c80b794e2 100644 --- a/roles/oradb_manage_pdb/defaults/main.yml +++ b/roles/oradb_manage_pdb/defaults/main.yml @@ -1 +1,14 @@ --- +# @var pdbadmin_user:description: > +# Default pdb_admin user for newly created PDBs. +# +# Could be set in `oracle_pdbs` to define different pdb_admin user for each PDB. +# @end +pdbadmin_user: >- + {{ odb[1].pdbadmin_user | default('PDBADMIN') }} + +# @var pdbadmin_password:description: > +# Password for pdb_admin user. +# @end +pdbadmin_password: >- + {{ dbpasswords[odb.1.cdb][odb.1.pdb_name][pdbadmin_user] | default(default_dbpass) }}