How about the following:

    path_to_git_extras: "{{ 'EXPORT PATH=$' + 'PATH:' + '$' +
'ANSIBLE_21CT_HOME/roles/git/file' }}"

Or something similar in a template.

The problem will probably just go away once the old style '$' variable
syntax is retired.

K

Kahlil (Kal) Hodgson                       GPG: C9A02289
Head of Technology                         (m) +61 (0) 4 2573 0382
DealMax Pty Ltd                            (w) +61 (0) 3 9008 5281

Suite 1415
401 Docklands Drive
Docklands VIC 3008 Australia

"All parts should go together without forcing.  You must remember that
the parts you are reassembling were disassembled by you.  Therefore,
if you can't get them together again, there must be a reason.  By all
means, do not use a hammer."  -- IBM maintenance manual, 1925



On 12 December 2013 05:13, kesten broughton <kesten.brough...@gmail.com> wrote:
> unfortunately no.
>
> with
>     path_to_git_extras: >
>         PATH=$PATH:$ANSIBLE_21CT_HOME/roles/git/files
>
> when the file gets templated to the remote, it contains the value of
> ANSIBLE_21CT_HOME evaluated on the local machine.  The remote has the
> correct ANSIBLE_21CT_HOME path but it never gets a chance.
>
> I tried something new with jinja2 templating which i was sure would work but
> it seems that ansible $variable substitution happens in a peculiar way.
>
> I tried this in my file template, but still get the local $ANSIBLE_21CT_HOME
> evaluated.
> TEST 1
> {% filter string %}
> export PATH="$PATH:$ANSIBLE_21CT_HOME/roles/git/files"
> {% endfilter %}
>
> TEST2
> Testing with upper, i see the export line uppercased except for the
> $ANSIBLE_21CT_HOME portion.
> {% filter upper %}
> export PATH="$PATH:$ANSIBLE_21CT_HOME/roles/git/files"
> {% endfilter %}
>
> Result
> EXPORT PATH="$PATH:/Users/kbroughton/21ct-ansible/ROLES/GIT/FILES"
>
> So it seems that in TEST2 that the jinja2 filter gets applied BEFORE the
> ansible variable substitution,
> but it appears that in TEST1 the jinja2 filter comes after, or is not being
> applied somehow.
>
> Peculiar.
>
> kesten
>
> On Tuesday, December 10, 2013 4:03:51 PM UTC-6, Kahlil Hodgson wrote:
>>
>>
>> On 11 December 2013 08:48, Kesten Broughton <solarmobi...@gmail.com>
>> wrote:
>>>
>>> path_to_git_extras: 'PATH=\\$PATH:\\$ANSIBLE_21CT_HOME/roles/git/files'
>>
>>
>> does '>' quoting help?
>>
>>     path_to_git_extras: >
>>         PATH=$PATH:$ANSIBLE_21CT_HOME/roles/git/files
>>
>> K
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to ansible-project+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to