Looking for a way to run a workflow on all self-hosted agents in a pool #27074
-
I’m trying to run a maintenance workflow on all agents. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Do not try to use workflows for maintenance of the runners machines (“agents”). Beyond groups you can’t control where a job ends up, and jobs aren’t meant to change the agents themselves. There are two options I can recommend:
Of course you could also use Ansible to configure the cron jobs. :grinning_face_with_smiling_eyes: |
Beta Was this translation helpful? Give feedback.
Do not try to use workflows for maintenance of the runners machines (“agents”). Beyond groups you can’t control where a job ends up, and jobs aren’t meant to change the agents themselves.
There are two options I can recommend:
Set up cron jobs on the agents. Cron lets you define commands to run at certain times. This way each of your agents cleans up on its own, no external instruction needed. I think that’s the best tool for your regular cleanup.
Use a remote management tool, e.g. Ansible. Simply put, you can configure which hosts to manage, and then tell Ansible what to do with all of them. It’s probably a bit overcomplex for your task, but if you want to maintain the agents automat…