ansible/localhost-deploy.sh
Salt 7a955f85cf Add libffi-dev to required packages in localhost-deploy
Weird, it's installed by default on Ubuntu but not in Mobian
2020-09-04 06:37:31 -05:00

26 lines
877 B
Bash
Executable File

#! /bin/bash
#
# localhost-deploy.sh
# Deploys configs for local machine and only local machine
# Copyright (C) 2020 Vintage Salt <rehashedsalt@cock.li>
#
# Distributed under terms of the MIT license.
#
set -e
if ! command -v ansible > /dev/null 2>&1; then
printf "Installing Ansible and related packages\n"
if command -v apt > /dev/null 2>&1; then
printf "Installing via APT\n"
sudo apt-get install libffi-dev python3-pip python3-setuptools -y
elif command -v apk > /dev/null 2>&1; then
printf "Installing via APK\n"
sudo apk add gcc musl-dev py3-cryptography py3-pip py3-setuptools
else
printf "No supported package manager found\nPlease install Ansible manually"
exit 1
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 "$@"