summaryrefslogtreecommitdiffstats
path: root/foreman
diff options
context:
space:
mode:
authorTim Rozet <trozet@redhat.com>2015-08-26 15:03:30 -0400
committerTim Rozet <trozet@redhat.com>2015-08-26 15:03:30 -0400
commitbe1ddda8fc823d8a3032d107e242dd3ba91b89a1 (patch)
treefc593e073c2dad9c85cee8a8416c61688e28bff2 /foreman
parente81470c59a70eab98426917702d592c4fc7f97e0 (diff)
Adds check to ensure 3 control nodes are defined with HA
New check makes sure that 3 controller nodes are defined in base_config when ha_flag is set to true in base_config. JIRA: APEX-7 Change-Id: I7f49dec82704d8c9cbbcf17eb004b0adede406b3 Signed-off-by: Tim Rozet <trozet@redhat.com>
Diffstat (limited to 'foreman')
-rwxr-xr-xforeman/ci/deploy.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/foreman/ci/deploy.sh b/foreman/ci/deploy.sh
index a05b3de..5746e10 100755
--- a/foreman/ci/deploy.sh
+++ b/foreman/ci/deploy.sh
@@ -650,6 +650,20 @@ configure_network() {
fi
fi
+ nodes=`sed -nr '/nodes:/{:start /workaround/!{N;b start};//p}' opnfv_ksgen_settings.yml | sed -n '/^ [A-Za-z0-9]\+:$/p' | sed 's/\s*//g' | sed 's/://g'`
+ controller_nodes=`echo $nodes | tr " " "\n" | grep controller | tr "\n" " "`
+ echo "${blue}Controller nodes found in settings: ${controller_nodes}${reset}"
+ my_controller_array=( $controller_nodes )
+ num_control_nodes=${#my_controller_array[@]}
+ if [ "$num_control_nodes" -ne 3 ]; then
+ if cat opnfv_ksgen_settings.yml | grep ha_flag | grep true; then
+ echo "${red}Error: You must define exactly 3 control nodes when HA flag is true!${reset}"
+ exit 1
+ fi
+ else
+ echo "${blue}Number of Controller nodes detected: ${num_control_nodes}${reset}"
+ fi
+
if [ $no_parse ]; then
echo "${blue}Skipping parsing variables into settings file as no_parse flag is set${reset}"