forked from cioan/mirebalais-puppet
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·55 lines (42 loc) · 1.17 KB
/
install.sh
File metadata and controls
executable file
·55 lines (42 loc) · 1.17 KB
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
#! /bin/bash
if [ ! -d /etc/puppet-decrypt ]
then
mkdir /etc/puppet-decrypt
fi
if [ "$1" != "local" ]
then
if [ ! -f /etc/puppet-decrypt/encryptor_secret_key ] || [ ! -f /etc/ssl/private/hum.key ] || [ ! -f /etc/ssl/private/pih-emr.org.key ]
then
echo "Please provide a username to fetch private data"
read user
scp $user@amigo.pih-emr.org:/etc/mirebalais/* .
mv encryptor_secret_key /etc/puppet-decrypt/
mv hum.key /etc/ssl/private/
mv pih-emr.org.key /etc/ssl/private/
fi
if [ ! -d ~/.ssh ]
then
mkdir ~/.ssh
fi
if [ ! -f ~/.ssh/id_dsa ]
then
ssh-keygen -q -t dsa -f ~/.ssh/id_dsa -P ''
fi
echo "Please make sure you have copied this ssh public key to the backup server so that database backups can be uploaded there:"
cat ~/.ssh/id_dsa.pub
read -p "Press a key to continue"
else
if [ ! -f /etc/puppet-decrypt/encryptor_secret_key ]
then
echo "Creating a dummy secret key"
ssh-keygen -N testmeout -f /etc/puppet-decrypt/encryptor_secret_key
fi
fi
# For Haiti servers, don't update the tzdata package
if [ "$HOSTNAME" = "" ]
then
apt-mark hold tzdata
fi
apt-get update
./gem-update.sh
./puppet-apply.sh site