Hi All
So I have written an Ansible Playbook that creates a EC2 instance then makes that a Bamboo Agent, in my playbook I make an API call to my bamboo server that authorizes the new agent and enables it, but the name of the agent is the hostname it gets from aws so I wanted to know since i can't change the host name in my playbook for aws, is there a bamboo api call that i could do that with?
Hello @William Flow
Assuming you are running Remote Agents on an EC2 instance and not Elastic Agents which are Ephemeral by nature, you can use the following API call to modify the Agent's name:
curl --request PUT \
--url 'http://{baseurl}/rest/admin/latest/config/agents/{agentId}' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"id": 131073,
"type": "local",
"name": "Default Agent",
"description": "This is a description",
"enabled": true,
"link": "https://baseurl/rest/admin/latest/agent/131073"
}'
The agentId can be obtained from <bamboo-agent-home>/bamboo.cfg.xml
Regards,
Eduardo Alvarenga
Atlassian Support APAC
--please don't forget to Accept the answer if the reply is helpful--
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.