Hi all
so I have an Ansible Playbook that:
1. Creates and Ubuntu EC2 on AWS
2. Then updates the EC2 and installs some packages and reboots
3. It then creates a Bamboo user and group and sets the password
4. It copies the Bamboo agent tar file sets its owner as Bamboo
5. I then run the installer and it approves the new agent via an API call
6. The script waits until the file bamboo-agent.cfg.xml is created
The problem is sometimes it happens meaning everything goes well and my new agent goes live on line or it just sits there then times out, I look at the logs and see that it is waiting to get approval
INFO | jvm 2 | 2022/09/25 20:09:02 | * This agent requires manual approval.
INFO | jvm 2 | 2022/09/25 20:09:02 | * UUID: xxxxxxxxxxxxxxxxxxxxxxxxxx
then I look at the Bamboo agents
x.x.x.227 | xxxxxxxxx | Waiting | Approve access |
x.x.x.227 | xxxxxx | Approved | Revoke access | Edit IP address |
so how can it be approved and still asking for approval? I need this to be able to setup and start the agent without errors, any help would be great
Hello @William Flow,
The Bamboo Agent jar installer will keep trying to connect to the Bamboo Server every 60s in case it is not approved. Perhaps you need to wait longer and double-check the UUID inserted on bamboo.cfg.xml and use it on the REST API agent approval request.
Alternatively, you can install the Agent using the install suffix, this will only create the necessary content but will not run any services. You can then generate a bamboo.cfg.xml from a template and assign it with a random UUID then start the Agent. This way you have control of the UUID and will be 100% sure of which agent needs to be approved.
Cheers,
Eduardo Alvarenga
Atlassian Support APAC
--please don't forget to Accept the answer if the reply is helpful--
Hi Eduardo so what I am thinking is
1. install the jar file via command:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @William Flow
The wait times will depend on external factors that are out of Bamboo's control as it relies on your automation.
I'd go with the second option where you have better control of the installation process.
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<configuration>
<buildWorkingDirectory>/home/bamboo/bamboo-agent-home/xml-data/build-dir</buildWorkingDirectory>
<agentUuid>YOU27c1a-NEED-4ebc-_TO_-af8bGENERATE</agentUuid>
<agentDefinition>
<name>agent_NAME</name>
<description>Remote agent on host agent_NAME</description>
</agentDefinition>
</configuration>
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.
Ok will do one more question once I install it, then start it (via API), it will take time in communicating from my new agent to the bamboo server, example it will poll every minute until it sees that I approved it? So by setting my poll to check for the bamboo-
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @William Flow
The Bambo Agent will wait up to 60s and try again when in the Approval stage.
During the first start, the Agent will download extra files from the server, so you can add 2 or 3 minutes as a grace period (It may be more or less depending on your Network speed).
After that, capture the UUID from the bamboo-agent.cfg.xml (or use the one you have generated as per my previous suggestion) and approve it on the API.
Once the Agent is approved it will try again and succeed with the connection to the Server.
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.
Hi @Eduardo Alvarenga I found my issue, what happens is
1. i do the install with the install flag
2. I start the agent and do some more stuff
3. I restart the agent and sometimes it works fine other times I see the agent needs approval, i think the reason for this is I see the one that has already approved has and address of "the IP of the load balancer, the IP of the agent" like 10.xxx.xxx.61,10.xxx.xxx.221 and the one that is waiting is 10.xxx.xxx.91,10.xxx.xxx.221 which i think is causing the issue
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @William Flow
Good to hear from you!
Try this KB article to mask your LB IP addresses from the connection and focus on the Agent's IPs:
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.