Package org.jclouds.chef.util

Examples of org.jclouds.chef.util.RunListBuilder


      String config = chefService.buildBootstrapConfiguration(bootstrapConfig);
      assertEquals(config, "{\"run_list\":[\"recipe[apache2]\",\"role[webserver]\"]}");
   }

   public void testBuildBootstrapConfigurationWithRunlistAndEmptyAttributes() {
      List<String> runlist = new RunListBuilder().addRecipe("apache2").addRole("webserver").build();
      BootstrapConfig bootstrapConfig = BootstrapConfig.builder().runList(runlist).attributes(new JsonBall("{}"))
            .build();
      String config = chefService.buildBootstrapConfiguration(bootstrapConfig);
      assertEquals(config, "{\"run_list\":[\"recipe[apache2]\",\"role[webserver]\"]}");
   }
View Full Code Here


      String config = chefService.buildBootstrapConfiguration(bootstrapConfig);
      assertEquals(config, "{\"run_list\":[\"recipe[apache2]\",\"role[webserver]\"]}");
   }

   public void testBuildBootstrapConfigurationWithRunlistAndAttributes() {
      List<String> runlist = new RunListBuilder().addRecipe("apache2").addRole("webserver").build();
      BootstrapConfig bootstrapConfig = BootstrapConfig.builder().runList(runlist)
            .attributes(new JsonBall("{\"tomcat6\":{\"ssl_port\":8433}}")).build();
      String config = chefService.buildBootstrapConfiguration(bootstrapConfig);
      assertEquals(config, "{\"tomcat6\":{\"ssl_port\":8433},\"run_list\":[\"recipe[apache2]\",\"role[webserver]\"]}");
   }
View Full Code Here

      String config = chefService.buildBootstrapConfiguration(bootstrapConfig);
      assertEquals(config, "{\"tomcat6\":{\"ssl_port\":8433},\"run_list\":[\"recipe[apache2]\",\"role[webserver]\"]}");
   }

   public void testBuildBootstrapConfigurationWithRunlistAndAttributesAndEnvironment() {
      List<String> runlist = new RunListBuilder().addRecipe("apache2").addRole("webserver").build();
      BootstrapConfig bootstrapConfig = BootstrapConfig.builder().runList(runlist)
            .attributes(new JsonBall("{\"tomcat6\":{\"ssl_port\":8433}}")).environment("env").build();
      String config = chefService.buildBootstrapConfiguration(bootstrapConfig);
      assertEquals(config,
            "{\"tomcat6\":{\"ssl_port\":8433},\"environment\":\"env\",\"run_list\":[\"recipe[apache2]\",\"role[webserver]\"]}");
View Full Code Here

    @Override
    public Statement getStatement() {
        Statement statement = null;
        ChefService chefService = getChefService();
        if (chefService != null) {
            List<String> runlist = new RunListBuilder().addRecipes(cookbook).build();
            chefService.updateRunListForGroup(runlist, "single");
            statement = chefService.createBootstrapScriptForGroup("single");
        }
        return statement;
    }
View Full Code Here

    @Override
    public Statement getStatement() {
        Statement statement = null;
        ChefService chefService = getChefService();
        if (chefService != null) {
            List<String> runlist = new RunListBuilder().addRecipes(cookbook).build();
            chefService.updateRunListForGroup(runlist, group);
            statement = chefService.createBootstrapScriptForGroup(group);
        }
        return statement;
    }
View Full Code Here

        return id;
    }

    @Override
    public Statement createStatement(String recipe, String group) {
        List<String> runlist = new RunListBuilder().addRecipes(recipe).build();
        chefService.updateRunListForGroup(runlist, group);
        return chefService.createBootstrapScriptForGroup(group);
    }
View Full Code Here

               ChefService chef = initChefService(System.getProperty("chef.client"),
                     System.getProperty("chef.validator"));

               // Build the runlist for the deployed nodes
               System.out.println("Configuring node runlist in the Chef server...");
               List<String> runlist = new RunListBuilder().addRecipes(recipes.split(",")).build();
               chef.updateRunListForGroup(runlist, groupName);
               Statement chefServerBootstrap = chef.createBootstrapScriptForGroup(groupName);

               // Run the script in the nodes of the group
               System.out.printf(">> installing [%s] on group %s as %s%n", recipes, groupName, login.identity);
View Full Code Here

      String recipe = "apache2";

      Iterable<? extends CookbookVersion> cookbookVersions = view.getChefService().listCookbookVersions();

      if (any(cookbookVersions, containsRecipe(recipe))) {
         List<String> runList = new RunListBuilder().addRecipe(recipe).build();
         view.getChefService().updateBootstrapConfigForGroup(runList, group);
         assertEquals(view.getChefService().getRunListForGroup(group), runList);
      } else {
         assert false : String.format("recipe %s not in %s", recipe, cookbookVersions);
      }
View Full Code Here

            .buildBootstrapConfiguration(ImmutableList.<String> of(), Optional.<JsonBall> absent());
      assertEquals(config, "{\"run_list\":[]}");
   }

   public void testBuildBootstrapConfigurationWithRunlist() {
      List<String> runlist = new RunListBuilder().addRecipe("apache2").addRole("webserver").build();
      String config = chefService.buildBootstrapConfiguration(runlist, Optional.<JsonBall> absent());
      assertEquals(config, "{\"run_list\":[\"recipe[apache2]\",\"role[webserver]\"]}");
   }
View Full Code Here

      String config = chefService.buildBootstrapConfiguration(runlist, Optional.<JsonBall> absent());
      assertEquals(config, "{\"run_list\":[\"recipe[apache2]\",\"role[webserver]\"]}");
   }

   public void testBuildBootstrapConfigurationWithRunlistAndEmptyAttributes() {
      List<String> runlist = new RunListBuilder().addRecipe("apache2").addRole("webserver").build();
      String config = chefService.buildBootstrapConfiguration(runlist, Optional.of(new JsonBall("{}")));
      assertEquals(config, "{\"run_list\":[\"recipe[apache2]\",\"role[webserver]\"]}");
   }
View Full Code Here

TOP

Related Classes of org.jclouds.chef.util.RunListBuilder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.