{"id":16452251,"url":"https://github.com/jegj/ansible-role-pgagent","last_synced_at":"2026-04-18T11:03:10.896Z","repository":{"id":145630139,"uuid":"372673417","full_name":"jegj/ansible-role-pgagent","owner":"jegj","description":"Install pg agent as Systemd unit on Ubuntu/Debian","archived":false,"fork":false,"pushed_at":"2022-01-26T13:40:17.000Z","size":37,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-26T16:27:05.020Z","etag":null,"topics":["ansible","debian","pgagent","postgresql","systemd","ubuntu"],"latest_commit_sha":null,"homepage":"https://galaxy.ansible.com/jegj/pgagent","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jegj.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-06-01T01:55:12.000Z","updated_at":"2024-12-30T01:24:29.000Z","dependencies_parsed_at":"2023-04-27T16:01:32.453Z","dependency_job_id":null,"html_url":"https://github.com/jegj/ansible-role-pgagent","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/jegj/ansible-role-pgagent","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jegj%2Fansible-role-pgagent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jegj%2Fansible-role-pgagent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jegj%2Fansible-role-pgagent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jegj%2Fansible-role-pgagent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jegj","download_url":"https://codeload.github.com/jegj/ansible-role-pgagent/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jegj%2Fansible-role-pgagent/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":285603341,"owners_count":27200013,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-11-21T02:00:06.175Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ansible","debian","pgagent","postgresql","systemd","ubuntu"],"created_at":"2024-10-11T10:11:42.347Z","updated_at":"2025-11-21T11:04:51.130Z","avatar_url":"https://github.com/jegj.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"Ansible Role pgAgent\n=========\n\n[![CI Pipeline](https://github.com/jegj/ansible-role-pgagent/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/jegj/ansible-role-pgagent/actions/workflows/ci.yml)\n\n\n1) Install [pgAgent](https://www.pgadmin.org/docs/pgadmin4/development/pgagent.html) package.\n2) Install( or Upgrade ) the pgAgent extension on the target database( if the database is local ).\n3) Create a configuration file for the target database.\n4) Start a pgAgent systemd unit for a target database.\n\nOn a Debian/Ubuntu system.\n\nRequirements\n------------\n\nNone\n\nRole Variables\n--------------\n\n    pgagent_database: \"\"\n\nTarget database for pgAGent. **REQUIRED**, Otherwise the role will fail.\n\n    pgagent_database_port: 5432\n\nTarget database port for pgAgent. Default to `5432`.\n\n    pgagent_upgrade: false\n\nAllow to upgrade `pgagent` apt package if required. Default to `false`.\n\n    pgagent_user: \"postgres\"\n\nTarget user for pgAgent. Default to `postgres`.\n\n    pgagent_hostaddr: \"my.testdb\"\n\nDatabase Host address for pgAgent. **NO DEFINED**. By default the role use a local connection to the database.\n\n    pgagent_password: \"myp4$$word\"\n\nUser's password for pgAgent connection if is required. **NO DEFINED**. By default use postgres user with peer authentication.\n\nDependencies\n------------\n\nNone\n\nExample Playbook\n----------------\n\n```yaml\n- hosts: dbserver\n  vars_files:\n    - vars/main.yml\n  roles:\n    - jegj.pgagent\n```\npgAgent Unit Configuration File\n----------------\nThe role will create a configuration file per database located at `/etc/pgagent/{{ your_db }}.conf` with the following configuration options:\n\n- `PG_AGENT_TARGET_PORT`: Postgres Database port.\n- `PG_AGENT_HOST_ADDR`: Postgres Database host. If the connection is local this variable is not present.\n- `PG_AGENT_USER`: Postgres Database user. Default to `postgres`.\n- `PG_AGENT_LOG_VERBOSITY`: pgAgent Verbosity. Default to `1`(WARNING). Allowed values: (ERROR=0, WARNING=1, DEBUG=2).\n- `PG_AGENT_RETRY_PERIOD`: pgAgent retry period after connection abort in seconds. Default to `30`.\n- `PG_AGENT_POLL_INTERVAL`: pgAgent poll time interval in seconds. Default to `10`.\n\nRestart the pgagent unit for the target database to use the new configuration options with the following command:\n```sh\nsudo systemctl restart pgagent@{{ your_db }}\n```\n\nCheck [here](https://www.pgadmin.org/docs/pgadmin4/development/pgagent_install.html#daemon-installation-on-unix) for more information\n\nTo show stats about your pgAgent unit run:\n```sh\nsudo systemctl status pgagent@{{ your_db }}\n```\npgAgent Log File\n----------------\nThe pgAgent systemd unit will log to the file `/var/log/pgagent/{{ your_db }}.log` by default. There is also an entry at `/etc/logrotate.d/pgagent` that will rotate the log weekly by default.\n\nLicense\n-------\n\nBSD\n\nAuthor Information\n------------------\n\n[Javier Galarza](https://jegj.github.io/resume/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjegj%2Fansible-role-pgagent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjegj%2Fansible-role-pgagent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjegj%2Fansible-role-pgagent/lists"}