Hi Andrea.
Thank you for this, I think it is a really great addition to have a fully
portable YAML blueprint so I definitely +1 this!
Regarding the implementation, I assume this will internally call
the `BashCommands.installExecutable()` ? In that case, I would keep it
simple and not bother about specifying the package name per tool, as the
previously mentioned method handles it properly. So:
```
$brooklyn:installPackage("openjdk-1.8.0", "java-1.8.0-openjdk-devel",
"java-1.8.0")
```
My £0.02 :)
Best.
On Tue, 3 May 2016 at 11:24 Andrea Turli <[email protected]>
wrote:
> hi,
>
> I’ve been thinking about an utility to simplify the YAML blueprint
> creation: from my experience when using VanillaSoftwareProcess is annoying
> to write a portable script just to install a package (say, java) valid for
> apt, yum, etc so I usually write it (multiple times) just for an OS.
>
> To increase the portability of the YAML blueprint I’d like to suggest we
> extend the brooklyn DSL with something like:
> ```
> $brooklyn.installPackage(“curl”)
> $brooklyn:installPackage({"apt", "openjdk-1.8.0", "yum",
> "java-1.8.0-openjdk-devel"}, "java-1.8.0")
> ```
> instead of things like
> ```
> which curl || \
> { sudo apt-get update && sudo apt-get install curl ; } || \
> { sudo yum update && sudo yum install curl ; } || \
> { echo WARNING: cannot install curl && exit 1 ; }
> ```
> I’m not entirely sure this feature fits well on the DSL.
>
> Alternatively, we could add a configKey to VanillaSoftwareProcess called
> requiredPackages for a more declarative approach (@googlielmo's idea)
>
> Wdyt?
>
--
Thomas Bouron • Software Engineer @ Cloudsoft Corporation •
http://www.cloudsoftcorp.com/
Github: https://github.com/tbouron
Twitter: https://twitter.com/eltibouron