Skip to content

Commit

Permalink
Update configure-bluechi-controller.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
realvz authored Nov 2, 2023
1 parent bbcecbf commit 663bfa2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions rhivos-bluechi/configure-bluechi-controller.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,25 +32,25 @@ export AWS_REGION=$(curl --silent http://169.254.169.254/latest/dynamic/instance

MANAGED_NODE_IPS=""

while [ -z "$MANAGED_NODE_IPS" ]; do
while [ -z "${MANAGED_NODE_IPS}" ]; do
echo "Waiting for Manager IP address..."
MANAGED_NODE_IPS=$(aws ec2 describe-instances \
--filters "Name=tag:Name,Values=AutoSD_Managed_Node" \
"Name=instance-state-name,Values=running" \
--query 'Reservations[*].Instances[*].PrivateDnsName' \
--output text \
--region $AWS_REGION)
--region ${AWS_REGION})
sleep 5
done

MANAGED_NODE_IPS_LIST=$(echo $MANAGED_NODE_IPS | tr ' ' ',' | sed 's/,/,\n/g')
MANAGED_NODE_IPS_LIST=$(echo ${MANAGED_NODE_IPS} | tr ' ' ',' | sed 's/,/,\n/g')

# mkdir -p /etc/bluechi/controller.conf.d

# Add managed nodes to the controller configuration
echo -e "[bluechi]\nManagerPort=2020\nAllowedNodeNames=$(hostname)," > /etc/bluechi/bluechi.conf.d/1.conf

for n in $(echo $MANAGED_NODE_IPS)
for n in $(echo ${MANAGED_NODE_IPS})
do
echo -e " $n," >> /etc/bluechi/bluechi.conf.d/1.conf
done
Expand Down

0 comments on commit 663bfa2

Please sign in to comment.