protected ChefSolo(Optional<String> fileCachePath, Optional<String> rolePath, Optional<String> databagPath, Optional<ImmutableList<String>> cookbookPath, Optional<String> cookbooksArchiveLocation, Optional<String> jsonAttributes, Optional<String> group, Optional<Integer> interval, Optional<String> logLevel, Optional<String> logFile, Optional<String> nodeName, Optional<Integer> splay, Optional<String> user, Optional<List<Role>> roles, Optional<List<DataBag>> databags, Optional<RunList> runlist, Optional<String> chefVersion) { this.fileCachePath = checkNotNull(fileCachePath, "fileCachePath must be set").or(DEFAULT_SOLO_PATH); this.rolePath = checkNotNull(rolePath, "rolePath must be set").or(this.fileCachePath + "/roles"); this.databagPath = checkNotNull(databagPath, "databagPath must be set").or(this.fileCachePath + "/data_bags"); this.cookbooksArchiveLocation = checkNotNull(cookbooksArchiveLocation, "cookbooksArchiveLocation must be set"); this.jsonAttributes = checkNotNull(jsonAttributes, "jsonAttributes must be set"); this.group = checkNotNull(group, "group must be set"); this.interval = checkNotNull(interval, "interval must be set"); this.logLevel = checkNotNull(logLevel, "logLevel must be set"); this.logFile = checkNotNull(logFile, "logFile must be set"); this.nodeName = checkNotNull(nodeName, "nodeName must be set"); this.splay = checkNotNull(splay, "splay must be set"); this.user = checkNotNull(user, "user must be set"); this.roles = checkNotNull(roles, "roles must be set"); this.databags = checkNotNull(databags, "databags must be set"); this.runlist = checkNotNull(runlist, "runlist must be set").or(RunList.builder().build()); this.user = checkNotNull(user, "chefVersion must be set"); if (!checkNotNull(cookbookPath, "cookbookPath must be set").isPresent() || cookbookPath.get().isEmpty()) { this.cookbookPath = ImmutableList.<String> of(this.fileCachePath + "/cookbooks"); } else { this.cookbookPath = ImmutableList.<String> copyOf(cookbookPath.get()); } this.installChefGems = InstallChefGems.builder().version(chefVersion.orNull()).build(); }
protected ChefSolo(Optional<String> fileCachePath, Optional<String> rolePath, Optional<String> databagPath, Optional<ImmutableList<String>> cookbookPath, Optional<String> cookbooksArchiveLocation, Optional<String> jsonAttributes, Optional<String> group, Optional<Integer> interval, Optional<String> logLevel, Optional<String> logFile, Optional<String> nodeName, Optional<Integer> splay, Optional<String> user, Optional<List<Role>> roles, Optional<List<DataBag>> databags, Optional<RunList> runlist, Optional<String> chefVersion) { this.fileCachePath = checkNotNull(fileCachePath, "fileCachePath must be set").or(DEFAULT_SOLO_PATH); this.rolePath = checkNotNull(rolePath, "rolePath must be set").or(this.fileCachePath + "/roles"); this.databagPath = checkNotNull(databagPath, "databagPath must be set").or(this.fileCachePath + "/data_bags"); this.cookbooksArchiveLocation = checkNotNull(cookbooksArchiveLocation, "cookbooksArchiveLocation must be set"); this.jsonAttributes = checkNotNull(jsonAttributes, "jsonAttributes must be set"); this.group = checkNotNull(group, "group must be set"); this.interval = checkNotNull(interval, "interval must be set"); this.logLevel = checkNotNull(logLevel, "logLevel must be set"); this.logFile = checkNotNull(logFile, "logFile must be set"); this.nodeName = checkNotNull(nodeName, "nodeName must be set"); this.splay = checkNotNull(splay, "splay must be set"); this.user = checkNotNull(user, "user must be set"); this.roles = checkNotNull(roles, "roles must be set"); this.databags = checkNotNull(databags, "databags must be set"); this.runlist = checkNotNull(runlist, "runlist must be set").or(RunList.builder().build()); this.user = checkNotNull(user, "chefVersion must be set"); if (!checkNotNull(cookbookPath, "cookbookPath must be set").isPresent() || cookbookPath.get().isEmpty()) { this.cookbookPath = ImmutableList.<String> of(this.fileCachePath + "/cookbooks"); } else { this.cookbookPath = ImmutableList.<String> copyOf(cookbookPath.get()); } this.installChefGems = InstallChefGems.builder().version(chefVersion.orNull()).build(); }
@Provides @Named("installChefGems") @Singleton final Statement installChefGems(BootstrapProperties bootstrapProperties) { InstallRubyGems installRubyGems = InstallRubyGems.builder() .version(bootstrapProperties.gemSystemVersion().orNull()) .updateSystem(bootstrapProperties.updateGemSystem(), bootstrapProperties.gemSystemVersion().orNull()) .updateExistingGems(bootstrapProperties.updateGems()) // .build(); Statement installChef = InstallChefGems.builder().version(bootstrapProperties.chefVersion().orNull()).build(); return new StatementList(InstallRuby.builder().build(), installRubyGems, installChef); }
public void installChefGemsUnixWithCustomVersion() throws IOException { assertEquals(InstallChefGems.builder().version(">= 0.10.8").build().render(OsFamily.UNIX), "gem install chef -v '>= 0.10.8' --no-rdoc --no-ri\n"); }
@Provides @Named("installChefGems") @Singleton Statement installChef(BootstrapProperties bootstrapProperties) { InstallRubyGems installRubyGems = InstallRubyGems.builder() .version(bootstrapProperties.gemSystemVersion().orNull()) .updateSystem(bootstrapProperties.updateGemSystem(), bootstrapProperties.gemSystemVersion().orNull()) .updateExistingGems(bootstrapProperties.updateGems()) // .build(); Statement installChef = InstallChefGems.builder().version(bootstrapProperties.chefVersion().orNull()).build(); return new StatementList(InstallRuby.builder().build(), installRubyGems, installChef); }
@Provides @Named("installChefGems") @Singleton Statement installChef(BootstrapProperties bootstrapProperties) { InstallRubyGems installRubyGems = InstallRubyGems.builder() .version(bootstrapProperties.gemSystemVersion().orNull()) .updateSystem(bootstrapProperties.updateGemSystem(), bootstrapProperties.gemSystemVersion().orNull()) .updateExistingGems(bootstrapProperties.updateGems()) // .build(); Statement installChef = InstallChefGems.builder().version(bootstrapProperties.chefVersion().orNull()).build(); return new StatementList(InstallRuby.builder().build(), installRubyGems, installChef); }
@Provides @Named("installChefGems") @Singleton final Statement installChefGems(BootstrapProperties bootstrapProperties) { InstallRubyGems installRubyGems = InstallRubyGems.builder() .version(bootstrapProperties.gemSystemVersion().orNull()) .updateSystem(bootstrapProperties.updateGemSystem(), bootstrapProperties.gemSystemVersion().orNull()) .updateExistingGems(bootstrapProperties.updateGems()) // .build(); Statement installChef = InstallChefGems.builder().version(bootstrapProperties.chefVersion().orNull()).build(); return new StatementList(InstallRuby.builder().build(), installRubyGems, installChef); }
public void installChefGemsUnixWithCustomVersion() throws IOException { assertEquals(InstallChefGems.builder().version(">= 0.10.8").build().render(OsFamily.UNIX), "gem install chef -v '>= 0.10.8' --no-rdoc --no-ri\n"); }