Ok. yes got it. but another problem. My chef Server is running on Port http://192.168.20.66:4000 notice the port is 4000 then when it tries to create a client
Chef encountered an error attempting to create the client "itappgroup-10.188.175.85" ================================================================================ Network Error: -------------- There was a network error connecting to the Chef Server: Error connecting to http://192.168.20.66:4000/clients - Connection timed out - connect(2) Relevant Config Settings: ------------------------- chef_server_url "http://192.168.20.66:4000" but my chef web ui is being listened on port 4040 http://192.168.20.66:4000/clients is invalid http://192.168.20.66:4040/clients is valid have i missed something while configuring my chef server. Thanks in advance Jayant Kaushal +91-9060519860 On Mon, Dec 9, 2013 at 6:18 PM, Ignasi Barrera <[email protected]>wrote: > 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) >
