We've done something like this already in WHIRR-517 for 0.7.1 (hotfix release). We need to do the same for trunk but also refactor the code to avoid code duplication.
CDH4 can be installed on Ubuntu now as well as CentOS
OpenJDK JAVA_HOME detection needs to be improved
Add a retry loop around apt-get and yum commands to overcome transient errors