From 92a2d2863fc9d1cfaa96b612fd617dea474fa564 Mon Sep 17 00:00:00 2001 From: Markos Chandras Date: Wed, 24 Aug 2016 17:22:37 +0300 Subject: [PATCH] Install the net-tools package in scripts/env-setup.sh A couple of playbooks use the 'netstat' utility which is present in the net-tools package so install it if it's not already present. It fixes the following problem on a clean CentOS installation: fatal: [127.0.0.1]: FAILED! => {"changed": true, "cmd": "netstat -apn|grep LISTEN", "delta": "0:00:00.005074", "end": "2016-08-24 17:14:48.614240", "failed": true, "invocation": {"module_args": {"_raw_params": "netstat -apn|grep LISTEN", "_uses_shell": true, "chdir": null, "creates": null, "executable": null, "removes": null, "warn": true}, "module_name": "command"}, "rc": 1, "start": "2016-08-24 17:14:48.609166", "stderr": "/bin/sh: netstat: command not found", "stdout": "", "stdout_lines": [], "warnings": []} Change-Id: I1310f5848c7e71e8bdb91f6fcfaa26ebeeac45e7 Signed-off-by: Markos Chandras --- scripts/env-setup.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/scripts/env-setup.sh b/scripts/env-setup.sh index e62bca4e8..d00676345 100755 --- a/scripts/env-setup.sh +++ b/scripts/env-setup.sh @@ -42,6 +42,9 @@ if [ -x '/usr/bin/zypper' ]; then if ! zypper search --installed libffi-devel &>/dev/null; then sudo -H zypper install -y libffi-devel fi + if ! zypper search --installed net-tools &>/dev/null; then + sudo -H zypper install -y net-tools + fi if ! zypper search --match-exact --installed python-pip &>/dev/null; then sudo -H zypper install -y python-pip fi @@ -76,6 +79,9 @@ elif [ -x '/usr/bin/apt-get' ]; then if ! $(dpkg -l libffi-dev &>/dev/null); then sudo -H apt-get -y install libffi-dev fi + if ! $(dpkg -l net-tools &>/dev/null); then + sudo -H apt-get -y install net-tools + fi elif [ -x '/usr/bin/yum' ]; then if ! $(python --version &>/dev/null); then sudo -H yum -y install python @@ -103,6 +109,9 @@ elif [ -x '/usr/bin/yum' ]; then if ! $(rpm -q libffi-devel &>/dev/null); then sudo -H yum -y install libffi-devel fi + if ! $(rpm -q net-tools &>/dev/null); then + sudo -H yum -y install net-tools + fi else echo "ERROR: Supported package manager not found. Supported: apt,yum,zypper" fi