forked from cristiklein/stateless-workstation-config
-
Notifications
You must be signed in to change notification settings - Fork 0
/
deploy.sh
executable file
·33 lines (28 loc) · 827 Bytes
/
deploy.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/bash
set -e
BASEDIR=$(dirname $(readlink -f "$0"))
. "$BASEDIR/functions.sh"
if ! which ansible > /dev/null; then
log "Ansible not found; trying to install"
sudo apt-get update
sudo apt-get install software-properties-common
sudo apt-add-repository ppa:ansible/ansible
sudo apt-get update
sudo apt-get install ansible
fi
if ! env \
LANG=C.UTF-8 \
ANSIBLE_STDOUT_CALLBACK=debug \
ANSIBLE_CONFIG=$BASEDIR/ansible.cfg \
ansible-playbook $BASEDIR/site.yml \
--inventory localhost, $*
then
log "If the failure above is due to missing privilege, then re-run with:"
log "$0 --ask-become-pass"
exit 1
fi
if [[ ":$PATH:" == *":$HOME/bin:"* ]]; then
log "Your path is correctly set"
else
log "Your path is missing ~/bin, you might want to re-login now."
fi