If the default administrator account has been deleted, if its password has been changed and lost, or if any other action has resulted in the inability to log in under any account, a recovery procedure is provided. It restores the admin account with the default password admin and the Super Admin role. As part of the process, the Super Admin role is also restored with all maximum-level privileges. The recovery is performed using the restore-default-admin.yml playbook from the installation playbook archive (see v1.0_3.2 Installation using Ansible playbooks).
The restoration process connects to the database and creates or updates the administrator account. By default, the database connection uses the address specified in the hosts.yml file under the common_host section.
During the first run, the playbook will require installation of the python3-psycopg2 library, which requires Internet access from the target host. |
Run the playbook using the following command:
ansible-playbook --ask-become-pass restore-default-admin.yml |
To run the playbook on a specific host defined in hosts.yml, specify it as follows:
ansible-playbook --ask-become-pass restore-default-admin.yml -e "working_host=common_host" |
If a high-availability setup is used, in which the PostgreSQL database runs as a cluster, the playbook must be executed on the node that currently holds the Primary role. By default, this is the node specified in the node_primary section of the hosts.yml file:
ansible-playbook --ask-become-pass restore-default-admin.yml -e "working_host=node_primary" |
If the Primary role is assigned to the second node, run the command on that node instead:
ansible-playbook --ask-become-pass restore-default-admin.yml -e "working_host=node_standby" |
Running the playbook on a node in Standby (read-only) state will result in an error because the database does not allow write operations. This will not affect the database cluster’s functionality or state. |
To check the cluster state and determine the role of each node, connect to each node and run the following command inside the PostgreSQL container:
|