Skip to content

Commit

Permalink
Skip installing amazon-ssm-agent if already present (#1501)
Browse files Browse the repository at this point in the history
  • Loading branch information
pjaudiomv authored Nov 2, 2023
1 parent 2980eaf commit ea2e73b
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions scripts/install-worker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -503,11 +503,15 @@ fi
### SSM Agent ##################################################################
################################################################################

echo "Installing amazon-ssm-agent"
if ! [[ ${ISOLATED_REGIONS} =~ $BINARY_BUCKET_REGION ]]; then
sudo yum install -y https://s3.${BINARY_BUCKET_REGION}.${S3_DOMAIN}/amazon-ssm-${BINARY_BUCKET_REGION}/${SSM_AGENT_VERSION}/linux_${ARCH}/amazon-ssm-agent.rpm
if yum list installed | grep amazon-ssm-agent; then
echo "amazon-ssm-agent already present - skipping install"
else
sudo yum install -y amazon-ssm-agent
echo "Installing amazon-ssm-agent"
if ! [[ ${ISOLATED_REGIONS} =~ $BINARY_BUCKET_REGION ]]; then
sudo yum install -y https://s3.${BINARY_BUCKET_REGION}.${S3_DOMAIN}/amazon-ssm-${BINARY_BUCKET_REGION}/${SSM_AGENT_VERSION}/linux_${ARCH}/amazon-ssm-agent.rpm
else
sudo yum install -y amazon-ssm-agent
fi
fi

################################################################################
Expand Down

0 comments on commit ea2e73b

Please sign in to comment.