Created
November 24, 2014 09:48
-
-
Save sebgoa/50c504c0b908ae2714b2 to your computer and use it in GitHub Desktop.
packer template for cloudstack simulator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
apt-get -y update | |
apt-get -y install openjdk-7-jdk | |
apt-get -y install python-dev | |
echo 'mysql-server mysql-server/root_password password foobar' | debconf-set-selections | |
echo 'mysql-server mysql-server/root_password_again password foobar' | debconf-set-selections | |
apt-get -qqy install mysql-server | |
service mysql restart | |
#BAD: Sets the root password to null | |
mysql -u root -pfoobar < /tmp/init.sql | |
apt-get -y install git | |
apt-get -y install maven | |
#install python setup tools to install marvin | |
apt-get -y install python-setuptools | |
apt-get -y install python-pip | |
#install mkisofs to create systemvm | |
apt-get -y install genisoimage | |
#turn off iptables for testing | |
#ufw disable | |
#clone cloudstack repo | |
cd /opt | |
#git clone -b 4.3 https://git-wip-us.apache.org/repos/asf/cloudstack.git | |
git clone -b 4.4 https://github.com/apache/cloudstack.git | |
cd cloudstack | |
#build from source | |
mvn -Pdeveloper -Dsimulator -DskipTests clean install | |
#setup DB | |
service mysql restart | |
mvn -Pdeveloper -pl developer -Ddeploydb | |
mvn -Pdeveloper -pl developer -Ddeploydb-simulator | |
#Add Mysql to init | |
update-rc.d mysql defaults | |
#Install Marvin | |
pip install --allow-external mysql-connector-python mysql-connector-python | |
pip install ./tools/marvin/dist/Marvin-4.4.1.tar.gz | |
#start mgt server | |
#mvn -pl client jetty:run -Dsimulator |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UPDATE mysql.user SET Password=PASSWORD('') WHERE User='root'; | |
FLUSH PRIVILEGES; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"builders": [ | |
{ | |
"type": "docker", | |
"image": "phusion/baseimage", | |
"commit": "true" | |
} | |
], | |
"provisioners": [ | |
{ | |
"type": "file", | |
"source": "init.sql", | |
"destination": "/tmp/init.sql" | |
}, | |
{ | |
"type": "shell", | |
"script": "bootstrap.sh" | |
} | |
], | |
"post-processors": [ | |
{ | |
"type": "docker-tag", | |
"repository": "runseb/cloudstack", | |
"tag": "0.1.3" | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment