-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinstall.sh
58 lines (48 loc) · 2.07 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
#!/bin/bash
# super simple script for deploying an openstack environment from script
# to invoke, run:
# > bash -c "$(curl -fsS https://raw.github.com/bodepd/puppet-openstack_test/master/install.sh)"
#
# this is just here b/c librarian puppet cannot be installed as a gem if puppet is installed from
# apt
# install the latest version of puppet
wget http://apt.puppetlabs.com/puppetlabs-release-precise.deb
sudo dpkg -i puppetlabs-release-precise.deb
sudo apt-get update
apt-get install -y puppet rubygems git-core
# install the required modules
# TODO: make this idempotent
git clone https://github.com/bodepd/puppet-vagrant /etc/puppet/modules/vagrant
git clone https://github.com/bodepd/puppet-squid3 /etc/puppet/modules/squid3
git clone https://github.com/bodepd/puppet-openstack_test /etc/puppet/modules/openstack_test
git clone https://github.com/puppetlabs/puppetlabs-stdlib /etc/puppet/modules/stdlib
git clone https://github.com/puppetlabs/puppetlabs-apt /etc/puppet/modules/apt
git clone https://github.com/puppetlabs/puppetlabs-vcsrepo /etc/puppet/modules/vcsrepo
git clone https://github.com/bodepd/puppet-jenkins /etc/puppet/modules/jenkins
git clone https://github.com/puppetlabs/puppetlabs-java /etc/puppet/modules/java
# conditionally install the stuff!
if [ -n "$install_test_env" ]; then
if [ -z "$github_user_login" ]; then
echo "ENV VAR github_user_login must be set"
exit 1
fi
if [ -z "$github_user_password" ]; then
echo "ENV VAR github_user_password must be set"
exit 1
fi
puppet apply -e "class { 'openstack_test': github_user_login => $github_user_login, github_user_password => $github_user_password }"
fi
if [ -n "$install_jenkins_server" ]; then
puppet apply -e "include 'openstack_test::server'"
fi
if [ -n "$install_jenkins_agent" ]; then
if [ -z "$jenkins_server" ]; then
echo "ENV VAR jenkins_server must be set"
exit 1
fi
if [ -z "$ssh_password" ]; then
echo "ENV VAR ssh_password must be set"
exit 1
fi
puppet apply -e "class { 'openstack_test::agent': server => '$jenkins_server', ssh_password => '$ssh_password' }"
fi