$ENV() returns array

Hi,

By default, reading an environment variable using $ENV(NAME) appears to return an array of strings. Is there a way to coerce $ENV(NAME) into a simple string?

Cheers,

Ben

This is fixed on 1.1

80%+ of everyone runs the development branch out of checkout (I know,
it's strange! But it works!) so you're free to do the same if you
want.

My clone of the ansible upstream is at 50c1c06088 on the devel branch and I am still getting the array behavior doing the following:

  • name: Update DNS
    action: shell route53 change_record $r53_zone graphite.$domain CNAME $inventory_hostname
    environment:
    AWS_ACCESS_KEY_ID: $ENV(AWS_ACCESS_KEY_ID)
    AWS_SECRET_ACCESS_KEY: $ENV(AWS_SECRET_ACCESS_KEY)
    tags:
  • dns

When this is executed, the env vars are correctly read out of the current shell into the remote shell, albeit as arrays.

You mentioned a 1.1 - is this just the name of the milestone that you will cut when it is ready, or is there actually a HEAD on Github that I am missing?

This happens to work fine:

   - shell: echo $ENV(HOME)

So it's more of a case of using the macro within the environment
keyword that we need to fix, which is this:

  - shell: echo $FOO
     environment:
        FOO: $ENV(HOME)

I'll file a ticket.

I'm referring to HEAD in git, yes.

Thanks for looking into this. For now, I think I can probably hack something together to get this going.