Ansible 2 template src path changed ?

Hi

I have the bellow template stored under the shared role but it’s been deployed by other roles as in our web role in our example :

roles/shared/templates/config.conf.j2

#roles/web/taks/main.yml :
`

  • name: deploy config
    template: src=config.conf.j2 dest=/etc/project/config.conf

`

In Ansible 1.9.4 the above works.

In Ansible 2.0.0.2 this fails :

`
TASK [web : deploy config] ************************
fatal: [server001.example.com]: FAILED! => {“changed”: false, “failed”: true, “msg”: “IOError: [Errno 2] No such file or directory: u’/src/Ansible/config.conf.j2’”}

`

In order for this to work on version 2 I have to change the src path to …/shared/templates/config.conf.j2 but this will break compatibility with Ansible version 1 :

`
roles/web/taks/main.yml :

  • name: deploy config
    template: src=…/shared/templates/config.conf.j2 dest=/etc/project/config.conf

`

Can someone confirm if this is a change in Ansible version 2 or should report a bug ?

As suggested by James Camarata in the webinar , the template module code has changed a lot.

I’v created an issue in https://github.com/ansible/ansible/issues/14161 .