[GitHub] brooklyn-server issue #681: Flag allowing a Winrm4jTool to use unique contex...

2017-05-15 Thread aledsage
Github user aledsage commented on the issue:

https://github.com/apache/brooklyn-server/pull/681
  
LGTM (though I'v just read the code rather than testing it).

Note that in `SshMachineLocation`, it caches the sessions and reuses them 
only if a given set of config keys are identical (e.g. usename, password, etc).

I'm not suggesting you change this code to do that, but it's something 
worth bearing in mind.

@neykov any more comments/concerns before we merge this?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] brooklyn-server pull request #680: Adds JcloudsLocationCustomizer hook to al...

2017-05-15 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/brooklyn-server/pull/680


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] brooklyn-server issue #680: Adds JcloudsLocationCustomizer hook to allow nod...

2017-05-15 Thread aledsage
Github user aledsage commented on the issue:

https://github.com/apache/brooklyn-server/pull/680
  
LGTM; merging


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


Re: thoughts on Brooklyn docs

2017-05-15 Thread mohan kumar Muddana
This was very high level when I created this when I was in Atos. Let me
know if this is of any help. I know the architecture has changed a bit
after that but basic flow remains the same.
Feel free to copy or let me know how to improve on that.



*https://github.com/mohanjune/brooklynlearnings/tree/master/docs
*
Thanks and regards
Mohan


On Thu, May 11, 2017 at 12:21 AM, Geoff Macartney <
geoff.macart...@cloudsoftcorp.com> wrote:

> Was just chatting about docs with some colleagues and remembered this from
> Richard, which I thought was a great outline for what the docs should look
> like.
>
> How about we make a start on reworking what's there with this as an initial
> guide to the endpoint,  and see how it goes?
>
> On Fri, 21 Apr 2017, 21:44 Richard Downer,  wrote:
>
> > Hi,
> >
> > Yes there are some big improvements possible in this area.
> >
> > As someone who has taken a bit of a back seat in using Apache Brooklyn
> for
> > a while and has recently restarted actively developing blueprints, I've
> > found that Brooklyn's features in this area have much improved over the
> > last year or two, but the documentation has failed to keep up - many
> great
> > features available to blueprint writers are either documented too briefly
> > or in an illogical location, or not documented at all.
> >
> > I have been thinking that if I was to use my Copious Free Time to write a
> > book about creating blueprints for Apache Brooklyn, it's table of
> contents
> > would look something like this:
> >
> > Basic Ingredients
> > - A simple server example
> > - What the machine looks like
> > - The software process lifecycle
> > - Installing files
> > - Sensors
> > - Enrichers
> > - Effectors
> > Combining Parts
> > - Multiple entities in one blueprint
> > - References between entities
> > - Latches
> > - Child entities
> > - Putting multiple entities on one server
> > Catalog: the blueprint database
> > - What is the catalog?
> > - Looking inside the catalog
> > - A simple blueprint into the catalog
> > - Versions and updates
> > - Parameters and configuration
> > - Bundling resources with blueprints
> > - A comprehensive example
> > The Apache Brooklyn Blueprint Toolkit
> > - Clusters
> > - Java-based apps
> > - [more standard Java entities]
> > Policies for Active, Automated Management
> > - Introduction to policies with the Service Restarter policy
> > - [more policies]
> > Blueprints for Microsoft Windows Server
> > - [tbc]
> > Writing Blueprints in Java
> > - Depending on Apache Brooklyn: Maven
> > - A simple Java blueprint
> > - OSGI for versioning and dependency management
> > - Enrichers
> > - Policies
> > Reference
> > - Blueprint YAML
> > - Apache Brooklyn DSL
> > - Common ConfigKeys
> > - Common Sensors
> > - FreeMarker Template
> >
> > There would also be a separate manual covering the operational side of
> > Brooklyn: installing and configuring, persistence and HA, configuring
> > locations, managing the catalog, etc.. Then possibly a final user manual,
> > which would probably be quite slim: just about how to use the UI and `br`
> > client to work with blueprints already in the catalog, and examining
> > running apps.
> >
> > My 2c.
> >
> > Richard.
> >
> >
> > On 21 Apr 2017 17:36, "Geoff Macartney"  cloudsoftcorp.com
> > >
> > wrote:
> >
> > > hi all,
> > >
> > > Was just thinking some more about our docs, prompted by Thomas's great
> > work
> > > on the redesign of the front page.
> > >
> > > The update front page will be great, but I think it will still leave us
> > > with work to do on the overall structure and coverage of the docs in
> > total.
> > > It feels to me like there are two things we need to do:
> > >
> > > - improve the structure, for clarity, and
> > > - fill in the main gap in the docs, namely the reference-level detail
> on
> > > each and every part of Brooklyn
> > >
> > > We need to think carefully about what we want in the docs and the
> > intended
> > > audience.
> > >
> > > I think we maybe need a clearer separation between 'users' (people
> whose
> > > interest is the apps), 'admins' who have
> > > to manage Brooklyn, and 'developers' who'll work with the code.
> > >
> > > Not sure how it should be structured but maybe something like:
> > >
> > > 1. Learn more - 1 page overview of Brooklyn including example blueprint
> > and
> > > a description of the lifecycle of deploying it
> > > 2. Getting started - how to get and run Brooklyn and deploy an app
> > > 3. User Guide
> > > - tutorials in more detail than getting started (cover DSL & wiring,
> > > clusters...)
> > > - plus explanations of all main aspects - some overlap with 'Reference'
> > > (see below) but more a how-to guide than a comprehensive reference.
> > > 4. Admin Guide
> > > 5. Developer Guide
> > > 6. Blueprint reference - comprehensive listing of all syntax and
> > semantics
> > > of blueprints: including:
> > > 

