The line that fails [1] suggests that the validation certificate is missing.

The bootstrap process simulates the "knife bootstrap" and it requires
the validation certificate, which will allow the node to auto-register
in the Chef Server. It must be provided when creating the context.
Could you check you are properly setting it?

Here is a code example of how to configure it:

// Read the validator PEM file
String validatorPemFile ="/home/foo/.chef/chef-validator.pem";
String validatorCredential = Files.toString(new
File(validatorPemFile), Charsets.UTF_8);

// Configure the validator properties used to create the context
Properties chefConfig = new Properties();
chefConfig.put(ChefProperties.CHEF_VALIDATOR_NAME, "chef-validator");
chefConfig.put(ChefProperties.CHEF_VALIDATOR_CREDENTIAL, validatorCredential);

// Create the context using the configured properties
ChefContext context = ContextBuilder.newBuilder("chef") //
    .endpoint(endpoint) //
    .credentials(client, credential) //
    .overrides(chefConfig) //  <-- This is the important line
    .buildView(ChefContext.class);




[1] 
https://github.com/jclouds/jclouds-chef/blob/master/core/src/main/java/org/jclouds/chef/functions/GroupToBootScript.java#L93

On 9 December 2013 11:56, Jayant Kaushal <[email protected]> wrote:
> I tried to bootstrap a node on chef server 10
> Statement bootstrap =
> chefContext.getChefService().createBootstrapScriptForGroup(chefGroup); //
> Build the script that will bootstrap the node
>
>
> this is what i got.
>
> Optional.get() cannot be called on an absent value
> at com.google.common.base.Absent.get(Absent.java:42)
> at
> org.jclouds.chef.functions.GroupToBootScript.apply(GroupToBootScript.java:93)
> at
> org.jclouds.chef.internal.BaseChefService.createBootstrapScriptForGroup(BaseChefService.java:173)
> at
> com.itapp.transports.chef.ChefComputeProducer.updateRunlistAndRunChefClient(ChefComputeProducer.java:224)
> at
> com.itapp.transports.chef.ChefComputeProducer.process(ChefComputeProducer.java:108)

Reply via email to