You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR adds a new Ansible task to the update_agent playbook that runs agent setup agent-db-cleanup to register a DB cleanup crontab for the frappe user. The task follows the same pattern as the other agent setup tasks already present in the file (become: yes, become_user: frappe, fixed binary path, chdir: /home/frappe/agent).
New task is placed logically after the "Update Agent" step and before log-ownership cleanup.
The agent CLI (/home/frappe/agent/env/bin/agent setup agent-db-cleanup) is expected to be idempotent; repeated playbook runs should not create duplicate cron entries, consistent with how other agent setup sub-commands work in this codebase.
Confidence Score: 5/5
Safe to merge — the change is a single Ansible task that follows the existing patterns in the file exactly.
The new task runs agent setup agent-db-cleanup using the same binary path, working directory, and privilege escalation as every other agent setup step in this playbook. No variables are interpolated into the command, so there is no injection surface.
No files require special attention.
Important Files Changed
Filename
Overview
press/playbooks/roles/update_agent/tasks/main.yml
Adds a single Ansible task to run agent setup agent-db-cleanup during agent updates, registering a DB cleanup crontab for the frappe user.
Sequence Diagram
sequenceDiagram
participant Ansible
participant AgentCLI as Agent CLI
participant Cron as frappe crontab
Ansible->>AgentCLI: "agent update {{ agent_update_args }}"
AgentCLI-->>Ansible: done
Ansible->>AgentCLI: agent setup agent-db-cleanup
AgentCLI->>Cron: Register DB cleanup cron job
Cron-->>AgentCLI: crontab updated
AgentCLI-->>Ansible: done
Ansible->>Ansible: Set log ownership (frappe:frappe)
Ansible->>Ansible: Ensure Agent processes started (supervisorctl)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This calls Agent's agent-db-cleanup cli to setup DB cleanup crontab.
Related PR
Agent