You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brooklyn.apache.org by sjcorbett <gi...@git.apache.org> on 2016/11/09 15:33:30 UTC

[GitHub] brooklyn-server issue #422: SshCommandEffector + shell.env

Github user sjcorbett commented on the issue:

    https://github.com/apache/brooklyn-server/pull/422
  
    Resolution of shell environments is badly affected by the problem #385 fixes. For example when you invoke the effector created in this bluerint:
    
    ```yaml
    location: localhost
    services:
    - type: brooklyn.entity.group.DynamicCluster
      id: cluster
      brooklyn.config:
        initialSize: 3
        memberSpec:
          $brooklyn:entitySpec:
            type: org.apache.brooklyn.entity.software.base.EmptySoftwareProcess
            brooklyn.config:
              shell.env:
                MEMBER_CFG: $brooklyn:config("cluster.member.id")
                MEMBER_ID: $brooklyn:attributeWhenReady("entity.id")
    
      - type: brooklyn.entity.software.ssh.SshCommandEffector
        brooklyn.config:
          name: test-effector
          shell.env:
            CLUSTER_ID: $brooklyn:attributeWhenReady("entity.id")
          command: 'echo "cluster=${CLUSTER_ID}, memberId=${MEMBER_ID}, member=${MEMBER_CFG}" >> /tmp/echo'
          executionTarget: members
    ```
    You generally observe output like:
    ```
    cluster=hgnwhpehtq, memberId=h0ea5qzz4k, member=1
    cluster=hgnwhpehtq, memberId=hgnwhpehtq, member=
    cluster=hgnwhpehtq, memberId=hgnwhpehtq, member=
    ```
    In two of the three cases the entries in the member's `shell.env` were resolved against the cluster, not the member.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---