Merge "Add the private_ipv4 hostvar to primary and sub nodes"

This commit is contained in:
Jenkins 2017-08-29 22:23:45 +00:00 committed by Gerrit Code Review
commit 62557046fb

View File

@ -487,13 +487,14 @@ export DSCONF=/tmp/ansible/bin/dsconf
# Write inventory file with groupings # Write inventory file with groupings
COUNTER=1 COUNTER=1
PRIMARY_NODE=$(cat /etc/nodepool/primary_node_private)
echo "[primary]" > "$WORKSPACE/inventory" echo "[primary]" > "$WORKSPACE/inventory"
echo "localhost ansible_connection=local host_counter=$COUNTER" >> "$WORKSPACE/inventory" echo "localhost ansible_connection=local host_counter=$COUNTER nodepool='{\"private_ipv4\": \"$PRIMARY_NODE\"}'" >> "$WORKSPACE/inventory"
echo "[subnodes]" >> "$WORKSPACE/inventory" echo "[subnodes]" >> "$WORKSPACE/inventory"
export SUBNODES=$(cat /etc/nodepool/sub_nodes_private) export SUBNODES=$(cat /etc/nodepool/sub_nodes_private)
for SUBNODE in $SUBNODES ; do for SUBNODE in $SUBNODES ; do
let COUNTER=COUNTER+1 let COUNTER=COUNTER+1
echo "$SUBNODE host_counter=$COUNTER" >> "$WORKSPACE/inventory" echo "$SUBNODE host_counter=$COUNTER nodepool='{\"private_ipv4\": \"$SUBNODE\"}'" >> "$WORKSPACE/inventory"
done done
# Write ansible config file # Write ansible config file