Hi,


It seems like Ansible 2.1.2 and newer has changed path handling.


My observations are:

   - In 1.9.x it bases relative paths on the path of the playbook itself. 
   - In 2.0.0 to 2.1.1 it bases relative paths on the path of where 
   ansible-playbook is being executed from. 
   - In 2.1.2 it reverts back to 1.9.x behaviour. 

This affects, among others, the template module when using relative paths, 
as well as pwd from a shell command.


This seems like a pretty big change.


Am I doing something wrong? Which is correct?


To reproduce the observations:


Assuming the following directory tree, and a test.yml playbook:


.

├── ansible

│   ├── group_vars

│   ├── inventory

│   └── test.yml

└── other


test.yml:


- name: test

  hosts: localhost

  gather_facts: no

  tasks:

    - command: >

        pwd

      register: result

    - debug: *var*=result.stdout


Executing:


cd /projects/acme-corp/my-project/

ansible-playbook -i local, ./ansible/test.yml


In Ansible 2.1.1, I get:


TASK [debug] 
*********************************************************************

ok: [localhost] => {

    "result.stdout": "/projects/acme-corp/my-project"

}


In Ansible 2.1.2 and 1.9.0, I get:


TASK [debug] 
*********************************************************************

ok: [localhost] => {

    "result.stdout": "/projects/acme-corp/my-project/ansible"

}


Thanks,


Steve

-- 
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].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/99c1918b-96f3-47e0-97a5-c4fe902d7762%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to