From 8e2307f5861ca54115e32a6aeabdc475d9dc6907 Mon Sep 17 00:00:00 2001 From: Anthony Perkins Date: Mon, 18 Jul 2022 10:30:01 +0100 Subject: [PATCH] Install ansible to arbitrary paths --- ansible-setup.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ansible-setup.sh b/ansible-setup.sh index 78cd065..2bed3a2 100755 --- a/ansible-setup.sh +++ b/ansible-setup.sh @@ -14,7 +14,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -if [ $(id -u) -eq 0 ]; then +if [ x$1 -ne x ]; then + install_path=$1 + if [ $(id -u) -eq 0 ]; then + bin_path=/usr/local/bin + else + bin_path="$HOME/.local/bin" + fi +elif [ $(id -u) -eq 0 ]; then install_path=/opt/ansible bin_path=/usr/local/bin else