Slide 15
Slide 15 text
Bootstrap example
ChefContext ctx = ContextBuilder.newBuilder("chef")
.endpoint(“http://abiquo-chef.bcn.abiquo.com”)
.credentials("provisioner", readFile (“provisioner.pem”))
.buildView(ChefContext.class);
ChefService chef = ctx.getChefService();
BootstrapConfig bootstrapConfig = BootstrapConfig.builder()
.runList(new RunListBuilder().addRole("abiquo-nightly").build());
.attributes(new JsonBall(readFile (“attributes.json”))));
.environment(“Staging”);
.build();
chef.updateBootstrapConfigForGroup(“staging”, bootstrapConfig);
Statement bootstrap = chef.createBootstrapScriptForGroup(“staging”);
compute.runScriptOnNodesMatching(inGroup (“staging”), bootstrap);
attributes.json
{
"set_fqdn": "{{hostname}}",
"abiquo": {
"license": "{{license}}",
"yum": {
"nightly-repo": "http://staging.bcn.abiquo.com/{{version}}/rpm"
}
}
}
Dynamic run lists
Dynamic environments
Dynamic attributes
Reusable & persistent configuration