From 975b2ea93832202da70c730386ecf3f910924711 Mon Sep 17 00:00:00 2001 From: Salt Date: Wed, 2 Sep 2020 17:47:03 -0500 Subject: [PATCH] Add clause in localhost-deploy to use apk if found --- localhost-deploy.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/localhost-deploy.sh b/localhost-deploy.sh index dedc115..d10bde6 100755 --- a/localhost-deploy.sh +++ b/localhost-deploy.sh @@ -9,7 +9,13 @@ set -e if ! command -v ansible > /dev/null 2>&1; then printf "Installing Ansible and related packages\n" - sudo apt-get install python3-pip python3-setuptools -y + if command -v apt > /dev/null 2>&1; then + printf "Installing via APT\n" + sudo apt-get install python3-pip python3-setuptools -y + elif command -v pkg > /dev/null 2>&1; then + printf "Installing via APK\n" + sudo apk add py3-pip py3-setuptools + fi sudo pip3 install ansible fi ansible-playbook site.yml -l "$HOSTNAME" -e "ansible_user=$USER ansible_connection=local ansible_host=localhost" --ask-become-pass --ask-vault-pass "$@"