-
Notifications
You must be signed in to change notification settings - Fork 5
/
memoryhole
executable file
·63 lines (54 loc) · 1.22 KB
/
memoryhole
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/bin/bash
USAGE='
====================
Memoryhole CLI Usage
====================
Setup:
------
$: memoryhole setup
- set up the project.
Create Config:
--------------
$: memoryhole create-config <city>
- copies example config to new directory from target city
- (coming soon) generates passwords
Deploy:
------
$: memoryhole deploy <city> (arg required)
- deploy memoryhole from config in cities/<city/config.yml
'
if [ -z $1 ]
then
echo "$USAGE";
exit 0;
fi
case $1 in
'help')
echo -e "$USAGE";
exit 1;
;;
'setup')
bash/installansible.sh
echo 'ansible installed'
ansible-galaxy install -r requirements.yml --roles-path=deploy/roles
echo 'ansible roles installed'
;;
'create-config')
if [ -n $2 ]; then
if [ -f cities/$2/config.yml ]; then
echo "Config already exsists in cities/$2/config.yml!"
exit 0
fi
if [ ! -f cities/$2/config.yml ]; then
echo "Creating example config"
mkdir -p cities/$2
cp cities/example/* cities/$2
# generate passwords here some day
# prompt for config options
fi
fi
;;
'deploy')
ansible-playbook -i cities/$2/hosts deploy/server.yml -e city_key=$2
;;
esac