-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathinstall.sh
executable file
·132 lines (94 loc) · 2.96 KB
/
install.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
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
#!/bin/bash
mods_dir=/etc/puppet/modules
cd $mods_dir
##########################################
# need to be root
##########################################
id=`whoami`
if [ "$id" != "root" ]; then
echo "You must be root to run this script."
exit 1
fi
##########################################
# check that puppet and git is installed
##########################################
git_cmd=`which git`
if [ $? -ne 0 ]; then
echo "Subversion must be installed. Run 'yum install git'."
exit 1
fi
puppet_cmd=`which puppet`
if [ $? -ne 0 ]; then
echo "Puppet must be installed. Run 'yum install puppet'."
exit 1
fi
if [ ! -d "/usr/share/puppet/modules/firewalld" ]; then
echo "puppet-firewalld must be installed. Run 'yum install puppet-firewalld'."
exit 1
fi
##########################################
# set git url
##########################################
git_url="https://github.com"
##########################################
# install puppetlab's stdlib module
##########################################
mod_dir=$mods_dir/stdlib
# check that module is here; if not, export it
if [ ! -d $mod_dir ]; then
$puppet_cmd module install puppetlabs-stdlib
fi
##########################################
# export hysds_base puppet module
##########################################
git_loc="${git_url}/hysds/puppet-hysds_base"
mod_dir=$mods_dir/hysds_base
site_pp=$mod_dir/site.pp
# check that module is here; if not, export it
if [ ! -d $mod_dir ]; then
$git_cmd clone $git_loc $mod_dir
fi
##########################################
# export hysds_dev puppet module
##########################################
git_loc="${git_url}/hysds/puppet-hysds_dev"
mod_dir=$mods_dir/hysds_dev
site_pp=$mod_dir/site.pp
# check that module is here; if not, export it
if [ ! -d $mod_dir ]; then
$git_cmd clone $git_loc $mod_dir
fi
##########################################
# export scientific_python puppet module
##########################################
git_loc="${git_url}/hysds/puppet-scientific_python"
mod_dir=$mods_dir/scientific_python
site_pp=$mod_dir/site.pp
# check that module is here; if not, export it
if [ ! -d $mod_dir ]; then
$git_cmd clone $git_loc $mod_dir
fi
##########################################
# export cloud_utils puppet module
##########################################
git_loc="${git_url}/hysds/puppet-cloud_utils"
mod_dir=$mods_dir/cloud_utils
site_pp=$mod_dir/site.pp
# check that module is here; if not, export it
if [ ! -d $mod_dir ]; then
$git_cmd clone $git_loc $mod_dir
fi
##########################################
# export mozart puppet module
##########################################
git_loc="${git_url}/hysds/puppet-mozart"
mod_dir=$mods_dir/mozart
site_pp=$mod_dir/site.pp
# check that module is here; if not, export it
if [ ! -d $mod_dir ]; then
$git_cmd clone $git_loc $mod_dir
fi
##########################################
# apply
##########################################
FACTER_git_oauth_token=$GIT_OAUTH_TOKEN $puppet_cmd apply $site_pp