[GitHub] brooklyn-server pull request #681: Flag allowing a Winrm4jTool to use unique...

2017-05-15 Thread bostko
GitHub user bostko opened a pull request:

https://github.com/apache/brooklyn-server/pull/681

Flag allowing a Winrm4jTool to use unique context

Fixes https://github.com/cloudsoft/winrm4j/issues/63

To test add in location configuration:

brooklyn.winrm.config.use.unique.context: true

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/bostko/brooklyn-server winrm-wrong

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/brooklyn-server/pull/681.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #681


commit 087ac7b4e0079107135e42d402213031437b3b29
Author: Valentin Aitken 
Date:   2017-05-15T17:23:38Z

Flag allowing a Winrm4jTool to use uniq context each time

Fixes https://github.com/cloudsoft/winrm4j/issues/63




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] brooklyn-server pull request #680: Adds JcloudsLocationCustomizer hook to al...

2017-05-15 Thread nakomis
Github user nakomis commented on a diff in the pull request:

https://github.com/apache/brooklyn-server/pull/680#discussion_r116485510
  
--- Diff: 
locations/jclouds/src/test/java/org/apache/brooklyn/location/jclouds/JcloudsSshMachineLocationStubbedTest.java
 ---
@@ -118,4 +123,17 @@ public void testWinrmConfigPassedToMachine() throws 
Exception {
 
assertEquals(machine.config().get(WinRmMachineLocation.COPY_FILE_CHUNK_SIZE_BYTES),
 Integer.valueOf(123));
 assertEquals(machine.config().get(WinRmTool.PROP_EXEC_TRIES), 
Integer.valueOf(456));
 }
