29.5. Installing Agents #

  1. The agent requires an API key to interact with the manager.

    Access the PPEM web application to obtain the key:

    1. In a web browser, go to the following URL:

      http://PPEM_manager_host_address:8080/
      
    2. On the authorization page, enter the default admin username and admin password, then click Log in.

    3. In the navigation panel, go to Summary.

    4. The agent installation instruction will be displayed on the page. Copy the key from the instruction.

    5. If the agent installation instruction was accidentally closed:

      1. In the navigation panel, go to Infrastructure → Agents.

      2. In the Authentication key column next to any agent, click to copy the key.

  2. Specify the following variables for the agent hosts in the inventory:

    ppem_agent_system_user (string, optional)

    The name of the operating system user to be used by the agent service.

    If a non-root user is specified, it is created automatically.

    Default value: root.

    ppem_agent_system_group (string, optional)

    The name of the operating system group to be assigned to the user specified in ppem_agent_system_user. This group is used by the agent service.

    Default value: the same as specified in ppem_agent_system_user.

    ppem_agent_systemd_service_enabled (boolean, optional)

    Specifies whether to start the agent service automatically at the server startup.

    Default value: true — the service is started automatically.

    ppem_agent_config (dict, required)

    The configuration of the agent.

    Specify the following required parameters:

    Other parameters are optional.

  3. Run the Ansible playbook that installs agents on hosts listed in the inventory file, for example:

    ansible-playbook pgpro.ppem.ppem_agent -l agents -i inventory.yml
    

29.5.1. What the Agent 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 agent packages, if necessary.

  4. Configuring the host environment:

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

    2. Configuring the systemd service for the agent.

    3. Creating the configuration file for the agent.

    4. Enabling and starting the agent service, if necessary.

FAQ