Skip to content
Permalink
Browse files
Change example to use Ubuntu
  • Loading branch information
Everett Toews committed Apr 1, 2014
1 parent 24cfa73 commit 3473f5744df0f13e641a35f771a42974af6da30c
Showing 1 changed file with 5 additions and 5 deletions.
@@ -116,7 +116,7 @@ private Set<? extends NodeMetadata> createServer() throws RunNodesException, Tim
ZoneAndId zoneAndId = ZoneAndId.fromZoneAndId(ZONE, "performance1-1");
Template template = computeService.templateBuilder()
.locationId(ZONE)
.osDescriptionMatches(".*CentOS 6.4.*")
.osDescriptionMatches(".*Ubuntu 12.04.*")
.hardwareId(zoneAndId.slashEncode())
.build();

@@ -147,10 +147,10 @@ private void configureAndStartWebserver(Set<? extends NodeMetadata> nodes) throw
.append(" in ").append(nodeMetadata.getLocation().getParent().getId())
.toString();

String script = new ScriptBuilder().addStatement(exec("yum -y install httpd"))
.addStatement(exec("/usr/sbin/apachectl start"))
.addStatement(exec("iptables -I INPUT -p tcp --dport 80 -j ACCEPT"))
.addStatement(exec("echo '" + message + "' > /var/www/html/index.html"))
String script = new ScriptBuilder()
.addStatement(exec("apt-get -q -y update"))
.addStatement(exec("apt-get -q -y install apache2"))
.addStatement(exec("echo '" + message + "' > /var/www/index.html"))
.render(OsFamily.UNIX);

RunScriptOptions options = RunScriptOptions.Builder.blockOnComplete(true);

0 comments on commit 3473f57

Please sign in to comment.