Re: [ansible-project] unpredictable 'working directory' on local machine

2015-10-30 Thread Jonathan Miller
On Tuesday, 27 October 2015 16:34:10 UTC, Brian Coca wrote: > > I see what you mean now, but not unpredictable. Lookups are always > relative to the role or play. > > Local tasks are relative to the cwd from which you execute. > > > -- > Brian Coca > Thanks, that is excellent info. I have not

[ansible-project] unpredictable 'working directory' on local machine

2015-10-27 Thread Jonathan Miller
Hi, I have found that ansible is unpredictable in terms of determining the current working directory on the LOCAL machine. Invoking the same shell command as a lookup, or as a command, changes the apparent working directory. Is this expected behaviour? e.g. for the playbook given below, and

Re: [ansible-project] unpredictable 'working directory' on local machine

2015-10-27 Thread Brian Coca
just tested this against 2.0: - hosts: localhost gather_facts: False vars: third: "{{lookup('pipe', 'pwd')}}" tasks: - shell: pwd register: cwd - debug: msg={{cwd}} - debug: msg={{lookup('pipe', 'pwd')}} - debug: msg={{third}} and all 3 give the same result.

Re: [ansible-project] unpredictable 'working directory' on local machine

2015-10-27 Thread Jonathan Miller
On Tuesday, 27 October 2015 12:17:52 UTC, Brian Coca wrote: > > just tested this against 2.0: > > - hosts: localhost > gather_facts: False > vars: > third: "{{lookup('pipe', 'pwd')}}" > tasks: > - shell: pwd > register: cwd > > - debug: msg={{cwd}} > - debug:

Re: [ansible-project] unpredictable 'working directory' on local machine

2015-10-27 Thread Brian Coca
I see what you mean now, but not unpredictable. Lookups are always relative to the role or play. Local tasks are relative to the cwd from which you execute. -- Brian Coca -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe