brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From henev...@apache.org
Subject [44/51] [abbrv] [partial] brooklyn-library git commit: move subdir from incubator up a level as it is promoted to its own repo (first non-incubator commit!)
Date Mon, 01 Feb 2016 17:48:20 GMT
http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/02abbab0/brooklyn-library/sandbox/database/src/main/java/org/apache/brooklyn/entity/database/derby/DerbyDatabaseSshDriver.java
----------------------------------------------------------------------
diff --git a/brooklyn-library/sandbox/database/src/main/java/org/apache/brooklyn/entity/database/derby/DerbyDatabaseSshDriver.java b/brooklyn-library/sandbox/database/src/main/java/org/apache/brooklyn/entity/database/derby/DerbyDatabaseSshDriver.java
deleted file mode 100644
index 05a1b46..0000000
--- a/brooklyn-library/sandbox/database/src/main/java/org/apache/brooklyn/entity/database/derby/DerbyDatabaseSshDriver.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.brooklyn.entity.database.derby;
-
-import static java.lang.String.format;
-
-import java.util.List;
-import java.util.Map;
-
-import org.apache.brooklyn.entity.java.JavaSoftwareProcessSshDriver;
-import org.apache.brooklyn.api.location.Location;
-import org.apache.brooklyn.location.ssh.SshMachineLocation;
-import org.apache.brooklyn.util.collections.MutableMap;
-import org.apache.brooklyn.util.ssh.BashCommands;
-
-import com.google.common.collect.ImmutableList;
-
-/**
- * Start a {@link DerbyDatabase} in a {@link Location} accessible over ssh.
- *
- * TODO work in progress
- */
-public class DerbyDatabaseSshDriver extends JavaSoftwareProcessSshDriver implements DerbyDatabaseDriver {
-
-    // TOD Previous comment said "JMX is configured using command line switch"; how should that be set here?
-
-    public DerbyDatabaseSshDriver(DerbyDatabase entity, SshMachineLocation machine) {
-        super(entity, machine);
-    }
-
-    public String getPidFile() { return "derby.pid"; }
-
-    @Override
-    protected String getLogFileLocation() {
-        throw new UnsupportedOperationException("Work in progress");
-    }
-
-    @Override
-    public void install() {
-        String url = format("http://www.mirrorservice.org/sites/ftp.apache.org/db/derby/db-derby-%s/db-derby-%s-lib.tar.gz", getVersion(), getVersion());
-        String saveAs = format("db-derby-%s-lib.tar.gz", getVersion());
-
-        List<String> commands = ImmutableList.<String>builder()
-                .add(BashCommands.commandToDownloadUrlAs(url, saveAs))
-                .add(BashCommands.INSTALL_TAR)
-                .add("tar xzfv " + saveAs)
-                .build();
-
-        newScript(INSTALLING)
-                .failOnNonZeroResultCode()
-                .body.append(commands).execute();
-    }
-
-    @Override
-    public void customize() {
-        newScript(CUSTOMIZING)
-                .failOnNonZeroResultCode()
-                .body.append(
-                        format("cp -R %s/derby-broker-%s/{bin,etc,lib} .", getInstallDir(), getVersion()),
-                        "make install PREFIX="+getRunDir())
-                .execute();
-    }
-    
-    @Override
-    public void launch() {
-        // TODO Should we redirect stdout/stderr: format(" >> %s/console 2>&1 </dev/null &", getRunDir())
-        newScript(MutableMap.of("usePidFile", getPidFile()), LAUNCHING)
-                .failOnNonZeroResultCode()
-                .body.append("nohup ./bin/derby &")
-                .execute();
-    }
- 
-
-    @Override
-    public boolean isRunning() {
-        return newScript(MutableMap.of("usePidFile", getPidFile()), CHECK_RUNNING)
-                .execute() == 0;
-    }
-
-    /**
-     * Restarts redis with the current configuration.
-     */
-    @Override
-    public void stop() {
-        newScript(MutableMap.of("usePidFile", getPidFile()), STOPPING)
-                .execute();
-    }
-
-    @Override
-    public Map<String, String> getShellEnvironment() {
-        Map<String, String> orig = super.getShellEnvironment();
-        
-        return MutableMap.<String, String>builder()
-                .putAll(orig)
-                .put("DERBY_HOME", getRunDir())
-                .put("DERBY_WORK", getRunDir())
-                .putIfNotNull("DERBY_OPTS", orig.get("JAVA_OPTS"))
-                .build();
-    }
-}

http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/02abbab0/brooklyn-library/sandbox/database/src/main/java/org/apache/brooklyn/entity/database/derby/DerbySchema.java
----------------------------------------------------------------------
diff --git a/brooklyn-library/sandbox/database/src/main/java/org/apache/brooklyn/entity/database/derby/DerbySchema.java b/brooklyn-library/sandbox/database/src/main/java/org/apache/brooklyn/entity/database/derby/DerbySchema.java
deleted file mode 100644
index 07417a5..0000000
--- a/brooklyn-library/sandbox/database/src/main/java/org/apache/brooklyn/entity/database/derby/DerbySchema.java
+++ /dev/null
@@ -1,148 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.brooklyn.entity.database.derby;
-
-import static java.lang.String.format;
-
-import java.util.Map;
-import java.util.concurrent.TimeUnit;
-
-import javax.management.ObjectName;
-
-import org.apache.brooklyn.core.entity.AbstractEntity;
-import org.apache.brooklyn.core.sensor.BasicAttributeSensor;
-import org.apache.brooklyn.util.core.flags.SetFromFlag;
-import org.apache.brooklyn.entity.database.Schema;
-
-import org.apache.brooklyn.api.entity.Entity;
-import org.apache.brooklyn.api.entity.EntityLocal;
-import org.apache.brooklyn.entity.java.UsesJmx;
-import org.apache.brooklyn.feed.jmx.JmxAttributePollConfig;
-import org.apache.brooklyn.feed.jmx.JmxFeed;
-import org.apache.brooklyn.feed.jmx.JmxHelper;
-import org.apache.brooklyn.api.sensor.AttributeSensor;
-import org.apache.brooklyn.util.collections.MutableMap;
-import org.apache.brooklyn.util.exceptions.Exceptions;
-
-import com.google.common.base.Objects.ToStringHelper;
-
-public class DerbySchema extends AbstractEntity implements Schema {
-
-    // FIXME Needs reviewed and implemented properly; while fixing compilation errors
-    // I added enough for it to look mostly plausible but it's completely untested.
-    // And I have not looked up the derby docs to check that the attributes etc are valid. 
-    
-    // TODO Somehow share jmx connection with DerbyDatabase instance
-    
-    // TODO Declare effectors
-    
-    public static AttributeSensor<Integer> SCHEMA_DEPTH = new BasicAttributeSensor<Integer>(
-            Integer.class, "derby.schema.depth", "schema depth");
-    
-    public static AttributeSensor<Integer> MESSAGE_COUNT = new BasicAttributeSensor<Integer>(
-            Integer.class, "derby.schema.messageCount", "message count");
-    
-    @SetFromFlag(defaultVal="localhost")
-    String virtualHost;
-    
-    @SetFromFlag(nullable=false)
-    String name;
-
-    protected ObjectName virtualHostManager;
-    protected ObjectName exchange;
-
-    transient JmxHelper jmxHelper;
-    transient JmxFeed jmxFeed;
-    
-    public DerbySchema() {
-        super(MutableMap.of(), null);
-    }
-    public DerbySchema(Map properties) {
-        super(properties, null);
-    }
-    public DerbySchema(Entity parent) {
-        this(MutableMap.of(), parent);
-    }
-    public DerbySchema(Map properties, Entity parent) {
-        super(properties, parent);
-    }
-    
-    @Override
-    public String getName() {
-        return name;
-    }
-    
-    @Override
-    public DerbyDatabase getParent() {
-        return (DerbyDatabase) super.getParent();
-    }
-    
-    /**
-     * Return the JDBC connection URL for the schema.
-     */
-    public String getConnectionUrl() { return String.format("jdbc:derby:%s", name); }
-
-    public void init() {
-        try {
-            virtualHostManager = new ObjectName(format("org.apache.derby:type=VirtualHost.VirtualHostManager,VirtualHost=\"%s\"", virtualHost));
-            exchange = new ObjectName(format("org.apache.derby:type=VirtualHost.Exchange,VirtualHost=\"%s\",name=\"amq.direct\",ExchangeType=direct", virtualHost));
-            create();
-
-            jmxHelper = new JmxHelper((EntityLocal)getParent());
-
-            ObjectName schemaMBeanName = new ObjectName(format("org.apache.derby:type=VirtualHost.Schema,VirtualHost=\"%s\",name=\"%s\"", virtualHost, name));
-
-            jmxFeed = JmxFeed.builder()
-                    .entity(this)
-                    .helper(jmxHelper)
-                    .period(500, TimeUnit.MILLISECONDS)
-                    .pollAttribute(new JmxAttributePollConfig<Integer>(SCHEMA_DEPTH)
-                            .objectName(schemaMBeanName)
-                            .attributeName("SchemaDepth"))
-                    .pollAttribute(new JmxAttributePollConfig<Integer>(MESSAGE_COUNT)
-                            .objectName(schemaMBeanName)
-                            .attributeName("MessageCount"))
-                    .build();
-            
-        } catch (Exception e) {
-            throw Exceptions.propagate(e);
-        }
-    }
-
-    public void create() {
-        jmxHelper.operation(virtualHostManager, "createNewSchema", name, getParent().getAttribute(UsesJmx.JMX_USER), true);
-        jmxHelper.operation(exchange, "createNewBinding", name, name);
-    }
-
-    public void remove() {
-        jmxHelper.operation(exchange, "removeBinding", name, name);
-        jmxHelper.operation(virtualHostManager, "deleteSchema", name);
-    }
-
-    @Override
-    public void destroy() {
-        if (jmxFeed != null) jmxFeed.stop();
-        super.destroy();
-    }
-
-    @Override
-    protected ToStringHelper toStringHelper() {
-        return super.toStringHelper().add("name", name);
-    }
-}

