Skip to content

Commit

Permalink
Merge branch 'release-1.2' into development
Browse files Browse the repository at this point in the history
  • Loading branch information
gschueler committed Mar 15, 2011
2 parents e4daadf + 2306db6 commit f743f2d
Show file tree
Hide file tree
Showing 12 changed files with 172 additions and 129 deletions.
37 changes: 25 additions & 12 deletions core/src/java/com/dtolabs/launcher/Preferences.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

import java.io.*;
import java.util.Enumeration;
import java.util.HashSet;
import java.util.Properties;


Expand Down Expand Up @@ -95,29 +96,35 @@ public static void generate(String args[], String preferences, Properties inputP
if(null==jhome) {
jhome = JAVA_HOME;
}
defaultProperties.setProperty("user.java_home", jhome);
defaultProperties.setProperty("java.home", jhome);
defaultProperties.setProperty("rdeck.home", homedir);
defaultProperties.setProperty("rdeck.base", base);
defaultProperties.setProperty("user.java_home", forwardSlashPath(jhome));
defaultProperties.setProperty("java.home", forwardSlashPath(jhome));
defaultProperties.setProperty("rdeck.home", forwardSlashPath(homedir));
defaultProperties.setProperty("rdeck.base", forwardSlashPath(base));

//
// additional properties needed for successful rdeck setup, based on above
// bootstrapping properties
//
defaultProperties.setProperty("framework.projects.dir", Constants.getFrameworkDepotsDir(base));
defaultProperties.setProperty("framework.rdeck.base", base);
defaultProperties.setProperty("framework.projects.dir", forwardSlashPath(Constants.getFrameworkProjectsDir(
base)));
defaultProperties.setProperty("framework.rdeck.base", forwardSlashPath(base));
final String configDir = Constants.getFrameworkConfigDir(base);
defaultProperties.setProperty("framework.etc.dir", configDir);
defaultProperties.setProperty("framework.var.dir", Constants.getBaseVar(base));
defaultProperties.setProperty("framework.logs.dir", Constants.getFrameworkLogsDir(base));
defaultProperties.setProperty("framework.etc.dir", forwardSlashPath(configDir));
defaultProperties.setProperty("framework.var.dir", forwardSlashPath(Constants.getBaseVar(base)));
defaultProperties.setProperty("framework.logs.dir", forwardSlashPath(Constants.getFrameworkLogsDir(base)));

Enumeration propEnum = systemProperties.propertyNames();
//list of path properties to convert slashes on
HashSet<String> paths=new HashSet<String>();
paths.add("user.home");
while (propEnum.hasMoreElements()) {
String propName = (String) propEnum.nextElement();
String propType = propName.split("\\.")[0];
//if (Arrays.binarySearch(PREFS_ALLOWED_PROP_TYPES, propType) > -1) {
defaultProperties.setProperty(propName, systemProperties.getProperty(propName));
//}
String value = systemProperties.getProperty(propName);
if(paths.contains(propName)) {
value = forwardSlashPath(value);
}
defaultProperties.setProperty(propName, value);
}

// load the default properties
Expand Down Expand Up @@ -265,4 +272,10 @@ private static String convert2PropName(String argProp) throws Exception {

}

public static String forwardSlashPath(String input) {
if (System.getProperties().get("file.separator").equals("\\")) {
return input.replaceAll("\\\\", "/");
}
return input;
}
}
8 changes: 4 additions & 4 deletions core/src/java/com/dtolabs/launcher/Setup.java
Original file line number Diff line number Diff line change
Expand Up @@ -434,10 +434,10 @@ public void validate() throws SetupException {
homeDir = baseDir;
}

