Ansible 1.0 lookup plugin usage in with_fileglob

I’m having some trouble getting the following code in my playbook to run:

  • name: “copy executable MX scripts out to nodes”
    action: copy src=$item dest=/opt/mx-scripts mode=755
    with_fileglob:
  • $ENV(DEPLOY_HOME)/conf/common/templates/stuff/scripts/*.sh
    tags:
  • configuration

I tried to use the lookup plugin to do this but it did not seem to help

  • name: “copy executable MX scripts out to nodes”
    action: copy src=$item dest=/opt/mx-scripts mode=755
    with_fileglob:
  • {{ lookup(‘env’,‘DEPLOY_HOME’) }}/conf/common/templates/stuff/scripts/*.sh
    tags:
  • configuration

I’m not really sure whether lookup plugin works in this manner in 1.0 since it appears not to be substituted for when I debug. Any suggestions how to work through this?

1.0 does not support {{ }} syntax, that was introduced in 1.2

with_fileglob: $ENV(DEPLOY_HOME’)/conf/common/templates/stuff/scripts/*.sh

Yep, exactly.

Slight tweak, I think the old syntax (which should still work but is dis-favored in newer versions)

$ENV(DEPLOY_HOME)

aka lose the trailing “'” just before the )

I highly recommend upgrading to 1.2.X as there have been a lot of fixes/improvements sense then.