Open
Description
In the docs we show how to run multiple agents but we don't show any way to customise the agent configuration files for each agent… say, for giving them different tags/meta-data.
Someone just submitted the process it took for them:
To run multiple agents, on the same host, with different configurations, and behind a proxy server.
Once you have installed and tested an agent as per the installation instructions.
## Kill the single agent.
Stop the service and disable it "sudo systemctl stop buildkite-agent" and "sudo systemctl disable buildkite-agent"
## Config Files.
In the buildkite-agent home directory, `/ect/buildkite-agent` make a copy of buildkite-agent.config for each different config you want, e.g. `buildkite-agent-1.cfg`, `buildkite-agent-2.cfg`, etc. The name is irrelevant so call it what you like.
Then edit the new config files and set whatever configuration you want - I just set different queue names in the meta-data/tags.
## System launch file.
This file is `/lib/system/system/buildkite-agent.service`
Make a copy for each agent you want to run, i.e. `buildkite-agent@1.service`, `buildkite-agent@1.service`, etc., and edit this file.
There is an ExecStart line that launches the service, add to the end of this, in each file, ` -config /etc/buildkite-agent/buildkite-agent-1.cfg` or whichever conf you want to use.
Now you can enable the service, `sudo systemctl enable buildkite-agent@1`, and it should run.
## Repeat for however many agent you have setup.
This creates a symlink called `/etc/system/system/mutli-user.target.wants/buildkite-agent@1.service` that should link to the system launch file `/lib/sytemd/system/buildkite-agent@1.service` that was created earlier.
## Start the agents
Finally start the agents: `sudo systemctl start buildkite-agent@1`