You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@brooklyn.apache.org by he...@apache.org on 2016/03/17 13:55:12 UTC
[14/16] brooklyn-dist git commit: Release Vagrantfile: WIP support
for AWS provisioning (big fast VM!)
Release Vagrantfile: WIP support for AWS provisioning (big fast VM!)
Project: http://git-wip-us.apache.org/repos/asf/brooklyn-dist/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-dist/commit/ad4db4b0
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-dist/tree/ad4db4b0
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-dist/diff/ad4db4b0
Branch: refs/heads/master
Commit: ad4db4b047bf18ec4836799dfac51af4ae9b2b7b
Parents: ae0f7b0
Author: Richard Downer <ri...@apache.org>
Authored: Wed Mar 16 16:52:23 2016 +0000
Committer: Richard Downer <ri...@apache.org>
Committed: Wed Mar 16 16:52:23 2016 +0000
----------------------------------------------------------------------
release/Vagrantfile | 27 ++++++++++++++++++++++++---
1 file changed, 24 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/brooklyn-dist/blob/ad4db4b0/release/Vagrantfile
----------------------------------------------------------------------
diff --git a/release/Vagrantfile b/release/Vagrantfile
index 2b7d634..bbd0f91 100644
--- a/release/Vagrantfile
+++ b/release/Vagrantfile
@@ -38,6 +38,26 @@ Vagrant.configure(2) do |config|
vb.cpus = 2
end
+ config.vm.provider :aws do |aws, override|
+ aws.access_key_id = ENV['AWS_ACCESS_KEY_ID']
+ aws.secret_access_key = ENV['AWS_SECRET_ACCESS_KEY']
+ aws.keypair_name = "richardcloudsoft"
+ aws.region = "eu-west-1"
+ aws.tags = {
+ 'Name' => 'Release Apache Brooklyn'
+ }
+ aws.instance_type = "m4.xlarge"
+
+ aws.region_config "eu-west-1" do |region|
+ region.ami = "ami-f95ef58a"
+ region.subnet_id = "subnet-56d3f922"
+ region.associate_public_ip = true
+ region.security_groups = [ 'sg-ac8f86c8' ]
+ end
+
+ override.ssh.username = "ubuntu"
+ override.ssh.private_key_path = ENV['HOME']+"/.ssh/id_rsa"
+ end
config.vm.provision "file", source: "~/.gitconfig", destination: ".gitconfig"
config.vm.provision "file", source: "~/.gnupg/gpg.conf", destination: ".gnupg/gpg.conf"
@@ -49,19 +69,20 @@ Vagrant.configure(2) do |config|
# Update the VM, install Java and Maven, enable passwordless-ssh-to-localhost,
# clone the canonical repository
config.vm.provision "shell", inline: <<-SHELL
+ NORMALUSER=$( getent passwd 1000 | cut -f1 -d: )
add-apt-repository -y ppa:mwhudson/go16-trusty
apt-get update
apt-get upgrade -y
apt-get install -y default-jdk git subversion xmlstarlet zip unzip language-pack-en vim-nox gnupg2 gnupg-agent pinentry-curses golang-1.6 rpm
mkdir -p /opt
- chmod -R go= ~vagrant/.gnupg
curl http://archive.apache.org/dist/maven/maven-3/3.1.1/binaries/apache-maven-3.1.1-bin.tar.gz | tar xz -C /opt
ln -s /opt/apache-maven-3.1.1/bin/mvn /usr/local/bin
echo "MAVEN_OPTS=\"-Xmx512m -XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=256M\"" >> /etc/environment
mkdir -p /work
mount -ttmpfs -osize=3g none /work
+ eval chmod -R go= ~${NORMALUSER}/.gnupg
cat /etc/ssh/ssh_host_*_key.pub | awk '{print "localhost,127.0.0.1 "$0}' >> /etc/ssh/ssh_known_hosts
- su -c 'ssh-keygen -t rsa -b 2048 -N "" -f ~/.ssh/id_rsa; cat ~/.ssh/*.pub >> ~/.ssh/authorized_keys' vagrant
- su -c '/vagrant/clone-and-configure-repos.sh' vagrant
+ su -c 'ssh-keygen -t rsa -b 2048 -N "" -f ~/.ssh/id_rsa; cat ~/.ssh/*.pub >> ~/.ssh/authorized_keys' $NORMALUSER
+ su -c '/vagrant/clone-and-configure-repos.sh' $NORMALUSER
SHELL
end