Description
Adrian posted on jclouds-dev@ an improvement to the template selection mechanism:
"For those of you using aws-ec2, here's a handy template expression
that will match the latest stable image from canonical. I've placed
comments where explanation is likely necessary.
Template template = context.getComputeService().templateBuilder()
// need to select versions with double-digits so that lexicographic
// doesn't end up prefering 9.x vs 11.x
.osVersionMatches("1[012].[10][04]")
// negative lookahead for daily and testing, but ensure match
// ubuntu-images
// http://www.regular-expressions.info/lookaround.html
.imageDescriptionMatches("^(?!.(daily|testing)).*ubuntu-images.$")
.osFamily(OsFamily.UBUNTU).build();
Hope this helps!"