-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy.sh
More file actions
executable file
·27 lines (22 loc) · 811 Bytes
/
Copy pathdeploy.sh
File metadata and controls
executable file
·27 lines (22 loc) · 811 Bytes
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
#!/bin/sh
CURRENT_DIR="$(cd "$(dirname "${0}")" && pwd)"
if [ -z "${1}" ]; then
printf "%s\\n" "Define target environment: vagrant|stage|prod" >&2
exit 1
fi
if [ ! -f "${CURRENT_DIR}/.vault_pass.txt" ]; then
printf "%s\\n" "${CURRENT_DIR}/.vault_pass.txt doesn't exists, exiting ..." >&2
exit 1
fi
cd "${CURRENT_DIR}"
cd provision/ansible/
#https://mitogen.readthedocs.io/en/latest/ansible.html
if [ ! -d "mitogen-0.2.2/ansible_mitogen/plugins/strategy" ]; then
wget https://files.pythonhosted.org/packages/source/m/mitogen/mitogen-0.2.2.tar.gz
tar zxf mitogen-0.2.2.tar.gz
fi
set -x
ansible-playbook app.yml \
-i inventories/"${1}"/hosts \
-u ansible --private-key=~/.ssh/id_rsa \
--vault-password-file ../../.vault_pass.txt