{"action":"created","issue":{"url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/1460","labels_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/1460/labels{/name}","comments_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/1460/comments","events_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/1460/events","html_url":"https://github.com/ansible/ansible-modules-core/issues/1460","id":84697710,"number":1460,"title":"cloudformation: cloudformation template file is not found when using the module in a role, relative to the role","user":{"login":"viper233","id":506391,"avatar_url":"https://avatars.githubusercontent.com/u/506391?v=3","gravatar_id":"","url":"https://api.github.com/users/viper233","html_url":"https://github.com/viper233","followers_url":"https://api.github.com/users/viper233/followers","following_url":"https://api.github.com/users/viper233/following{/other_user}","gists_url":"https://api.github.com/users/viper233/gists{/gist_id}","starred_url":"https://api.github.com/users/viper233/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/viper233/subscriptions","organizations_url":"https://api.github.com/users/viper233/orgs","repos_url":"https://api.github.com/users/viper233/repos","events_url":"https://api.github.com/users/viper233/events{/privacy}","received_events_url":"https://api.github.com/users/viper233/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ansible/ansible-modules-core/labels/bug_report","name":"bug_report","color":"fbca04"},{"url":"https://api.github.com/repos/ansible/ansible-modules-core/labels/P3","name":"P3","color":"fef2c0"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-06-03T18:11:46Z","updated_at":"2015-06-04T04:10:47Z","closed_at":null,"body":"Issue Type: Bug Report\r\nAnsible Version: latest devel branch\r\nAnsible Configuration: as per the github file\r\nEnvironment: Ubuntu 15.04 GNU/Linux x86_64\r\nSummary:\r\nWhen using the cloudformation module as a task in a role it's unable to locate the cloudformation template file relative to the role directory i.e. role_name/files/cf_template.json\r\n\r\nroles/cf_role/tasks/main.yml\r\n```\r\n- name: launch cloudformation stack\r\n  cloudformation:\r\n    region: \"{{ aws_region }}\"\r\n    state: \"{{ stack_state }}\"\r\n    stack_name: \"{{ stack_name }}\"\r\n    disable_rollback: true\r\n    template: cf_template.json\r\n    template_parameters:\r\n        AmiId: \"{{ AmiId }}\"\r\n\r\ntemplate_body = open(module.params['template'], 'r').read()\\nIOError: [Errno 2] No such file or \r\ndirectory: \r\n```\r\nI was expecting the file to made available from either the templates/ or files/ sub-directory of the role. files would make sense though I could see a case for a template being used also."},"comment":{"url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/comments/108713399","html_url":"https://github.com/ansible/ansible-modules-core/issues/1460#issuecomment-108713399","issue_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/1460","id":108713399,"user":{"login":"bennojoy","id":315687,"avatar_url":"https://avatars.githubusercontent.com/u/315687?v=3","gravatar_id":"","url":"https://api.github.com/users/bennojoy","html_url":"https://github.com/bennojoy","followers_url":"https://api.github.com/users/bennojoy/followers","following_url":"https://api.github.com/users/bennojoy/following{/other_user}","gists_url":"https://api.github.com/users/bennojoy/gists{/gist_id}","starred_url":"https://api.github.com/users/bennojoy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bennojoy/subscriptions","organizations_url":"https://api.github.com/users/bennojoy/orgs","repos_url":"https://api.github.com/users/bennojoy/repos","events_url":"https://api.github.com/users/bennojoy/events{/privacy}","received_events_url":"https://api.github.com/users/bennojoy/received_events","type":"User","site_admin":false},"created_at":"2015-06-04T04:10:47Z","updated_at":"2015-06-04T04:10:47Z","body":"Module wont know if it being called from a role, so the way to do it woudl be teach the module to accept the json content and then use lookup('file', foo) to read the data, since file lookup knows about roles. this woudl be a feature request."}}