+
+@Test
+public void testNodeSetupCustomizer() throws Exception {
+final String testMetadata = "test-metadata";
+obtainMachine(ImmutableMap.of(JCLOUDS_LOCATION_CUSTOMIZERS, 
ImmutableList.of(new BasicJcloudsLocationCustomizer(){
+@Override
+public void customize(JcloudsLocation location, NodeMetadata 
node, ConfigBag setup) {
+setup.configure(ADDITIONAL_CONNECTION_METADATA, 
testMetadata);
--- End diff --

I've added a null check for `location`, but I'm not sure what else to 
assert on it


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] brooklyn-server pull request #680: Adds JcloudsLocationCustomizer hook to al...

2017-05-15 Thread aledsage
Github user aledsage commented on a diff in the pull request:

https://github.com/apache/brooklyn-server/pull/680#discussion_r116472840
  
--- Diff: 
core/src/main/java/org/apache/brooklyn/util/core/internal/ssh/SshTool.java ---
@@ -86,6 +86,8 @@
 public static final ConfigKey PROP_LAST_MODIFICATION_DATE = 
newConfigKey("lastModificationDate", "Last-modification-date to be set on files 
copied/created (should be UTC/1000, ie seconds since 1970; default 0 usually 
means current)", 0L);
 public static final ConfigKey PROP_LAST_ACCESS_DATE = 
newConfigKey("lastAccessDate", "Last-access-date to be set on files 
copied/created (should be UTC/1000, ie seconds since 1970; default 0 usually 
means lastModificationDate)", 0L);
 public static final ConfigKey PROP_OWNER_UID = 
newConfigKey("ownerUid", "Default owner UID (not username) for files created on 
remote machine; default is unset", -1);
+
+ConfigKey ADDITIONAL_CONNECTION_METADATA = 
newStringConfigKey("additional.connection.metadata", "Can be used by a location 
customizer during provisioning to provide additional information, which in turn 
can be consumed by a custom ssh tool");
--- End diff --

Split onto multiple lines.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] brooklyn-server pull request #680: Adds JcloudsLocationCustomizer hook to al...

2017-05-15 Thread aledsage
Github user aledsage commented on a diff in the pull request:

https://github.com/apache/brooklyn-server/pull/680#discussion_r116472348
  
--- Diff: 
locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/JcloudsLocation.java
 ---
@@ -751,6 +751,10 @@ protected MachineLocation obtainOnce(ConfigBag setup) 
throws NoMachinesAvailable
 machineCreationSemaphore.release();
 }
 
+for (JcloudsLocationCustomizer customizer : customizers) {
+customizer.customize(this, node, setup);
--- End diff --

I'd move this to just after the `if (null == null)` check.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] brooklyn-server pull request #680: Adds JcloudsLocationCustomizer hook to al...

2017-05-15 Thread aledsage
Github user aledsage commented on a diff in the pull request:

https://github.com/apache/brooklyn-server/pull/680#discussion_r116472751
  
--- Diff: 
software/winrm/src/main/java/org/apache/brooklyn/util/core/internal/winrm/WinRmTool.java
 ---
@@ -86,6 +86,8 @@
 "Size of file chunks (in bytes) to be used when copying a file 
to the remote server", 
 1024);
 
+ConfigKey ADDITIONAL_CONNECTION_METADATA = 
newStringConfigKey("additional.connection.metadata", "Can be used by a location 
customizer during provisioning to provide additional information, which in turn 
can be consumed by a custom ssh tool");
--- End diff --

Personal preference for splitting onto multiple lines when it's this 
crazy-long a line. Otherwise, it's hard to tell if there's a default value or 
anything like that lurking at the very end. I'd go for one line per arg.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] brooklyn-server pull request #680: Adds JcloudsLocationCustomizer hook to al...

2017-05-15 Thread aledsage
Github user aledsage commented on a diff in the pull request:

https://github.com/apache/brooklyn-server/pull/680#discussion_r116472215
  
--- Diff: 
locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/JcloudsLocation.java
 ---
@@ -751,6 +751,10 @@ protected MachineLocation obtainOnce(ConfigBag setup) 
throws NoMachinesAvailable
 machineCreationSemaphore.release();
 }
 
+for (JcloudsLocationCustomizer customizer : customizers) {
+customizer.customize(this, node, setup);
--- End diff --

Looks like this should be moved down slightly - we don't set `node` until 
just after this, so we'll always be passing `null` to the customizer.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] brooklyn-server pull request #680: Adds JcloudsLocationCustomizer hook to al...

2017-05-15 Thread aledsage
Github user aledsage commented on a diff in the pull request:

https://github.com/apache/brooklyn-server/pull/680#discussion_r116472841
  
--- Diff: 
software/winrm/src/main/java/org/apache/brooklyn/util/core/internal/winrm/WinRmTool.java
 ---
@@ -86,6 +86,8 @@
 "Size of file chunks (in bytes) to be used when copying a file 
to the remote server", 
 1024);
 
+ConfigKey ADDITIONAL_CONNECTION_METADATA = 
newStringConfigKey("additional.connection.metadata", "Can be used by a location 
customizer during provisioning to provide additional information, which in turn 
can be consumed by a custom ssh tool");
--- End diff --

Says "custom ssh tool".


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] brooklyn-server pull request #680: Adds JcloudsLocationCustomizer hook to al...

2017-05-15 Thread aledsage
Github user aledsage commented on a diff in the pull request:

https://github.com/apache/brooklyn-server/pull/680#discussion_r116473296
  
--- Diff: 
software/winrm/src/main/java/org/apache/brooklyn/util/core/internal/winrm/WinRmTool.java
 ---
@@ -86,6 +86,8 @@
 "Size of file chunks (in bytes) to be used when copying a file 
to the remote server", 
 1024);
 
+ConfigKey ADDITIONAL_CONNECTION_METADATA = 
newStringConfigKey("additional.connection.metadata", "Can be used by a location 
customizer during provisioning to provide additional information, which in turn 
can be consumed by a custom ssh tool");
--- End diff --

Perhaps word as something like "Can be used to pass additional custom data 
to the `WinrmTool`, which is especially useful if writing a bespoke tool 
implementation."

Your description is accurate for your use-case, but really it's not 
specific to the customizer - it could be passed in as normal location config or 
entity `provisioning.properties`.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] brooklyn-server pull request #680: Adds JcloudsLocationCustomizer hook to al...

2017-05-15 Thread aledsage
Github user aledsage commented on a diff in the pull request:

https://github.com/apache/brooklyn-server/pull/680#discussion_r116472546
  
--- Diff: 
locations/jclouds/src/test/java/org/apache/brooklyn/location/jclouds/JcloudsSshMachineLocationStubbedTest.java
 ---
@@ -118,4 +123,17 @@ public void testWinrmConfigPassedToMachine() throws 
Exception {
 
assertEquals(machine.config().get(WinRmMachineLocation.COPY_FILE_CHUNK_SIZE_BYTES),
 Integer.valueOf(123));
 assertEquals(machine.config().get(WinRmTool.PROP_EXEC_TRIES), 
Integer.valueOf(456));
 }
+
+@Test
+public void testNodeSetupCustomizer() throws Exception {
+final String testMetadata = "test-metadata";
+obtainMachine(ImmutableMap.of(JCLOUDS_LOCATION_CUSTOMIZERS, 
ImmutableList.of(new BasicJcloudsLocationCustomizer(){
+@Override
+public void customize(JcloudsLocation location, NodeMetadata 
node, ConfigBag setup) {
+setup.configure(ADDITIONAL_CONNECTION_METADATA, 
testMetadata);
--- End diff --

Let's also assert that `node` is not null (given it will be, based on the 
bug I spotted (I believe)).
And might as well also assert that `location` is equal to the object we 
expect.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] brooklyn-docs issue #182: Enforce the use of `brooklyn.config` in yaml examp...

2017-05-15 Thread tbouron
Github user tbouron commented on the issue:

https://github.com/apache/brooklyn-docs/pull/182
  
Doing (1) and (2) sounds good, I'll revert the real names by flags when 
it's too long/complicated.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] brooklyn-server issue #680: Adds JcloudsLocationCustomizer hook to allow nod...

2017-05-15 Thread nakomis
Github user nakomis commented on the issue:

https://github.com/apache/brooklyn-server/pull/680
  
@bostko If declared in the YAML, then the property must be known *before* 
the machine is provisioned. The hook allows for a customizer to configure the 
ssh / winrm config tool with runtime data such as the machine id


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] brooklyn-docs issue #182: Enforce the use of `brooklyn.config` in yaml examp...

2017-05-15 Thread aledsage
Github user aledsage commented on the issue:

https://github.com/apache/brooklyn-docs/pull/182
  
At the risk of making more work for us @tbouron, perhaps we should split 
this PR into three parts (where 1 and 2 could be done together):
1. change example structure to be consistent (e.g. always using 
`brooklyn.config`).
2. change examples that use a bad-looking alias, where the alternative 
"real name" would make that particular example look cleaner/simpler.
3. after we support deprecation and we've changed each name to be the 
"best" name, we update the examples to use those authoritative names.

What I want to avoid is us temporarily changing the docs such that the 
examples look more complicated, in ways that we end up changing back again in 
not very long.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] brooklyn-server issue #680: Adds JcloudsLocationCustomizer hook to allow nod...

2017-05-15 Thread bostko
Github user bostko commented on the issue:

https://github.com/apache/brooklyn-server/pull/680
  
You can assign any ssh config using 
```
provisioning.properties:
  brooklyn.ssh.config.additionalSshConfig: myValue
```




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] brooklyn-docs issue #182: Enforce the use of `brooklyn.config` in yaml examp...

2017-05-15 Thread aledsage
Github user aledsage commented on the issue:

https://github.com/apache/brooklyn-docs/pull/182
  
@tbouron I agree in principle with this change, however I have a big 
reservation about doing this now.

First, my agreements:
* We should be consistent in our examples and in what we support. We should 
always use `brooklyn.config` (or if not, then we should have a separate 
proposal to never use it).
* We should have one authoritative name for the each config key, and always 
use that in our examples. We should deprecate the other aliases.

Now for my disagreement... Once we have support for deprecating config key 
names, we should carefully decide which name we want to be the authoritative 
name (is the the current "real" name, or is the alias actually a better name; 
or is there a new name we should change it to that is more consistent with the 
rest of Brooklyn!)

Therefore I worry that this PR will change our examples, and then we'll 
change some of those back again when we figure out what the best names are. As 
an example, the `AutoScalerPolicy`'s config key should be `metric` rather than 
`autoscaler.metric` - i.e. the name used in the alias should be switched to be 
the authoritative name. Having the prefix "autoscaler" is just needless 
repetition.

What makes the long-term choice of naming a bit tricky is our support for 
runtime-management config inheritance, i.e. inheriting config keys from a 
parent entity (*). Where a user does that, we want to reduce the risk of name 
collisions. But frankly I think we want to discourage it!

(*) Our current behaviour is horrible - a config value that uses the alias 
is not picked up the child entities, but a config key that uses the "real name" 
is picked up. However, users find it extremely hard to tell the difference 
between "real name" and "alias" when they're looking at examples, so invariably 
find this behaviour baffling.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] brooklyn-server pull request #680: Adds JcloudsLocationCustomizer hook to al...

2017-05-15 Thread nakomis
GitHub user nakomis opened a pull request:

https://github.com/apache/brooklyn-server/pull/680

Adds JcloudsLocationCustomizer hook to allow node / config configuration



You can merge this pull request into a Git repository by running:

$ git pull https://github.com/nakomis/brooklyn-server 
add-nodemetdata-customization-hook

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/brooklyn-server/pull/680.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #680


commit 320c29e06dca6c2e99cc79a8b373ba1f914a8a3d
Author: Martin Harris 
Date:   2017-05-15T09:34:32Z

Adds JcloudsLocationCustomizer hook to allow node / config configuration




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[jira] [Updated] (BROOKLYN-503) Shell.env should work with SaltEntity

2017-05-15 Thread Andres Garcia Garcia (JIRA)

 [ 
https://issues.apache.org/jira/browse/BROOKLYN-503?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Andres Garcia Garcia updated BROOKLYN-503:
--
Description: 
I am using Brooklyn to deploy servers configured with Salt.

I am trying to deploy one VM with a web server and another with MySQL, and link 
them together using env variables in the salt pillars.

Based on the sample templates, this is my yaml.

name: Salt LAMP deployment (Brooklyn Example)

{code}
services:
- id: mysql
  name: mysql
  type: org.apache.brooklyn.entity.cm.salt.SaltEntity
  formulas:
  - https://github.com/saltstack-formulas/mysql-formula/archive/master.tar.gz
  start_states:
  - mysql
  pillars:
  - mysql
  pillarUrls:
  - ftp://xxx/wordpress-example.tar
- id: wordpress
  name: wordpress
  type: org.apache.brooklyn.entity.cm.salt.SaltEntity
  formulas:
  - https://github.com/saltstack-formulas/php-formula/archive/master.tar.gz
  - 
https://github.com/saltstack-formulas/wordpress-formula/archive/master.tar.gz
  - https://github.com/saltstack-formulas/apache-formula/archive/master.tar.gz
  - https://github.com/saltstack-formulas/mysql-formula/archive/master.tar.gz
  start_states:
  - mysql.client
  - php.ng
  - php.ng.mysql
  - wordpress
  - apache
  - apache.config
  - apache.vhosts.standard
  pillars:
  - php
  - wordpress
  - apache
  - mysql
  pillarUrls:
  - ftp://xxx/filezilla.tar
  brooklyn.config:
shell.env:
  MYSQL_URL: $brooklyn:entity("mysql").attributeWhenReady("host.name")

location:
  jclouds:aws-ec2:
identity: xxx
credential:   xxx
region:   us-west-2
inboundPorts:
  - 22
  - 80
  - 3306
hardwareId:   t2.small
{code}


And then, inside the pillars, I configure them as follows

{code}
wordpress:
sites:
username: xxx
password: xxx
database: xxx
dbhost: {{ salt['environ.get']('MYSQL_URL') }}
{code}

However, the MYSQL_URL env variable is resolved to none.

I got word from svet in the IRC channel that SaltEntity doesn't support 
shell.env. I think it would be really helpful to make this option available in 
order to configure multinode deployments with Salt.

  was:
I am using Brooklyn to deploy servers configured with Salt.

I am trying to deploy one VM with a web server and another with MySQL, and link 
them together using env variables in the salt pillars.

Based on the sample templates, this is my yaml.

name: Salt LAMP deployment (Brooklyn Example)

services:
- id: mysql
  name: mysql
  type: org.apache.brooklyn.entity.cm.salt.SaltEntity
  formulas:
  - https://github.com/saltstack-formulas/mysql-formula/archive/master.tar.gz
  start_states:
  - mysql
  pillars:
  - mysql
  pillarUrls:
  - ftp://xxx/wordpress-example.tar
- id: wordpress
  name: wordpress
  type: org.apache.brooklyn.entity.cm.salt.SaltEntity
  formulas:
  - https://github.com/saltstack-formulas/php-formula/archive/master.tar.gz
  - 
https://github.com/saltstack-formulas/wordpress-formula/archive/master.tar.gz
  - https://github.com/saltstack-formulas/apache-formula/archive/master.tar.gz
  - https://github.com/saltstack-formulas/mysql-formula/archive/master.tar.gz
  start_states:
  - mysql.client
  - php.ng
  - php.ng.mysql
  - wordpress
  - apache
  - apache.config
  - apache.vhosts.standard
  pillars:
  - php
  - wordpress
  - apache
  - mysql
  pillarUrls:
  - ftp://xxx/filezilla.tar
  brooklyn.config:
shell.env:
  MYSQL_URL: $brooklyn:entity("mysql").attributeWhenReady("host.name")

location:
  jclouds:aws-ec2:
identity: xxx
credential:   xxx
region:   us-west-2
inboundPorts:
  - 22
  - 80
  - 3306
hardwareId:   t2.small



And then, inside the pillars, I configure them as follows

wordpress:
sites:
username: xxx
password: xxx
database: xxx
dbhost: {{ salt['environ.get']('MYSQL_URL') }}

However, the MYSQL_URL env variable is resolved to none.

I got word from svet in the IRC channel that SaltEntity doesn't support 
shell.env. I think it would be really helpful to make this option available in 
order to configure multinode deployments with Salt.


> Shell.env should work with SaltEntity
> -
>
> Key: BROOKLYN-503
> URL: https://issues.apache.org/jira/browse/BROOKLYN-503
> Project: Brooklyn
>  Issue Type: Improvement
>Affects Versions: 0.10.0
> Environment: Ubuntu 14.04
>Reporter: Andres Garcia Garcia
>  Labels: env, salted
>
> I am using Brooklyn to deploy servers configured with Salt.
> I am trying to deploy one VM with a web server and another with MySQL, and 
> link them together using env variables in the salt pillars.
> Based on the sample templates, this is my yaml.
> name: Salt LAMP deployment (Brooklyn Example)
> {code}
> services:
> - id: mysql
>   

[jira] [Created] (BROOKLYN-503) Shell.env should work with SaltEntity

2017-05-15 Thread Andres Garcia Garcia (JIRA)
Andres Garcia Garcia created BROOKLYN-503:
-

 Summary: Shell.env should work with SaltEntity
 Key: BROOKLYN-503
 URL: https://issues.apache.org/jira/browse/BROOKLYN-503
 Project: Brooklyn
  Issue Type: Improvement
Affects Versions: 0.10.0
 Environment: Ubuntu 14.04
Reporter: Andres Garcia Garcia


I am using Brooklyn to deploy servers configured with Salt.

I am trying to deploy one VM with a web server and another with MySQL, and link 
them together using env variables in the salt pillars.

Based on the sample templates, this is my yaml.

name: Salt LAMP deployment (Brooklyn Example)

services:
- id: mysql
  name: mysql
  type: org.apache.brooklyn.entity.cm.salt.SaltEntity
  formulas:
  - https://github.com/saltstack-formulas/mysql-formula/archive/master.tar.gz
  start_states:
  - mysql
  pillars:
  - mysql
  pillarUrls:
  - ftp://xxx/wordpress-example.tar
- id: wordpress
  name: wordpress
  type: org.apache.brooklyn.entity.cm.salt.SaltEntity
  formulas:
  - https://github.com/saltstack-formulas/php-formula/archive/master.tar.gz
  - 
https://github.com/saltstack-formulas/wordpress-formula/archive/master.tar.gz
  - https://github.com/saltstack-formulas/apache-formula/archive/master.tar.gz
  - https://github.com/saltstack-formulas/mysql-formula/archive/master.tar.gz
  start_states:
  - mysql.client
  - php.ng
  - php.ng.mysql
  - wordpress
  - apache
  - apache.config
  - apache.vhosts.standard
  pillars:
  - php
  - wordpress
  - apache
  - mysql
  pillarUrls:
  - ftp://xxx/filezilla.tar
  brooklyn.config:
shell.env:
  MYSQL_URL: $brooklyn:entity("mysql").attributeWhenReady("host.name")

location:
  jclouds:aws-ec2:
identity: xxx
credential:   xxx
region:   us-west-2
inboundPorts:
  - 22
  - 80
  - 3306
hardwareId:   t2.small



And then, inside the pillars, I configure them as follows

wordpress:
sites:
username: xxx
password: xxx
database: xxx
dbhost: {{ salt['environ.get']('MYSQL_URL') }}

However, the MYSQL_URL env variable is resolved to none.

I got word from svet in the IRC channel that SaltEntity doesn't support 
shell.env. I think it would be really helpful to make this option available in 
order to configure multinode deployments with Salt.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)