System.out.println("Using basedir: " + baseDir);
properties.setProperty("rdeck.base", baseDir);
System.out.println("Using homedir: " + homeDir);
properties.setProperty("rdeck.home", homeDir);
System.out.println("Using basedir: " + Preferences.forwardSlashPath(baseDir));
properties.setProperty("rdeck.base", Preferences.forwardSlashPath(baseDir));
System.out.println("Using homedir: " + Preferences.forwardSlashPath(homeDir));
properties.setProperty("rdeck.home", Preferences.forwardSlashPath(homeDir));
properties.setProperty("framework.node.name", nodeArg);
properties.setProperty("framework.node.hostname", nodeHostnameArg);
if (null != serverHostname) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ public static Map<String, String> generateEnvVarsFromContext(final Map<String, M
* @return env var name
*/
public static String generateEnvVarName(final String key) {
return ENV_VAR_PREFIX + key.toUpperCase().replaceAll("\\.", "_");
return ENV_VAR_PREFIX + key.toUpperCase().replaceAll("[^a-zA-Z0-9_]", "_");
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
# ----------------------------------------------------------------

java.home = @user.java_home@
file.separator = @file.separator@
rdeck.base =@rdeck.base@
rdeck.home =@rdeck.home@
user.home =@user.home@
Expand Down Expand Up @@ -85,17 +84,12 @@ framework.rdeck.dir = ${rdeck.home}
#
framework.rdeck.base = @rdeck.base@

#
# Base directory of the installed functional modules
#
framework.modules.dir = @rdeck.base@@file.separator@modules


#
# project spaces containing resources
#
framework.projects.dir= @rdeck.base@@file.separator@projects
framework.depots.dir= @rdeck.base@@file.separator@projects
framework.projects.dir= @rdeck.base@/projects
framework.depots.dir= @rdeck.base@/projects

#
# directory containing instance based property files
Expand All @@ -110,12 +104,12 @@ framework.var.dir= @framework.var.dir@
#
# Framework tmp dir
#
framework.tmp.dir= ${framework.var.dir}@file.separator@tmp
framework.tmp.dir= ${framework.var.dir}/tmp

#
# Base directory where logs are kept
#
framework.logs.dir=${framework.var.dir}@file.separator@logs
framework.logs.dir=${framework.var.dir}/logs

#
# Date/time stamp format used in logs. See java.text.SimpleDateFormat
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@
#
# The base directory for this project's instances
#
project.dir = @rdeck.base@@file.separator@projects@file.separator@${project.name}
project.dir = @rdeck.base@/projects/${project.name}
#
# The base directory of project specific configuration files
#
project.etc.dir = @rdeck.base@@file.separator@projects@file.separator@${project.name}@file.separator@etc
project.etc.dir = @rdeck.base@/projects/${project.name}/etc

#
# The resources registration file
#
project.resources.file = @rdeck.base@@file.separator@projects@file.separator@${project.name}@file.separator@etc@file.separator@resources.xml
project.resources.file = @rdeck.base@/projects/${project.name}/etc/resources.xml

#
# The project description
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ framework.server.port = 4440
framework.rundeck.url = http://${framework.server.hostname}:${framework.server.port}/rundeck
#
#######indirectly set (from required opts) cannot be overridden########
framework.projects.dir = ${rdeck.base}${file.separator}projects
framework.projects.dir = ${rdeck.base}/projects
framework.rdeck.base = ${rdeck.base}
framework.metadata.rootDir = ${rdeck.base}${file.separator}projects
framework.etc.dir = ${rdeck.base}${file.separator}etc
framework.var.dir = ${rdeck.base}${file.separator}var
framework.logs.dir=${framework.var.dir}${file.separator}logs
framework.src.dir = ${rdeck.base}${file.separator}src
framework.metadata.rootDir = ${rdeck.base}/projects
framework.etc.dir = ${rdeck.base}/etc
framework.var.dir = ${rdeck.base}/var
framework.logs.dir=${framework.var.dir}/logs
framework.src.dir = ${rdeck.base}/src
framework.nodes.file.name = resources.xml

######framework.properties defaults#####
Expand Down
23 changes: 15 additions & 8 deletions docs/en/02-basics/02-chapter1.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,21 +183,22 @@ a verbose listing that includes more detail:
$ dispatch -p examples -v
strongbad:
hostname: strongbad
os-arch: x86_64
os-family: unix
os-name: Mac OS X
os-version: 10.6.2
tags: []
osArch: x86_64
osFamily: unix
osName: Mac OS X
osVersion: 10.6.2
tags: ''
---- Attributes ----

Node resources have standard properties, such as "hostname" but these
can be extended via attributes. One of the more useful properties
is the "tags" property. A *tag* is a text label that you give to the
Node, perhaps denoting a classification, a role the node plays in the
environment, or group membership.
environment, or group membership. Multiple tags can be defined for
a given node.

The output above shows the "strongbad" node currently has an empty
tags property: `tags: []`.
tags property: `tags: ''`.

It is important to start thinking about node tagging for the nodes you manage
because you will use them later when specifying filtering
Expand Down Expand Up @@ -238,6 +239,10 @@ You'll notice the root node is called `project` and there is a single
node descriptor for "strongbad". The `node` tag has a number of
required and optional attributes. Additional node descriptors can be
added by defining new `node` elements inside the `project` tag.

The strongbad host does not have any tags defined for it. One or
more tags can be defined. Use comma for the delimiter (e.g, `tags="tag1,tag2"`).

Here's an example of a node called "homestar" with just the required
attributes:

Expand All @@ -247,7 +252,9 @@ attributes:

The `hostname` and `username` values are used for the SSH connection
while the `name` and `type` are used to define Node identity in the
resource model.
resource model. It is possible to overload the hostname value to include
port information (eg, hostname="somehost:2022").
This is useful if your run SSH on a different port.

Chances are you maintain information about your hosts within
another tool, perhaps Chef, Puppet, Nagios, Amazon EC2, RightScale or
Expand Down
7 changes: 4 additions & 3 deletions docs/en/07-administration/07-chapter1.md
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ the remote hosts.
ssh commands to the client machines.
* SSH is assumed to be installed and configured appropriately to allow
this access.
* No passphrase should be set.
* SSH should not prompt for a password. There are many resources
available on how to configure ssh to use public key authentication
instead of passwords such as:
Expand All @@ -235,8 +236,8 @@ or

### SSH key generation

* By default, the RunDeck installation is configured to use RSA _not_ DSA
type keys (however, it can be configured to use DSA, if required).
* The RunDeck installation can be configured to use RSA _or_ DSA
type keys.

Here's an example of SSH RSA key generation on a Linux system:

Expand Down Expand Up @@ -271,7 +272,7 @@ Follow the steps given below to enable ssh to remote machines.

The ssh public key should be copied to the `authorized_keys` file of
the remote machine. The public key will be available in
`~/etc/id_rsa.pub` file.
`~/.ssh/id_rsa.pub` file.

The `authorized_keys` file should be created in the `.ssh` directory of
the remote machine.
Expand Down

0 comments on commit f743f2d

Please sign in to comment.