29.5. Installing Agents #
The agent requires an API key to interact with the manager.
Access the PPEM web application to obtain the key:
In a web browser, go to the following URL:
http://
PPEM_manager_host_address:8080/On the authorization page, enter the default
adminusername andadminpassword, then click Log in.In the navigation panel, go to Summary.
The agent installation instruction will be displayed on the page. Copy the key from the instruction.
If the agent installation instruction was accidentally closed:
In the navigation panel, go to Infrastructure → Agents.
In the Authentication key column next to any agent, click to copy the key.
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:
agent.manager.url: The URL of the manager.agent.manager.api_key: The API key for connecting to the manager.
Other parameters are optional.
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:
Validating the variables in the inventory.
Configuring the Postgres Pro package repository, if necessary.
Installing the agent packages, if necessary.
Configuring the host environment:
Creating the user and group for the agent if a non-root user is specified in the inventory.
Configuring the systemd service for the agent.
Creating the configuration file for the agent.
Enabling and starting the agent service, if necessary.