Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

METRON-1597 EC2 10 Node Deployment - New function to check os and update *.cfg control_path #1046

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions metron-deployment/amazon-ec2/ansible.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#

#
# The function changeAnsibleControlPath() in run.sh might overwrite
# the control_path according to your operating system.
# To stop overwriting comment out changeAnsibleControlPath in run.sh
#

[defaults]
host_key_checking = False
library = ../ansible/extra_modules
Expand Down
32 changes: 32 additions & 0 deletions metron-deployment/amazon-ec2/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,38 @@
# limitations under the License.
#

#
# Check operating system and change the control_path in ansible.cfg
# accordingly
#
changeAnsibleControlPath()
{
unameosname=`uname`
filename="ansible.cfg"

case $unameosname in
'Linux'*)
#platform='Linux'
ansiblecontrolpath="~/.ssh/ansbile-ssh-%%h-%%r"
;;
'Darwin'*)
#platform='Mac OS/Darwin'
ansiblecontrolpath="~/.ssh/ansbile-ssh-%%C"
;;
*)
#platform='Other'
ansiblecontrolpath=""
;;
esac

if [ ! -z ansiblecontrolpath ]
then
#Make the change to the control_path. Ignore #comments
sed -i.bak -e "/^#/!s|control_path.*=.*|control_path =$ansiblecontrolpath|g" -- "${filename}"
fi
}
changeAnsibleControlPath

#
# Builds Metron platform jars, instantiates hosts, and deploys Metron to those
# hosts on Amazon EC2
Expand Down