29.4. Installing the Manager #
Install a compatible Postgres Pro DBMS instance on the host where the manager is to be installed.
It can be done using Ansible (preferred) or manually.
For more information about installation, refer to the official Postgres Pro documentation.
Create and configure the repository database. It can be done using Ansible (preferred) or manually:
Create the DBMS user on behalf of which the manager will connect to the repository database:
# sudo -u postgres createuser --pwprompt ppem
When executing this command, specify the DBMS user password.
Create the repository database:
# sudo -u postgres createdb -O ppem ppem
Ensure that the DBMS user can connect to the database:
# psql -h localhost -U ppem -d ppem
In case of connection issues, ensure that the HBA rule allowing the DBMS user to connect to the database, as well as the authorization method, are specified in the
pg_hba.confconfiguration file.For example, to allow the manager to connect to the
ppemrepository database on behalf of theppemuser, the following HBA rules may be configured:host ppem ppem ::1/128 trust host ppem ppem 127.0.0.1/32 trust
For more information, refer to the official Postgres Pro documentation on the
pg_hba.confconfiguration file.While connected to the
ppemrepository database on behalf of theppemuser, grant the DBMS user the privilege to read thepg_statisticsystem catalog:GRANT SELECT ON pg_catalog.pg_statistic TO ppem;
Obtain the connection string URL for the repository database (in the format supported by the pq Go PostgreSQL driver), for example:
postgres://ppem:
dbms_user_password@localhost/ppem
Specify the following variables for the manager host in the inventory:
ppem_manager_system_user(string, optional)The name of the operating system user to be used by the manager service.
If a non-root user is specified, it is created automatically.
Default value:
root.ppem_manager_system_group(string, optional)The name of the operating system group to be assigned to the user specified in
ppem_manager_system_user. This group is used by the manager service.Default value: the same as specified in
ppem_manager_system_user.ppem_manager_systemd_service_enabled(boolean, optional)Specifies whether to start the manager service automatically at the server startup.
Default value:
true— the service is started automatically.ppem_manager_config(dict, required)The configuration of the manager.
In
repo.url, specify the connection string for the repository database that was obtained earlier.Other parameters are optional.
ppem_manager_http_server_tls_cert_file_content(string, optional)The contents of the public certificate file, as a string.
This parameter must be specified if the
cert_fileparameter is set to a non-empty value.The Ansible role writes this content into the corresponding file. Note that the role does not create any directories, so ensure that the directories in the
cert_filepath exist.ppem_manager_http_server_tls_key_file_content(string, optional)The contents of the private key file, as a string.
This parameter must be specified if the
key_fileparameter is set to a non-empty value.The Ansible role writes this content into the corresponding file. Note that the role does not create any directories, so ensure that the directories in the
key_filepath exist.
Run the Ansible playbook that installs the manager on hosts listed in the inventory file, for example:
ansible-playbook pgpro.ppem.ppem_manager -l manager -i inventory.yml
29.4.1. What the Manager Role Does #
The role performs the following tasks when running the playbook:
Validating the variables in the inventory.
Configuring the Postgres Pro package repository, if necessary.
Installing the manager packages, if necessary.
Configuring the host environment:
Creating the user and group for the manager if a non-root user is specified in the inventory.
Configuring the systemd service for the manager.
Creating the public certificate and private key files, if necessary.
Creating the configuration file for the manager.
Enabling and starting the manager service, if necessary.