29.4. Installing the Manager #

  1. 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.

  2. Create and configure the repository database. It can be done using Ansible (preferred) or manually:

    1. 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.

    2. Create the repository database:

      # sudo -u postgres createdb -O ppem ppem
      
    3. 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.conf configuration file.

      For example, to allow the manager to connect to the ppem repository database on behalf of the ppem user, 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.conf configuration file.

    4. While connected to the ppem repository database on behalf of the ppem user, grant the DBMS user the privilege to read the pg_statistic system catalog:

      GRANT SELECT ON pg_catalog.pg_statistic TO ppem;
      
    5. 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
      
  3. 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_file parameter 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_file path 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_file parameter 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_file path exist.

  4. 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:

  1. Validating the variables in the inventory.

  2. Configuring the Postgres Pro package repository, if necessary.

  3. Installing the manager packages, if necessary.

  4. Configuring the host environment:

    1. Creating the user and group for the manager if a non-root user is specified in the inventory.

    2. Configuring the systemd service for the manager.

    3. Creating the public certificate and private key files, if necessary.

    4. Creating the configuration file for the manager.

    5. Enabling and starting the manager service, if necessary.

FAQ