Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lookup plugin should use templates/ folder when used in role #9317

Closed
akloeber opened this issue Oct 12, 2014 · 2 comments
Closed

Lookup plugin should use templates/ folder when used in role #9317

akloeber opened this issue Oct 12, 2014 · 2 comments
Labels
bug This issue/PR relates to a bug.

Comments

@akloeber
Copy link

When using {{ lookup('template', 'foo.txt') }} in a role the file is looked up in the files folder. To make this compatible with the directory layout for roles the lookup should be based on the templates folder instead (maybe the files folder can be used as a fallback to keep backwards compatibility).

A minimal example has been provided at https://github.com/akloeber/misc/blob/master/ansible_issue_9317.zip. Its output is:

$ ansible-playbook site.yml -i hosts -u deploy && ansible --version

PLAY [all] ******************************************************************** 

GATHERING FACTS *************************************************************** 
ok: [main-test]

TASK: [foo | debug msg=] ****************************************************** 
ok: [main-test] => {
    "msg": "main-test"
}

TASK: [foo | debug msg=] ****************************************************** 
ok: [main-test] => {
    "msg": ""
}

PLAY RECAP ******************************************************************** 
main-test                  : ok=3    changed=0    unreachable=0    failed=0   

ansible 1.7.2

Lookup in files folder of roles has been added when fixing #2697.

akloeber added a commit to akloeber/misc that referenced this issue Oct 12, 2014
@bcoca
Copy link
Member

bcoca commented Feb 19, 2015

overlaps with #9551

@jimi-c jimi-c removed the P3 label Dec 7, 2015
@jimi-c
Copy link
Member

jimi-c commented Jul 9, 2016

This issue has been resolved as of 2.0 and works in current devel/stable-2.1. As such, we will close it now.

If you continue seeing any problems related to this issue, or if you have any further questions, please let us know by stopping by one of the two mailing lists, as appropriate:

Because this project is very active, we're unlikely to see comments made on closed tickets, but the mailing list is a great way to ask questions, or post if you don't think this particular issue is resolved.

Thank you!

@jimi-c jimi-c closed this as completed Jul 9, 2016
@ansibot ansibot added bug This issue/PR relates to a bug. and removed bug_report labels Mar 6, 2018
@ansible ansible locked and limited conversation to collaborators Apr 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug This issue/PR relates to a bug.
Projects
None yet
Development

No branches or pull requests

5 participants