Pretty sure this isn't going through the local shell before getting to the git module.
You can debug with setting ANSIBLE_KEEP_REMOTE_FILES=1 in the environment and running with -vvv and looking at that module it outputs on the remote system. If you see that behavior, please file a ticket if you are seeing this on Ansible 1.4.X or higher. On Wed, Dec 11, 2013 at 5:28 PM, kesten broughton < [email protected]> wrote: > Amazingly no! ansible catenates the strings, then evaluates it with the > local variable. > > I wonder if there is an option that can be set that will allow the new > behavior - {{ only with no $ vars - that can be used for now? > > > On Wed, Dec 11, 2013 at 3:28 PM, Kahlil Hodgson < > [email protected]> wrote: > >> 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 <[email protected]> >> 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 <[email protected]> >> >> 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 [email protected]. >> > For more options, visit https://groups.google.com/groups/opt_out. >> >> -- >> You received this message because you are subscribed to a topic in the >> Google Groups "Ansible Project" group. >> To unsubscribe from this topic, visit >> https://groups.google.com/d/topic/ansible-project/7IBnFvz1eow/unsubscribe >> . >> To unsubscribe from this group and all its topics, send an email to >> [email protected]. >> >> 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 [email protected]. > For more options, visit https://groups.google.com/groups/opt_out. > -- Michael DeHaan <[email protected]> CTO, AnsibleWorks, Inc. http://www.ansibleworks.com/ -- 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 [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
