-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path02-deploy-lgs-cluster
executable file
·29 lines (22 loc) · 1.14 KB
/
02-deploy-lgs-cluster
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/usr/bin/env bash
set -ex
source "${CURRENT_PROJECT_ROOT}/project-scripts/common.sh"
ANSIBLE_ENV_PLAYBOOK="${CURRENT_PROJECT_ROOT}"/project-ansible/project_environment.yaml
if [[ $(aerolab client list -j | jq --arg ams_name "${TARGET_CLIENT_CLUSTER}" '[.[] | select (.ClientType=="tools") | select(.ClientName==$ams_name)] | length') -eq 0 ]]; then
aerolab client create tools \
-n "${TARGET_CLIENT_CLUSTER}" \
-c "${TARGET_CLIENT_INSTANCE_COUNT}" \
--instance-type "${TARGET_CLIENT_INSTANCE_TYPE}" \
--distro=centos \
--distro-version=9 \
--owner="${PROJECT_NAME}" \
--tags=project="${PROJECT_NAME}"
fi
refresh_known_hosts $(aerolab client list -j | jq -r --arg project_name "${PROJECT_NAME}" '.[] | select(.AwsTags.project == $project_name).PrivateIp')
refresh_known_hosts $(aerolab cluster list -j | jq -r --arg project_name "${PROJECT_NAME}" '.[] | select(.AwsTags.project == $project_name).PrivateIp')
ANSIBLE_STDOUT_CALLBACK=unixy ansible-playbook \
-f 64 \
-i /usr/local/bin/aerolab-ansible \
--extra-vars @"${CURRENT_PROJECT_ROOT}"/project-ansible/overrides.yaml \
"${ANSIBLE_ENV_PLAYBOOK}"
refresh_known_hosts $(nodeattr -n -A)