http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/02abbab0/brooklyn-library/sandbox/database/src/test/java/org/apache/brooklyn/entity/database/PlaceholderTest.java
----------------------------------------------------------------------
diff --git a/brooklyn-library/sandbox/database/src/test/java/org/apache/brooklyn/entity/database/PlaceholderTest.java b/brooklyn-library/sandbox/database/src/test/java/org/apache/brooklyn/entity/database/PlaceholderTest.java
deleted file mode 100644
index 564249d..0000000
--- a/brooklyn-library/sandbox/database/src/test/java/org/apache/brooklyn/entity/database/PlaceholderTest.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.brooklyn.entity.database;
-
-import org.testng.annotations.Test;
-
-public class PlaceholderTest {
-    @Test
-    public void noop() {}
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/02abbab0/brooklyn-library/sandbox/extra/pom.xml
----------------------------------------------------------------------
diff --git a/brooklyn-library/sandbox/extra/pom.xml b/brooklyn-library/sandbox/extra/pom.xml
deleted file mode 100644
index a84dda4..0000000
--- a/brooklyn-library/sandbox/extra/pom.xml
+++ /dev/null
@@ -1,79 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-    Licensed to the Apache Software Foundation (ASF) under one
-    or more contributor license agreements.  See the NOTICE file
-    distributed with this work for additional information
-    regarding copyright ownership.  The ASF licenses this file
-    to you under the Apache License, Version 2.0 (the
-    "License"); you may not use this file except in compliance
-    with the License.  You may obtain a copy of the License at
-    
-     http://www.apache.org/licenses/LICENSE-2.0
-    
-    Unless required by applicable law or agreed to in writing,
-    software distributed under the License is distributed on an
-    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-    KIND, either express or implied.  See the License for the
-    specific language governing permissions and limitations
-    under the License.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-    <modelVersion>4.0.0</modelVersion>
-    <groupId>org.apache.brooklyn.sandbox</groupId>
-    <artifactId>brooklyn-sandbox-software-extra</artifactId>
-    <packaging>bundle</packaging>
-    <name>Brooklyn Extra Software Entities</name>
-    <description>
-		Brooklyn entitites for extra software processes
-	</description>
-
-    <parent>
-        <groupId>org.apache.brooklyn</groupId>
-        <artifactId>brooklyn-library</artifactId>
-        <version>0.9.0-SNAPSHOT</version>  <!-- BROOKLYN_VERSION -->
-        <relativePath>../../pom.xml</relativePath>
-    </parent>
-
-    <dependencies>
-        <dependency>
-            <groupId>org.apache.brooklyn</groupId>
-            <artifactId>brooklyn-software-base</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.brooklyn</groupId>
-            <artifactId>brooklyn-software-database</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-
-        <dependency>
-            <groupId>org.apache.brooklyn</groupId>
-            <artifactId>brooklyn-test-support</artifactId>
-            <version>${project.version}</version>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.brooklyn</groupId>
-            <artifactId>brooklyn-core</artifactId>
-            <version>${project.version}</version>
-            <classifier>tests</classifier>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.brooklyn</groupId>
-            <artifactId>brooklyn-software-base</artifactId>
-            <version>${project.version}</version>
-            <classifier>tests</classifier>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.brooklyn</groupId>
-            <artifactId>brooklyn-software-database</artifactId>
-            <version>${project.version}</version>
-            <classifier>tests</classifier>
-            <scope>test</scope>
-        </dependency>
-    </dependencies>
-
-</project>

http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/02abbab0/brooklyn-library/sandbox/extra/src/main/java/org/apache/brooklyn/entity/database/postgresql/PostgreSqlNodeSaltImpl.java
----------------------------------------------------------------------
diff --git a/brooklyn-library/sandbox/extra/src/main/java/org/apache/brooklyn/entity/database/postgresql/PostgreSqlNodeSaltImpl.java b/brooklyn-library/sandbox/extra/src/main/java/org/apache/brooklyn/entity/database/postgresql/PostgreSqlNodeSaltImpl.java
deleted file mode 100644
index db505af..0000000
--- a/brooklyn-library/sandbox/extra/src/main/java/org/apache/brooklyn/entity/database/postgresql/PostgreSqlNodeSaltImpl.java
+++ /dev/null
@@ -1,183 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.brooklyn.entity.database.postgresql;
-
-import org.apache.brooklyn.api.location.Location;
-import org.apache.brooklyn.util.core.ResourceUtils;
-import org.apache.brooklyn.util.core.config.ConfigBag;
-import org.apache.brooklyn.util.core.task.DynamicTasks;
-import org.apache.brooklyn.entity.salt.SaltConfig;
-import org.apache.brooklyn.entity.salt.SaltConfigs;
-import org.apache.brooklyn.entity.salt.SaltLifecycleEffectorTasks;
-import org.apache.brooklyn.location.ssh.SshMachineLocation;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import org.apache.brooklyn.config.ConfigKey;
-import org.apache.brooklyn.api.effector.Effector;
-import org.apache.brooklyn.core.config.ConfigKeys;
-import org.apache.brooklyn.core.effector.EffectorBody;
-import org.apache.brooklyn.core.effector.Effectors;
-import org.apache.brooklyn.core.effector.ssh.SshEffectorTasks;
-import org.apache.brooklyn.core.entity.Entities;
-import org.apache.brooklyn.core.sensor.DependentConfiguration;
-import org.apache.brooklyn.entity.stock.EffectorStartableImpl;
-import org.apache.brooklyn.feed.ssh.SshFeed;
-import org.apache.brooklyn.feed.ssh.SshPollConfig;
-import org.apache.brooklyn.entity.software.base.SoftwareProcess;
-import org.apache.brooklyn.entity.database.postgresql.PostgreSqlNode;
-import org.apache.brooklyn.util.ssh.BashCommands;
-
-import com.google.common.collect.ImmutableMap;
-import com.google.common.collect.Iterables;
-
-public class PostgreSqlNodeSaltImpl extends EffectorStartableImpl implements PostgreSqlNode, SoftwareProcess {
-
-    private static final Logger LOG = LoggerFactory.getLogger(PostgreSqlNodeSaltImpl.class);
-
-    public static final Effector<String> EXECUTE_SCRIPT = Effectors.effector(String.class, "executeScript")
-            .description("invokes a script")
-            .parameter(ExecuteScriptEffectorBody.SCRIPT)
-            .impl(new ExecuteScriptEffectorBody())
-            .build();
-
-    private SshFeed feed;
-
-    @Override
-    public void init() {
-        super.init();
-        new SaltPostgreSqlLifecycle().attachLifecycleEffectors(this);
-    }
-
-    public static class SaltPostgreSqlLifecycle extends SaltLifecycleEffectorTasks {
-        public SaltPostgreSqlLifecycle() {
-            usePidFile("/var/run/postgresql/*.pid");
-            useService("postgresql");
-        }
-
-        @Override
-        protected void startMinionAsync() {
-            Entities.warnOnIgnoringConfig(entity(), SaltConfig.SALT_FORMULAS);
-            Entities.warnOnIgnoringConfig(entity(), SaltConfig.SALT_RUN_LIST);
-            Entities.warnOnIgnoringConfig(entity(), SaltConfig.SALT_LAUNCH_ATTRIBUTES);
-
-            // TODO Set these as defaults, rather than replacing user's value!?
-            SaltConfigs.addToFormulas(entity(), "postgres", "https://github.com/saltstack-formulas/postgres-formula/archive/master.tar.gz");
-            SaltConfigs.addToRunList(entity(), "postgres");
-            SaltConfigs.addLaunchAttributes(entity(), ImmutableMap.<String,Object>builder()
-                    .put("port", DependentConfiguration.attributeWhenReady(entity(), PostgreSqlNode.POSTGRESQL_PORT))
-                    .put("listen_addresses", "*")
-                    .put("pg_hba.type", "host")
-                    .put("pg_hba.db", "all")
-                    .put("pg_hba.user", "all")
-                    .put("pg_hba.addr", "0.0.0.0/0")
-                    .put("pg_hba.method", "md5")
-                    .build());
-
-            super.startMinionAsync();
-        }
-
-        @Override
-        protected void postStartCustom() {
-            super.postStartCustom();
-
-            // now run the creation script
-            String creationScriptUrl = entity().getConfig(PostgreSqlNode.CREATION_SCRIPT_URL);
-            String creationScript;
-            if (creationScriptUrl != null) {
-                creationScript = new ResourceUtils(entity()).getResourceAsString(creationScriptUrl);
-            } else {
-                creationScript = entity().getConfig(PostgreSqlNode.CREATION_SCRIPT_CONTENTS);
-            }
-            entity().invoke(PostgreSqlNodeSaltImpl.EXECUTE_SCRIPT,
-                    ConfigBag.newInstance().configure(ExecuteScriptEffectorBody.SCRIPT, creationScript).getAllConfig()).getUnchecked();
-
-            // and finally connect sensors
-            ((PostgreSqlNodeSaltImpl) entity()).connectSensors();
-        }
-
-        @Override
-        protected void preStopCustom() {
-            ((PostgreSqlNodeSaltImpl) entity()).disconnectSensors();
-            super.preStopCustom();
-        }
-    }
-
-    public static class ExecuteScriptEffectorBody extends EffectorBody<String> {
-        public static final ConfigKey<String> SCRIPT = ConfigKeys.newStringConfigKey("script", "contents of script to run");
-
-        @Override
-        public String call(ConfigBag parameters) {
-            return DynamicTasks.queue(SshEffectorTasks.ssh(
-                    BashCommands.pipeTextTo(
-                            parameters.get(SCRIPT),
-                            BashCommands.sudoAsUser("postgres", "psql --file -")))
-                    .requiringExitCodeZero()).getStdout();
-        }
-    }
-
-    protected void connectSensors() {
-        sensors().set(DATASTORE_URL, String.format("postgresql://%s:%s/", getAttribute(HOSTNAME), getAttribute(POSTGRESQL_PORT)));
-
-        Location machine = Iterables.get(getLocations(), 0, null);
-
-        if (machine instanceof SshMachineLocation) {
-            feed = SshFeed.builder()
-                    .entity(this)
-                    .machine((SshMachineLocation)machine)
-                    .poll(new SshPollConfig<Boolean>(SERVICE_UP)
-                            .command("ps -ef | grep [p]ostgres")
-                            .setOnSuccess(true)
-                            .setOnFailureOrException(false))
-                    .build();
-        } else {
-            LOG.warn("Location(s) %s not an ssh-machine location, so not polling for status; setting serviceUp immediately", getLocations());
-        }
-    }
-
-    protected void disconnectSensors() {
-        if (feed != null) feed.stop();
-    }
-
-    @Override
-    public Integer getPostgreSqlPort() { return getAttribute(POSTGRESQL_PORT); }
-
-    @Override
-    public String getSharedMemory() { return getConfig(SHARED_MEMORY); }
-
-    @Override
-    public Integer getMaxConnections() { return getConfig(MAX_CONNECTIONS); }
-
-    @Override
-    public String getShortName() {
-        return "PostgreSQL";
-    }
-
-    @Override
-    public String executeScript(String commands) {
-        return Entities.invokeEffector(this, this, EXECUTE_SCRIPT,
-                ConfigBag.newInstance().configure(ExecuteScriptEffectorBody.SCRIPT, commands).getAllConfig()).getUnchecked();
-    }
-
-    @Override
-    public void populateServiceNotUpDiagnostics() {
-        // TODO no-op currently; should check ssh'able etc
-    }
-}

http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/02abbab0/brooklyn-library/sandbox/extra/src/main/java/org/apache/brooklyn/entity/salt/SaltBashCommands.java
----------------------------------------------------------------------
diff --git a/brooklyn-library/sandbox/extra/src/main/java/org/apache/brooklyn/entity/salt/SaltBashCommands.java b/brooklyn-library/sandbox/extra/src/main/java/org/apache/brooklyn/entity/salt/SaltBashCommands.java
deleted file mode 100644
index 7b06a1e..0000000
--- a/brooklyn-library/sandbox/extra/src/main/java/org/apache/brooklyn/entity/salt/SaltBashCommands.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.brooklyn.entity.salt;
-
-import static org.apache.brooklyn.util.ssh.BashCommands.downloadToStdout;
-
-import javax.annotation.Nullable;
-
-import org.apache.commons.io.FilenameUtils;
-
-import org.apache.brooklyn.util.ssh.BashCommands;
-import org.apache.brooklyn.util.text.Identifiers;
-import org.apache.brooklyn.util.text.Strings;
-
-import com.google.common.annotations.Beta;
-import com.google.common.io.Files;
-
-/**
- * BASH commands useful for setting up SaltStack.
- */
-@Beta
-public class SaltBashCommands {
-
-    /**
-     * SaltStack formulas can be found at {@code https://github.com/saltstack-formulas} as repositories.
-     * <p>
-     * This assumes the download is an archive containing a single directory on the root which will
-     * be renamed to {@code formulaName}. if that directory already has the correct name {@code formulaName}
-     * can be null, but if taking from a GitHub tarball it will typically be of the form {@code formulaName-master/}
-     * hence the renaming.
-     */
-    // TODO support installing from classpath, and using the repository (tie in with those methods)
-    public static final String downloadAndExpandFormula(String source, @Nullable String formulaName, boolean force) {
-        String dl = downloadAndExpandFormula(source);
-        if (formulaName==null) return dl;
-        String tmpName = "tmp-"+Strings.makeValidFilename(formulaName)+"-"+Identifiers.makeRandomId(4);
-        String installCmd = BashCommands.chain("mkdir "+tmpName, "cd "+tmpName, dl,
-                BashCommands.requireTest("`ls | wc -w` -eq 1", "The archive must contain exactly one directory"),
-                "FORMULA_EXPANDED_DIR=`ls`",
-                "mv $FORMULA_EXPANDED_DIR '../"+formulaName+"'",
-                "cd ..",
-                "rm -rf "+tmpName);
-        if (!force) return BashCommands.alternatives("ls "+formulaName, installCmd);
-        else return BashCommands.alternatives("rm -rf "+formulaName, installCmd);
-    }
-
-    /**
-     * Same as {@link #downloadAndExpandFormula(String, String)} with no formula name.
-     * <p>
-     * Equivalent to the following command, but substituting the given {@code sourceUrl}.
-     * <pre>{@code
-     * curl -f -L  https://github.com/saltstack-formulas/nginx-formula/archive/master.tar.gz | tar xvz
-     * }</pre>
-     */
-    public static final String downloadAndExpandFormula(String sourceUrl) {
-        String ext = Files.getFileExtension(sourceUrl);
-        if ("tar".equalsIgnoreCase(ext))
-            return downloadToStdout(sourceUrl) + " | tar xv";
-        if ("tgz".equalsIgnoreCase(ext) || sourceUrl.toLowerCase().endsWith(".tar.gz"))
-            return downloadToStdout(sourceUrl) + " | tar xvz";
-
-        String target = FilenameUtils.getName(sourceUrl);
-        if (target==null) target = ""; else target = target.trim();
-        target += "_"+Strings.makeRandomId(4);
-
-        if ("zip".equalsIgnoreCase(ext) || "tar.gz".equalsIgnoreCase(ext))
-            return BashCommands.chain(
-                BashCommands.commandToDownloadUrlAs(sourceUrl, target),
-                "unzip "+target,
-                "rm "+target);
-
-        throw new UnsupportedOperationException("No way to expand "+sourceUrl+" (yet)");
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/02abbab0/brooklyn-library/sandbox/extra/src/main/java/org/apache/brooklyn/entity/salt/SaltConfig.java
----------------------------------------------------------------------
diff --git a/brooklyn-library/sandbox/extra/src/main/java/org/apache/brooklyn/entity/salt/SaltConfig.java b/brooklyn-library/sandbox/extra/src/main/java/org/apache/brooklyn/entity/salt/SaltConfig.java
deleted file mode 100644
index c67eda0..0000000
--- a/brooklyn-library/sandbox/extra/src/main/java/org/apache/brooklyn/entity/salt/SaltConfig.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.brooklyn.entity.salt;
-
-import org.apache.brooklyn.api.entity.Entity;
-import org.apache.brooklyn.api.sensor.AttributeSensor;
-import org.apache.brooklyn.api.mgmt.TaskAdaptable;
-import org.apache.brooklyn.api.mgmt.TaskFactory;
-import org.apache.brooklyn.util.core.flags.SetFromFlag;
-
-import org.apache.brooklyn.config.ConfigKey;
-import org.apache.brooklyn.core.config.ConfigKeys;
-import org.apache.brooklyn.core.config.BasicConfigKey;
-import org.apache.brooklyn.core.config.MapConfigKey;
-import org.apache.brooklyn.core.config.SetConfigKey;
-import org.apache.brooklyn.core.sensor.BasicAttributeSensor;
-
-import com.google.common.annotations.Beta;
-import com.google.common.base.Function;
-import com.google.common.base.Functions;
-import com.google.common.reflect.TypeToken;
-
-/**
- * {@link ConfigKey}s used to configure Salt entities.
- *
- * @see SaltConfigs
- * @see SaltLifecycleEffectorTasks
- */
-@Beta
-public interface SaltConfig {
-
-    MapConfigKey<String> SALT_FORMULAS = new MapConfigKey<String>(String.class,
-            "salt.formulaUrls", "Map of Salt formula URLs (normally GutHub repository archives from the salt-formulas user)");
-    SetConfigKey<String> SALT_RUN_LIST = new SetConfigKey<String>(String.class,
-            "salt.runList", "Set of Salt states to install from the formula URLs");
-    MapConfigKey<Object> SALT_LAUNCH_ATTRIBUTES = new MapConfigKey<Object>(Object.class, "salt.launch.attributes", "TODO");
-
-    @SetFromFlag("master")
-    ConfigKey<SaltStackMaster> MASTER = ConfigKeys.newConfigKey(SaltStackMaster.class,
-            "salt.master.entity", "The Salt master server");
-
-    AttributeSensor<String> MINION_ID = new BasicAttributeSensor<String>(String.class,
-            "salt.minionId", "The ID for a Salt minion");
-
-    @SetFromFlag("masterless")
-    ConfigKey<Boolean> MASTERLESS_MODE = ConfigKeys.newBooleanConfigKey(
-            "salt.masterless", "Salt masterless, minion only configuration (default uses master and minion)",
-            Boolean.FALSE);
-
-    @SetFromFlag("masterConfigUrl")
-    ConfigKey<String> MASTER_CONFIGURATION_URL = ConfigKeys.newStringConfigKey(
-            "salt.master.templateUrl", "The Salt master configuration file template URL",
-            "classpath://org/apache/brooklyn/entity/salt/master");
-
-    @SetFromFlag("minionConfigUrl")
-    ConfigKey<String> MINION_CONFIGURATION_URL = ConfigKeys.newStringConfigKey(
-            "salt.minion.templateUrl", "The Salt minion configuration file template URL",
-            "classpath://org/apache/brooklyn/entity/salt/minion");
-
-    @SetFromFlag("masterlessConfigUrl")
-    ConfigKey<String> MASTERLESS_CONFIGURATION_URL = ConfigKeys.newStringConfigKey(
-            "salt.masterless.templateUrl", "The Salt minion masterless configuration file template URL",
-            "classpath://org/apache/brooklyn/entity/salt/masterless");
-
-    @SuppressWarnings({ "unchecked", "rawtypes" })
-    @SetFromFlag("minionIdFunction")
-    ConfigKey<Function<Entity, String>> MINION_ID_FUNCTION = new BasicConfigKey(Function.class,
-            "salt.minionId.function", "Function to generate the ID of a Salt minion for an entity", Functions.toStringFunction());
-
-    @SuppressWarnings("serial")
-    ConfigKey<TaskFactory<? extends TaskAdaptable<Boolean>>> IS_RUNNING_TASK = ConfigKeys.newConfigKey(
-            new TypeToken<TaskFactory<? extends TaskAdaptable<Boolean>>>() {}, 
-            "salt.driver.isRunningTask");
-
-    @SuppressWarnings("serial")
-    ConfigKey<TaskFactory<?>> STOP_TASK = ConfigKeys.newConfigKey(
-            new TypeToken<TaskFactory<?>>() {}, 
-            "salt.driver.stopTask");
-
-    /**
-     * The {@link SaltStackMaster master} entity.
-     */
-    SaltStackMaster getMaster();
-
-}

http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/02abbab0/brooklyn-library/sandbox/extra/src/main/java/org/apache/brooklyn/entity/salt/SaltConfigs.java
----------------------------------------------------------------------
diff --git a/brooklyn-library/sandbox/extra/src/main/java/org/apache/brooklyn/entity/salt/SaltConfigs.java b/brooklyn-library/sandbox/extra/src/main/java/org/apache/brooklyn/entity/salt/SaltConfigs.java
deleted file mode 100644
index 4f7d610..0000000
--- a/brooklyn-library/sandbox/extra/src/main/java/org/apache/brooklyn/entity/salt/SaltConfigs.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.brooklyn.entity.salt;
-
-import java.util.Map;
-
-import org.apache.brooklyn.config.ConfigKey;
-import org.apache.brooklyn.api.entity.Entity;
-import org.apache.brooklyn.api.entity.EntitySpec;
-import org.apache.brooklyn.core.config.MapConfigKey.MapModifications;
-import org.apache.brooklyn.core.config.SetConfigKey.SetModifications;
-import org.apache.brooklyn.core.entity.EntityInternal;
-
-import com.google.common.annotations.Beta;
-import com.google.common.base.Preconditions;
-
-/**
- * Conveniences for configuring brooklyn Salt entities 
- *
- * @since 0.6.0
- */
-@Beta
-public class SaltConfigs {
-
-    public static void addToRunList(EntitySpec<?> entity, String...states) {
-        for (String state : states) {
-            entity.configure(SaltConfig.SALT_RUN_LIST, SetModifications.addItem(state));
-        }
-    }
-
-    public static void addToRunList(EntityInternal entity, String...states) {
-        for (String state : states) {
-            entity.config().set(SaltConfig.SALT_RUN_LIST, SetModifications.addItem(state));
-        }
-    }
-
-    public static void addToFormuals(EntitySpec<?> entity, String formulaName, String formulaUrl) {
-        entity.configure(SaltConfig.SALT_FORMULAS.subKey(formulaName), formulaUrl);
-    }
-
-    public static void addToFormulas(EntityInternal entity, String formulaName, String formulaUrl) {
-        entity.config().set(SaltConfig.SALT_FORMULAS.subKey(formulaName), formulaUrl);
-    }
-
-    @SuppressWarnings({ "unchecked", "rawtypes" })
-    public static void addLaunchAttributes(EntitySpec<?> entity, Map<? extends Object,? extends Object> attributesMap) {
-        entity.configure(SaltConfig.SALT_LAUNCH_ATTRIBUTES, MapModifications.add((Map)attributesMap));
-    }
-    
-    @SuppressWarnings({ "unchecked", "rawtypes" })
-    public static void addLaunchAttributes(EntityInternal entity, Map<? extends Object,? extends Object> attributesMap) {
-        entity.config().set(SaltConfig.SALT_LAUNCH_ATTRIBUTES, MapModifications.add((Map)attributesMap));
-    }
-    
-    /** replaces the attributes underneath the rootAttribute parameter with the given value;
-     * see {@link #addLaunchAttributesMap(EntitySpec, Map)} for richer functionality */
-    public static void setLaunchAttribute(EntitySpec<?> entity, String rootAttribute, Object value) {
-        entity.configure(SaltConfig.SALT_LAUNCH_ATTRIBUTES.subKey(rootAttribute), value);
-    }
-    
-    /** replaces the attributes underneath the rootAttribute parameter with the given value;
-     * see {@link #addLaunchAttributesMap(EntitySpec, Map)} for richer functionality */
-    public static void setLaunchAttribute(EntityInternal entity, String rootAttribute, Object value) {
-        entity.config().set(SaltConfig.SALT_LAUNCH_ATTRIBUTES.subKey(rootAttribute), value);
-    }
-
-    public static <T> T getRequiredConfig(Entity entity, ConfigKey<T> key) {
-        return Preconditions.checkNotNull(
-                Preconditions.checkNotNull(entity, "Entity must be supplied").getConfig(key), 
-                "Key "+key+" is required on "+entity);
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/02abbab0/brooklyn-library/sandbox/extra/src/main/java/org/apache/brooklyn/entity/salt/SaltLifecycleEffectorTasks.java
----------------------------------------------------------------------
diff --git a/brooklyn-library/sandbox/extra/src/main/java/org/apache/brooklyn/entity/salt/SaltLifecycleEffectorTasks.java b/brooklyn-library/sandbox/extra/src/main/java/org/apache/brooklyn/entity/salt/SaltLifecycleEffectorTasks.java
deleted file mode 100644
index 6f3e4f5..0000000
--- a/brooklyn-library/sandbox/extra/src/main/java/org/apache/brooklyn/entity/salt/SaltLifecycleEffectorTasks.java
+++ /dev/null
@@ -1,220 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.brooklyn.entity.salt;
-
-import org.apache.brooklyn.api.entity.Entity;
-import org.apache.brooklyn.api.location.MachineLocation;
-import org.apache.brooklyn.core.effector.ssh.SshEffectorTasks;
-import org.apache.brooklyn.core.entity.Attributes;
-import org.apache.brooklyn.core.entity.lifecycle.Lifecycle;
-import org.apache.brooklyn.core.server.BrooklynServerConfig;
-import org.apache.brooklyn.entity.software.base.lifecycle.MachineLifecycleEffectorTasks;
-import org.apache.brooklyn.util.core.task.DynamicTasks;
-import org.apache.brooklyn.util.core.task.Tasks;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import org.apache.brooklyn.util.net.Urls;
-import org.apache.brooklyn.util.ssh.BashCommands;
-import org.apache.brooklyn.util.time.Duration;
-import org.apache.brooklyn.util.time.Time;
-
-import com.google.common.annotations.Beta;
-import com.google.common.base.Supplier;
-
-/**
- * Creates effectors to start, restart, and stop processes using SaltStack.
- * <p>
- * Instances of this should use the {@link SaltConfig} config attributes to configure startup,
- * and invoke {@link #usePidFile(String)} or {@link #useService(String)} to determine check-running and stop behaviour.
- * Alternatively this can be subclassed and {@link #postStartCustom()} and {@link #stopProcessesAtMachine()} overridden.
- *
- * @since 0.6.0
- */
-@Beta
-public class SaltLifecycleEffectorTasks extends MachineLifecycleEffectorTasks implements SaltConfig {
-
-    private static final Logger log = LoggerFactory.getLogger(SaltLifecycleEffectorTasks.class);
-
-    protected SaltStackMaster master = null;
-    protected String pidFile, serviceName, windowsServiceName;
-
-    public SaltLifecycleEffectorTasks() {
-    }
-
-    public SaltLifecycleEffectorTasks usePidFile(String pidFile) {
-        this.pidFile = pidFile;
-        return this;
-    }
-    public SaltLifecycleEffectorTasks useService(String serviceName) {
-        this.serviceName = serviceName;
-        return this;
-    }
-    public SaltLifecycleEffectorTasks useWindowsService(String serviceName) {
-        this.windowsServiceName = serviceName;
-        return this;
-    }
-    public SaltLifecycleEffectorTasks master(SaltStackMaster master) {
-        this.master = master;
-        return this;
-    }
-
-    @Override
-    public void attachLifecycleEffectors(Entity entity) {
-        if (pidFile==null && serviceName==null && getClass().equals(SaltLifecycleEffectorTasks.class)) {
-            // warn on incorrect usage
-            log.warn("Uses of "+getClass()+" must define a PID file or a service name (or subclass and override {start,stop} methods as per javadoc) " +
-                    "in order for check-running and stop to work");
-        }
-
-        super.attachLifecycleEffectors(entity);
-    }
-
-    @Override
-    protected String startProcessesAtMachine(Supplier<MachineLocation> machineS) {
-        startMinionAsync();
-        return "salt start tasks submitted";
-    }
-
-    protected void startMinionAsync() {
-        // TODO make directories more configurable (both for ssh-drivers and for this)
-        String installDir = Urls.mergePaths(BrooklynServerConfig.getMgmtBaseDir(entity().getManagementContext()), "salt-install");
-        String runDir = Urls.mergePaths(BrooklynServerConfig.getMgmtBaseDir(entity().getManagementContext()),
-                "apps/"+entity().getApplicationId()+"/salt-entities/"+entity().getId());
-
-        Boolean masterless = entity().getConfig(SaltConfig.MASTERLESS_MODE);
-        if (masterless) {
-            DynamicTasks.queue(
-                    SaltTasks.installFormulas(installDir, SaltConfigs.getRequiredConfig(entity(), SALT_FORMULAS), false),
-                    SaltTasks.buildSaltFile(runDir,
-                            SaltConfigs.getRequiredConfig(entity(), SALT_RUN_LIST),
-                            entity().getConfig(SALT_LAUNCH_ATTRIBUTES)),
-                    SaltTasks.installSaltMinion(entity(), runDir, installDir, false),
-                    SaltTasks.runSalt(runDir));
-        } else {
-            throw new UnsupportedOperationException("Salt master mode not yet supported for minions");
-        }
-    }
-
-    @Override
-    protected void postStartCustom() {
-        boolean result = false;
-        result |= tryCheckStartPid();
-        result |= tryCheckStartService();
-        result |= tryCheckStartWindowsService();
-        if (!result) {
-            throw new IllegalStateException("The process for "+entity()+" appears not to be running (no way to check!)");
-        }
-    }
-
-    protected boolean tryCheckStartPid() {
-        if (pidFile==null) return false;
-
-        // if it's still up after 5s assume we are good (default behaviour)
-        Time.sleep(Duration.FIVE_SECONDS);
-        if (!DynamicTasks.queue(SshEffectorTasks.isPidFromFileRunning(pidFile).runAsRoot()).get()) {
-            throw new IllegalStateException("The process for "+entity()+" appears not to be running (pid file "+pidFile+")");
-        }
-
-        // and set the PID
-        entity().sensors().set(Attributes.PID,
-                Integer.parseInt(DynamicTasks.queue(SshEffectorTasks.ssh("cat "+pidFile).runAsRoot()).block().getStdout().trim()));
-        return true;
-    }
-
-    protected boolean tryCheckStartService() {
-        if (serviceName==null) return false;
-
-        // if it's still up after 5s assume we are good (default behaviour)
-        Time.sleep(Duration.FIVE_SECONDS);
-        if (!((Integer)0).equals(DynamicTasks.queue(SshEffectorTasks.ssh("/etc/init.d/"+serviceName+" status").runAsRoot()).get())) {
-            throw new IllegalStateException("The process for "+entity()+" appears not to be running (service "+serviceName+")");
-        }
-
-        return true;
-    }
-
-    protected boolean tryCheckStartWindowsService() {
-        if (windowsServiceName==null) return false;
-
-        // if it's still up after 5s assume we are good (default behaviour)
-        Time.sleep(Duration.FIVE_SECONDS);
-        if (!((Integer)0).equals(DynamicTasks.queue(SshEffectorTasks.ssh("sc query \""+serviceName+"\" | find \"RUNNING\"").runAsCommand()).get())) {
-            throw new IllegalStateException("The process for "+entity()+" appears not to be running (windowsService "+windowsServiceName+")");
-        }
-
-        return true;
-    }
-
-    @Override
-    protected String stopProcessesAtMachine() {
-        boolean result = false;
-        result |= tryStopService();
-        result |= tryStopPid();
-        if (!result) {
-            throw new IllegalStateException("The process for "+entity()+" appears could not be stopped (no impl!)");
-        }
-        return "stopped";
-    }
-
-    protected boolean tryStopService() {
-        if (serviceName==null) return false;
-        int result = DynamicTasks.queue(SshEffectorTasks.ssh("/etc/init.d/"+serviceName+" stop").runAsRoot()).get();
-        if (0==result) return true;
-        if (entity().getAttribute(Attributes.SERVICE_STATE)!=Lifecycle.RUNNING)
-            return true;
-
-        throw new IllegalStateException("The process for "+entity()+" appears could not be stopped (exit code "+result+" to service stop)");
-    }
-
-    protected boolean tryStopPid() {
-        Integer pid = entity().getAttribute(Attributes.PID);
-        if (pid==null) {
-            if (entity().getAttribute(Attributes.SERVICE_STATE)==Lifecycle.RUNNING && pidFile==null)
-                log.warn("No PID recorded for "+entity()+" when running, with PID file "+pidFile+"; skipping kill in "+Tasks.current());
-            else
-                if (log.isDebugEnabled())
-                    log.debug("No PID recorded for "+entity()+"; skipping ("+entity().getAttribute(Attributes.SERVICE_STATE)+" / "+pidFile+")");
-            return false;
-        }
-
-        // allow non-zero exit as process may have already been killed
-        DynamicTasks.queue(SshEffectorTasks.ssh(
-                "kill "+pid, "sleep 5", BashCommands.ok("kill -9 "+pid)).allowingNonZeroExitCode().runAsRoot()).block();
-
-        if (DynamicTasks.queue(SshEffectorTasks.isPidRunning(pid).runAsRoot()).get()) {
-            throw new IllegalStateException("Process for "+entity()+" in "+pid+" still running after kill");
-        }
-        entity().sensors().set(Attributes.PID, null);
-        return true;
-    }
-
-    /**
-     * {@inheritDoc}
-     *
-     * @return the Salt master entity if it exists.
-     * @see #master(SaltStackMaster)
-     * @see SaltConfig#MASTERLESS_MODE
-     */
-    @Override
-    public SaltStackMaster getMaster() {
-        return master;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/02abbab0/brooklyn-library/sandbox/extra/src/main/java/org/apache/brooklyn/entity/salt/SaltStackMaster.java
----------------------------------------------------------------------
diff --git a/brooklyn-library/sandbox/extra/src/main/java/org/apache/brooklyn/entity/salt/SaltStackMaster.java b/brooklyn-library/sandbox/extra/src/main/java/org/apache/brooklyn/entity/salt/SaltStackMaster.java
deleted file mode 100644
index 5b4a085..0000000
--- a/brooklyn-library/sandbox/extra/src/main/java/org/apache/brooklyn/entity/salt/SaltStackMaster.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.brooklyn.entity.salt;
-
-import java.util.List;
-
-import org.apache.brooklyn.api.catalog.Catalog;
-import org.apache.brooklyn.api.entity.ImplementedBy;
-import org.apache.brooklyn.api.sensor.AttributeSensor;
-import org.apache.brooklyn.config.ConfigKey;
-import org.apache.brooklyn.util.core.flags.SetFromFlag;
-
-
-import org.apache.brooklyn.core.config.ConfigKeys;
-import org.apache.brooklyn.core.entity.BrooklynConfigKeys;
-import org.apache.brooklyn.core.sensor.BasicAttributeSensor;
-import org.apache.brooklyn.core.sensor.PortAttributeSensorAndConfigKey;
-import org.apache.brooklyn.entity.software.base.SoftwareProcess;
-
-import com.google.common.reflect.TypeToken;
-
-@ImplementedBy(SaltStackMasterImpl.class)
-@Catalog(name="SaltStack Master", description="The Salt master server")
-public interface SaltStackMaster extends SoftwareProcess {
-
-    @SetFromFlag("version")
-    ConfigKey<String> SUGGESTED_VERSION = ConfigKeys.newConfigKeyWithDefault(BrooklynConfigKeys.SUGGESTED_VERSION, "stable");
-
-    @SetFromFlag("bootstrapUrl")
-    ConfigKey<String> BOOTSTRAP_URL = ConfigKeys.newStringConfigKey(
-            "salt.bootstrap.url", "The URL that returns the Salt boostrap commands",
-            "http://bootstrap.saltstack.org/");
-
-    @SetFromFlag("masterUser")
-    ConfigKey<String> MASTER_USER = ConfigKeys.newStringConfigKey(
-            "salt.master.user", "The user that runs the Salt master daemon process",
-            "root");
-
-    @SetFromFlag("masterConfigTemplate")
-    ConfigKey<String> MASTER_CONFIG_TEMPLATE_URL = ConfigKeys.newStringConfigKey(
-            "salt.master.config.templateUrl", "The template for the Salt master configuration (URL)",
-            "classpath://org/apache/brooklyn/entity/salt/master");
-
-    @SetFromFlag("saltPort")
-    PortAttributeSensorAndConfigKey SALT_PORT = new PortAttributeSensorAndConfigKey(
-            "salt.port", "Port used for communication between Salt master and minion processes", "4506+");
-
-    @SetFromFlag("publishPort")
-    PortAttributeSensorAndConfigKey PUBLISH_PORT = new PortAttributeSensorAndConfigKey(
-            "salt.publish.port", "Port used by the Salt master publisher", "4505+");
-
-    @SuppressWarnings("serial")
-    AttributeSensor<List<String>> MINION_IDS = new BasicAttributeSensor<List<String>>(new TypeToken<List<String>>() {},
-            "salt.minions", "List of Salt minion IDs");
-
-}

http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/02abbab0/brooklyn-library/sandbox/extra/src/main/java/org/apache/brooklyn/entity/salt/SaltStackMasterDriver.java
----------------------------------------------------------------------
diff --git a/brooklyn-library/sandbox/extra/src/main/java/org/apache/brooklyn/entity/salt/SaltStackMasterDriver.java b/brooklyn-library/sandbox/extra/src/main/java/org/apache/brooklyn/entity/salt/SaltStackMasterDriver.java
deleted file mode 100644
index 09c4db1..0000000
--- a/brooklyn-library/sandbox/extra/src/main/java/org/apache/brooklyn/entity/salt/SaltStackMasterDriver.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.brooklyn.entity.salt;
-
-import org.apache.brooklyn.entity.software.base.SoftwareProcessDriver;
-
-public interface SaltStackMasterDriver extends SoftwareProcessDriver {
-
-}

http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/02abbab0/brooklyn-library/sandbox/extra/src/main/java/org/apache/brooklyn/entity/salt/SaltStackMasterImpl.java
----------------------------------------------------------------------
diff --git a/brooklyn-library/sandbox/extra/src/main/java/org/apache/brooklyn/entity/salt/SaltStackMasterImpl.java b/brooklyn-library/sandbox/extra/src/main/java/org/apache/brooklyn/entity/salt/SaltStackMasterImpl.java
deleted file mode 100644
index 40e38c5..0000000
--- a/brooklyn-library/sandbox/extra/src/main/java/org/apache/brooklyn/entity/salt/SaltStackMasterImpl.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.brooklyn.entity.salt;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.apache.brooklyn.core.feed.ConfigToAttributes;
-import org.apache.brooklyn.entity.software.base.SoftwareProcessImpl;
-
-public class SaltStackMasterImpl extends SoftwareProcessImpl implements SaltStackMaster {
-
-    private static final Logger log = LoggerFactory.getLogger(SaltStackMasterImpl.class);
-
-    public SaltStackMasterImpl() {
-        super();
-    }
-
-    @Override
-    public Class getDriverInterface() {
-        return SaltStackMasterDriver.class;
-    }
-
-    @Override
-    protected void connectSensors() {
-        super.connectSensors();
-
-        // TODO what sensors should we poll?
-        ConfigToAttributes.apply(this);
-
-        connectServiceUpIsRunning();
-    }
-
-    @Override
-    protected void disconnectSensors() {
-        disconnectServiceUpIsRunning();
-
-        super.disconnectSensors();
-    }
-}

http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/02abbab0/brooklyn-library/sandbox/extra/src/main/java/org/apache/brooklyn/entity/salt/SaltStackMasterSshDriver.java
----------------------------------------------------------------------
diff --git a/brooklyn-library/sandbox/extra/src/main/java/org/apache/brooklyn/entity/salt/SaltStackMasterSshDriver.java b/brooklyn-library/sandbox/extra/src/main/java/org/apache/brooklyn/entity/salt/SaltStackMasterSshDriver.java
deleted file mode 100644
index 6010484..0000000
--- a/brooklyn-library/sandbox/extra/src/main/java/org/apache/brooklyn/entity/salt/SaltStackMasterSshDriver.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.brooklyn.entity.salt;
-
-import org.apache.brooklyn.location.ssh.SshMachineLocation;
-import org.apache.brooklyn.core.entity.Entities;
-import org.apache.brooklyn.util.core.task.DynamicTasks;
-
-import org.apache.brooklyn.entity.java.JavaSoftwareProcessSshDriver;
-import org.apache.brooklyn.util.ssh.BashCommands;
-
-import com.google.common.collect.ImmutableMap;
-
-public class SaltStackMasterSshDriver extends JavaSoftwareProcessSshDriver implements SaltStackMasterDriver {
-
-    public SaltStackMasterSshDriver(SaltStackMasterImpl entity, SshMachineLocation machine) {
-        super(entity, machine);
-    }
-
-    @Override
-    public SaltStackMasterImpl getEntity() {
-        return (SaltStackMasterImpl) super.getEntity();
-    }
-
-    @Override
-    protected String getLogFileLocation() {
-        return "master.log";
-    }
-
-    private String getPidFile() {
-        return "master.pid";
-    }
-
-    @Override
-    public void install() {
-        String url = Entities.getRequiredUrlConfig(getEntity(), SaltStackMaster.BOOTSTRAP_URL);
-        copyTemplate(url, "/etc/salt/master");
-
-        // Copy the file contents to the remote machine
-//        DynamicTasks.queue(SshEffectorTasks.put("/tmp/cumulus.yaml").contents(contents)).get();
-
-        // Run Salt bootstrap task to install master
-        DynamicTasks.queue(SaltTasks.installSaltMaster(getEntity(), getRunDir(), true));
-
-
-        newScript("createInstallDir")
-                .body.append("mkdir -p "+getInstallDir())
-                .failOnNonZeroResultCode()
-                .execute();
-
-        newScript(INSTALLING).
-                failOnNonZeroResultCode().
-                body.append("").execute();
-    }
-
-    @Override
-    public void customize() {
-    }
-
-    @Override
-    public void launch() {
-        newScript(ImmutableMap.of("usePidFile", false), LAUNCHING)
-                .body.append(BashCommands.sudo("start salt-master"))
-                .execute();
-    }
-
-    @Override
-    public boolean isRunning() {
-        return newScript(ImmutableMap.of("usePidFile", false), CHECK_RUNNING)
-                .body.append(BashCommands.sudo("status salt-master"))
-                .execute() == 0;
-    }
-
-    @Override
-    public void stop() {
-        newScript(ImmutableMap.of("usePidFile", false), STOPPING)
-                .body.append(BashCommands.sudo("stop salt-master"))
-                .execute();
-    }
-}

http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/02abbab0/brooklyn-library/sandbox/extra/src/main/java/org/apache/brooklyn/entity/salt/SaltTasks.java
----------------------------------------------------------------------
diff --git a/brooklyn-library/sandbox/extra/src/main/java/org/apache/brooklyn/entity/salt/SaltTasks.java b/brooklyn-library/sandbox/extra/src/main/java/org/apache/brooklyn/entity/salt/SaltTasks.java
deleted file mode 100644
index f969b44..0000000
--- a/brooklyn-library/sandbox/extra/src/main/java/org/apache/brooklyn/entity/salt/SaltTasks.java
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.brooklyn.entity.salt;
-
-import static org.apache.brooklyn.util.ssh.BashCommands.INSTALL_CURL;
-import static org.apache.brooklyn.util.ssh.BashCommands.INSTALL_TAR;
-import static org.apache.brooklyn.util.ssh.BashCommands.INSTALL_UNZIP;
-import static org.apache.brooklyn.util.ssh.BashCommands.downloadToStdout;
-import static org.apache.brooklyn.util.ssh.BashCommands.sudo;
-
-import java.util.Map;
-
-import org.apache.brooklyn.api.entity.Entity;
-import org.apache.brooklyn.api.mgmt.TaskFactory;
-import org.apache.brooklyn.core.effector.EffectorTasks;
-import org.apache.brooklyn.core.effector.ssh.SshEffectorTasks;
-import org.apache.brooklyn.core.entity.Entities;
-import org.apache.brooklyn.util.core.ResourceUtils;
-import org.apache.brooklyn.util.core.task.DynamicTasks;
-import org.apache.brooklyn.util.core.task.Tasks;
-import org.apache.brooklyn.util.core.text.TemplateProcessor;
-import org.apache.brooklyn.util.collections.MutableMap;
-import org.apache.brooklyn.util.net.Urls;
-import org.apache.brooklyn.util.ssh.BashCommands;
-
-import com.google.common.annotations.Beta;
-
-@Beta
-public class SaltTasks {
-
-    public static TaskFactory<?> installSaltMaster(Entity master, String saltDirectory, boolean force) {
-        // TODO check on entity whether it is salt _server_
-        String boostrapUrl = master.getConfig(SaltStackMaster.BOOTSTRAP_URL);
-        String version = master.getConfig(SaltStackMaster.SUGGESTED_VERSION);
-        String installCmd = cdAndRun(saltDirectory,
-                BashCommands.chain(
-                        INSTALL_CURL,
-                        INSTALL_TAR,
-                        INSTALL_UNZIP,
-                        "( "+downloadToStdout(boostrapUrl) + " | " + sudo("sh -s -- -M -N "+version)+" )"));
-        if (!force) installCmd = BashCommands.alternatives("which salt-master", installCmd);
-        return SshEffectorTasks.ssh(installCmd).summary("install salt master");
-    }
-
-    public static TaskFactory<?> installSaltMinion(final Entity minion, final String runDir, final String installDir, final boolean force) {
-        return Tasks.<Void>builder().displayName("install minion").body(
-                new Runnable() {
-                    public void run() {
-                        // Setup bootstrap installation command for minion
-                        String boostrapUrl = minion.getConfig(SaltStackMaster.BOOTSTRAP_URL);
-                        String installCmd = cdAndRun(runDir, BashCommands.chain(
-                                INSTALL_CURL,
-                                INSTALL_TAR,
-                                INSTALL_UNZIP,
-                                "( "+downloadToStdout(boostrapUrl) + " | " + sudo("sh")+" )"));
-                        if (!force) installCmd = BashCommands.alternatives("which salt-minion", installCmd);
-
-                        // Process the minion configuration template
-                        Boolean masterless = minion.getConfig(SaltConfig.MASTERLESS_MODE);
-                        String url = masterless ? Entities.getRequiredUrlConfig(minion, SaltConfig.MASTERLESS_CONFIGURATION_URL)
-                                                : Entities.getRequiredUrlConfig(minion, SaltConfig.MINION_CONFIGURATION_URL);
-                        Map<String, Object> config = MutableMap.<String, Object>builder()
-                                .put("entity", minion)
-                                .put("runDir", runDir)
-                                .put("installDir", installDir)
-                                .put("formulas", minion.getConfig(SaltConfig.SALT_FORMULAS))
-                                .build();
-                        String contents = TemplateProcessor.processTemplateContents(new ResourceUtils(minion).getResourceAsString(url), config);
-
-                        // Copy the file contents to the remote machine and install/start salt-minion
-                        DynamicTasks.queue(
-                                SshEffectorTasks.ssh(installCmd),
-                                SshEffectorTasks.put("/tmp/minion")
-                                        .contents(contents)
-                                        .createDirectory(),
-                                SshEffectorTasks.ssh(sudo("mv /tmp/minion /etc/salt/minion")), // TODO clunky
-                                SshEffectorTasks.ssh(sudo("restart salt-minion"))
-                            );
-                    }
-                }).buildFactory();
-    }
-
-    public static TaskFactory<?> installFormulas(final String installDir, final Map<String,String> formulasAndUrls, final boolean force) {
-        return Tasks.<Void>builder().displayName("install formulas").body(
-                new Runnable() {
-                    public void run() {
-                        Entity e = EffectorTasks.findEntity();
-                        if (formulasAndUrls==null)
-                            throw new IllegalStateException("No formulas defined to install at "+e);
-                        for (String formula: formulasAndUrls.keySet())
-                            DynamicTasks.queue(installFormula(installDir, formula, formulasAndUrls.get(formula), force));
-                    }
-                }).buildFactory();
-    }
-
-    public static TaskFactory<?> installFormula(String installDir, String formula, String url, boolean force) {
-        return SshEffectorTasks.ssh(cdAndRun(installDir, SaltBashCommands.downloadAndExpandFormula(url, formula, force)))
-                .summary("install formula "+formula)
-                .requiringExitCodeZero();
-    }
-
-    protected static String cdAndRun(String targetDirectory, String command) {
-        return BashCommands.chain(
-                "mkdir -p "+targetDirectory,
-                "cd "+targetDirectory,
-                command);
-    }
-
-    public static TaskFactory<?> buildSaltFile(String runDir, Iterable<? extends String> runList, Map<String, Object> attributes) {
-        StringBuilder top =  new StringBuilder()
-                .append("base:\n")
-                .append("    '*':\n");
-        for (String run : runList) {
-            top.append("      - " + run + "\n");
-        }
-
-        return SshEffectorTasks.put(Urls.mergePaths(runDir, "base", "top.sls"))
-                .contents(top.toString())
-                .summary("build salt top file")
-                .createDirectory();
-    }
-
-    public static TaskFactory<?> runSalt(String runDir) {
-        return SshEffectorTasks.ssh(cdAndRun(runDir, BashCommands.sudo("salt-call state.highstate")))
-                .summary("run salt install")
-                .requiringExitCodeZero();
-    }
-    
-}

http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/02abbab0/brooklyn-library/sandbox/extra/src/main/resources/org/apache/brooklyn/entity/salt/master
----------------------------------------------------------------------
diff --git a/brooklyn-library/sandbox/extra/src/main/resources/org/apache/brooklyn/entity/salt/master b/brooklyn-library/sandbox/extra/src/main/resources/org/apache/brooklyn/entity/salt/master
deleted file mode 100644
index 72d7eb9..0000000
--- a/brooklyn-library/sandbox/extra/src/main/resources/org/apache/brooklyn/entity/salt/master
+++ /dev/null
@@ -1,65 +0,0 @@
-[#ftl]
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#  http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-# /etc/salt/master
-##
-
-#interface: 0.0.0.0
-#ipv6: False
-#publish_port: ${entity.publishPort,c} # 4505
-
-#user: root
-#max_open_files: 100000
-#worker_threads: 5
-ret_port: ${entity.saltPort,c} # 4506
-
-root_dir: /
-pidfile: ${driver.pidFile}
-pki_dir: ${runDir}/pki
-cachedir: ${runDir}/cache
-log_file: ${driver.logFileLocation}
-key_logfile: ${runDir}/key.log
-
-#verify_env: True
-#keep_jobs: 24
-
-#timeout: 5
-#loop_interval: 60
-
-output: nested
-color: False
-log_level: info
-log_level_logfile: debug # Debugging
-
-#job_cache: True
-#minion_data_cache: True
-
-#open_mode: False
-#auto_accept: False
-#autosign_file: autosign.conf
-#permissive_pki_access: False
-
-fileserver_backend:
-  - git
-
-gitfs_remotes:
-  - git://github.com/saltstack/salt-states.git
-  - git://github.com/saltstack-formulas/postgres-formula.git
-  - ${entity.remoteUrl}
-  # TODO iterate through formula URLs

http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/02abbab0/brooklyn-library/sandbox/extra/src/main/resources/org/apache/brooklyn/entity/salt/masterless
----------------------------------------------------------------------
diff --git a/brooklyn-library/sandbox/extra/src/main/resources/org/apache/brooklyn/entity/salt/masterless b/brooklyn-library/sandbox/extra/src/main/resources/org/apache/brooklyn/entity/salt/masterless
deleted file mode 100644
index ba41c6e..0000000
--- a/brooklyn-library/sandbox/extra/src/main/resources/org/apache/brooklyn/entity/salt/masterless
+++ /dev/null
@@ -1,53 +0,0 @@
-[#ftl]
-##
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#  http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-# SaltStack Masterless Minion Configuration
-#
-# /etc/salt/minion
-##
-
-# Minion configuration
-id: ${entity.id}
-user: root
-backup_mode: minion
-
-# Directory settings
-root_dir: /
-pidfile: ${runDir}/salt-minion.pid
-pki_dir: ${runDir}/pki
-cachedir: ${runDir}/cache
-log_file: ${runDir}/minion.log
-key_logfile: ${runDir}/key.log
-
-file_client: local
-file_roots:
-  base:
-    - ${runDir}/base
-[#list formulas?keys as formulaName]
-    - ${installDir}/${formulaName}
-[/#list]
-
-#verify_env: True
-#cache_jobs: True # Debugging
-
-output: nested
-color: False
-log_level: info
-log_level_logfile: debug # Debugging

http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/02abbab0/brooklyn-library/sandbox/extra/src/main/resources/org/apache/brooklyn/entity/salt/minion
----------------------------------------------------------------------
diff --git a/brooklyn-library/sandbox/extra/src/main/resources/org/apache/brooklyn/entity/salt/minion b/brooklyn-library/sandbox/extra/src/main/resources/org/apache/brooklyn/entity/salt/minion
deleted file mode 100644
index cff42c7..0000000
--- a/brooklyn-library/sandbox/extra/src/main/resources/org/apache/brooklyn/entity/salt/minion
+++ /dev/null
@@ -1,52 +0,0 @@
-[#ftl]
-##
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#  http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-# SaltStack Minion Configuration
-#
-# /etc/salt/minion
-##
-
-# The salt master server
-master: ${entity.master.hostname}
-ipv6: False
-retry_dns: 30
-master_port: ${entity.master.saltPort,c} # 4506
-acceptance_wait_time: 30
-acceptance_wait_time_max: 300
-
-# Minion configuration
-id: ${entity.id}
-user: root
-backup_mode: minion
-
-# Directory settings
-root_dir: /
-pidfile: ${runDir}/salt-minion.pid
-pki_dir: ${runDir}/pki
-cachedir: ${runDir}/cache
-log_file: ${runDir}/minion.log
-key_logfile: ${runDir}/key.log
-
-#verify_env: True
-#cache_jobs: True # Debugging
-
-output: nested
-color: False
-log_level: info
-log_level_logfile: debug # Debugging

http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/02abbab0/brooklyn-library/sandbox/extra/src/test/java/org/apache/brooklyn/entity/database/postgresql/PostgreSqlSaltLiveTest.java
----------------------------------------------------------------------
diff --git a/brooklyn-library/sandbox/extra/src/test/java/org/apache/brooklyn/entity/database/postgresql/PostgreSqlSaltLiveTest.java b/brooklyn-library/sandbox/extra/src/test/java/org/apache/brooklyn/entity/database/postgresql/PostgreSqlSaltLiveTest.java
deleted file mode 100644
index 8dfaaeb..0000000
--- a/brooklyn-library/sandbox/extra/src/test/java/org/apache/brooklyn/entity/database/postgresql/PostgreSqlSaltLiveTest.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.brooklyn.entity.database.postgresql;
-
-import java.util.Random;
-
-import org.apache.brooklyn.api.entity.EntitySpec;
-import org.apache.brooklyn.api.location.PortRange;
-import org.apache.brooklyn.core.effector.EffectorTasks;
-import org.apache.brooklyn.core.effector.ssh.SshEffectorTasks;
-import org.apache.brooklyn.core.entity.Entities;
-import org.apache.brooklyn.core.location.PortRanges;
-import org.apache.brooklyn.util.core.task.system.ProcessTaskWrapper;
-import org.apache.brooklyn.entity.database.postgresql.PostgreSqlNodeSaltImpl;
-import org.apache.brooklyn.entity.salt.SaltConfig;
-import org.apache.brooklyn.entity.salt.SaltLiveTestSupport;
-import org.apache.brooklyn.location.ssh.SshMachineLocation;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.testng.Assert;
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.Test;
-import org.apache.brooklyn.entity.database.VogellaExampleAccess;
-import org.apache.brooklyn.entity.database.postgresql.PostgreSqlIntegrationTest;
-import org.apache.brooklyn.entity.database.postgresql.PostgreSqlNode;
-import org.apache.brooklyn.util.time.Duration;
-
-import com.google.common.collect.ImmutableList;
-
-/**
- * Tests Salt installation of {@link PostgreSqlNode} entity.
- */
-public class PostgreSqlSaltLiveTest extends SaltLiveTestSupport {
-
-    private static final Logger log = LoggerFactory.getLogger(PostgreSqlSaltLiveTest.class);
-
-    private PostgreSqlNode psql;
-
-    @Override
-    @AfterMethod(alwaysRun=true)
-    public void tearDown() throws Exception {
-        try {
-            if (psql != null) psql.stop();
-        } finally {
-            super.tearDown();
-        }
-    }
-
-    @Test(groups="Live")
-    public void testPostgresStartsAndStops() throws Exception {
-        psql = app.createAndManageChild(EntitySpec.create(PostgreSqlNode.class, PostgreSqlNodeSaltImpl.class)
-                .configure(SaltConfig.MASTERLESS_MODE, true));
-
-        app.start(ImmutableList.of(targetLocation));
-
-        Entities.submit(psql, SshEffectorTasks.ssh("ps aux | grep [p]ostgres").requiringExitCodeZero());
-        SshMachineLocation targetMachine = EffectorTasks.getSshMachine(psql);
-
-        psql.stop();
-
-        try {
-            // if host is still contactable ensure postgres is not running
-            ProcessTaskWrapper<Integer> t = Entities.submit(app, SshEffectorTasks.ssh("ps aux | grep [p]ostgres").machine(targetMachine).allowingNonZeroExitCode());
-            t.getTask().blockUntilEnded(Duration.TEN_SECONDS);
-            if (!t.isDone()) {
-                Assert.fail("Task not finished yet: "+t.getTask());
-            }
-            Assert.assertNotEquals(t.get(), (Integer)0, "Task ended with code "+t.get()+"; output: "+t.getStdout() );
-        } catch (Exception e) {
-            // host has been killed, that is fine
-            log.info("Machine "+targetMachine+" destroyed on stop (expected - "+e+")");
-        }
-    }
-
-    @Test(groups="Live")
-    public void testPostgresScriptAndAccess() throws Exception {
-        SaltLiveTestSupport.createLocation(mgmt);
-        PortRange randomPort = PortRanges.fromString(""+(5420+new Random().nextInt(10))+"+");
-        psql = app.createAndManageChild(EntitySpec.create(PostgreSqlNode.class, PostgreSqlNodeSaltImpl.class)
-                .configure(SaltConfig.MASTERLESS_MODE, true)
-                .configure(PostgreSqlNode.CREATION_SCRIPT_CONTENTS, PostgreSqlIntegrationTest.CREATION_SCRIPT)
-                .configure(PostgreSqlNode.POSTGRESQL_PORT, randomPort));
-
-        app.start(ImmutableList.of(targetLocation));
-
-        String url = psql.getAttribute(PostgreSqlNode.DATASTORE_URL);
-        log.info("Trying to connect to "+psql+" at "+url);
-        Assert.assertNotNull(url);
-        Assert.assertTrue(url.contains("542"));
-
-        new VogellaExampleAccess("org.postgresql.Driver", url).readModifyAndRevertDataBase();
-    }
-
-}
-

http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/02abbab0/brooklyn-library/sandbox/extra/src/test/java/org/apache/brooklyn/entity/salt/SaltConfigsTest.java
----------------------------------------------------------------------
diff --git a/brooklyn-library/sandbox/extra/src/test/java/org/apache/brooklyn/entity/salt/SaltConfigsTest.java b/brooklyn-library/sandbox/extra/src/test/java/org/apache/brooklyn/entity/salt/SaltConfigsTest.java
deleted file mode 100644
index 0bbbbcd..0000000
--- a/brooklyn-library/sandbox/extra/src/test/java/org/apache/brooklyn/entity/salt/SaltConfigsTest.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.brooklyn.entity.salt;
-
-import java.util.Map;
-import java.util.Set;
-
-import org.apache.brooklyn.entity.salt.SaltConfig;
-import org.apache.brooklyn.entity.salt.SaltConfigs;
-import org.testng.Assert;
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.Test;
-import org.apache.brooklyn.core.entity.Entities;
-import org.apache.brooklyn.core.entity.factory.ApplicationBuilder;
-import org.apache.brooklyn.core.test.entity.TestApplication;
-
-import com.google.common.collect.ImmutableMap;
-import com.google.common.collect.ImmutableSet;
-
-public class SaltConfigsTest {
-
-    private TestApplication app = null;
-
-    @AfterMethod(alwaysRun=true)
-    public void tearDown() {
-        if (app!=null) Entities.destroyAll(app.getManagementContext());
-        app = null;
-    }
-
-    @Test
-    public void testAddToRunList() {
-        app = ApplicationBuilder.newManagedApp(TestApplication.class);
-        SaltConfigs.addToRunList(app, "a", "b");
-        Set<? extends String> runs = app.getConfig(SaltConfig.SALT_RUN_LIST);
-        Assert.assertEquals(runs, ImmutableSet.of("a", "b"));
-    }
-
-    @Test
-    public void testAddToFormulas() {
-        app = ApplicationBuilder.newManagedApp(TestApplication.class);
-        SaltConfigs.addToFormulas(app, "k1", "v1");
-        SaltConfigs.addToFormulas(app, "k2", "v2");
-        Map<String, String> formulas = app.getConfig(SaltConfig.SALT_FORMULAS);
-        Assert.assertEquals(formulas, ImmutableMap.of("k1", "v1", "k2", "v2"));
-    }
-
-    @Test
-    public void testAddLaunchAttributes() {
-        app = ApplicationBuilder.newManagedApp(TestApplication.class);
-        SaltConfigs.addLaunchAttributes(app, ImmutableMap.of("k1", "v1"));
-        Map<String, Object> attribs = app.getConfig(SaltConfig.SALT_LAUNCH_ATTRIBUTES);
-        Assert.assertEquals(attribs, ImmutableMap.of("k1", "v1"));
-    }
-}

http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/02abbab0/brooklyn-library/sandbox/extra/src/test/java/org/apache/brooklyn/entity/salt/SaltLiveTestSupport.java
----------------------------------------------------------------------
diff --git a/brooklyn-library/sandbox/extra/src/test/java/org/apache/brooklyn/entity/salt/SaltLiveTestSupport.java b/brooklyn-library/sandbox/extra/src/test/java/org/apache/brooklyn/entity/salt/SaltLiveTestSupport.java
deleted file mode 100644
index 13f1b34..0000000
--- a/brooklyn-library/sandbox/extra/src/test/java/org/apache/brooklyn/entity/salt/SaltLiveTestSupport.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.brooklyn.entity.salt;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.testng.annotations.BeforeMethod;
-
-import org.apache.brooklyn.core.test.BrooklynAppLiveTestSupport;
-import org.apache.brooklyn.api.location.Location;
-import org.apache.brooklyn.api.location.MachineProvisioningLocation;
-import org.apache.brooklyn.api.mgmt.ManagementContext;
-import org.apache.brooklyn.location.ssh.SshMachineLocation;
-
-public class SaltLiveTestSupport extends BrooklynAppLiveTestSupport {
-
-    private static final Logger log = LoggerFactory.getLogger(SaltLiveTestSupport.class);
-
-    protected MachineProvisioningLocation<? extends SshMachineLocation> targetLocation;
-
-    @Override
-    @BeforeMethod(alwaysRun=true)
-    public void setUp() throws Exception {
-        super.setUp();
-
-        targetLocation = createLocation();
-    }
-
-    protected MachineProvisioningLocation<? extends SshMachineLocation> createLocation() {
-        return createLocation(mgmt);
-    }
-
-    /**
-     * Convenience for setting up a pre-built or fixed IP machine.
-     * <p>
-     * Useful if you are unable to set up Salt on localhost,
-     * and for ensuring tests against Salt always use the same
-     * configured location.
-     */
-    @SuppressWarnings("unchecked")
-    public static MachineProvisioningLocation<? extends SshMachineLocation> createLocation(ManagementContext mgmt) {
-        Location bestLocation = mgmt.getLocationRegistry().resolveIfPossible("named:SaltTests");
-        if (bestLocation==null) {
-            log.info("using AWS for salt tests because named:SaltTests does not exist");
-            bestLocation = mgmt.getLocationRegistry().resolveIfPossible("jclouds:aws-ec2:us-east-1");
-        }
-        if (bestLocation==null) {
-            throw new IllegalStateException("Need a location called named:SaltTests or AWS configured for these tests");
-        }
-        return (MachineProvisioningLocation<? extends SshMachineLocation>)bestLocation;
-    }
-}


Mime
View raw message