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

template is ignoring variables from defaults/main.yml #12545

Closed
tkaymak opened this issue Sep 28, 2015 · 2 comments
Closed

template is ignoring variables from defaults/main.yml #12545

tkaymak opened this issue Sep 28, 2015 · 2 comments
Labels
bug This issue/PR relates to a bug. P2 Priority 2 - Issue Blocks Release
Milestone

Comments

@tkaymak
Copy link

tkaymak commented Sep 28, 2015

MacOS 10.10.5, ansible 1.9.2:

Error:

TASK: [elasticsearch | Copy elasticseach.yml] *********************************
fatal: [consumer-jail-19.acc] => {'msg': "AnsibleUndefinedVariable: One or more undefined variables: 'es_cluster_name' is undefined", 'failed': True}
fatal: [consumer-jail-19.acc] => {'msg': "AnsibleUndefinedVariable: One or more undefined variables: 'es_cluster_name' is undefined", 'failed': True}

FATAL: all hosts have already failed -- aborting

defaults/main.yml:


---
# ES ClusterName
es_cluster_name: 'bi_elasticsearch'

templates/elasticsearch.yml.j2:

cluster.name: {{es_cluster_name}}

tasks/main.yml:

- name: Copy elasticseach.yml
  template: src=elasticsearch.yml.j2 dest=/usr/local/etc/elasticsearch/elasticsearch.yml
@tkaymak tkaymak changed the title template is ignoring variables from default/main.yml template is ignoring variables from defaults/main.yml Sep 28, 2015
@jimi-c jimi-c added bug_report P2 Priority 2 - Issue Blocks Release labels Sep 28, 2015
@jimi-c jimi-c added this to the stable-1.9 milestone Sep 28, 2015
@tkaymak
Copy link
Author

tkaymak commented Sep 28, 2015

Removing the single quotes in "defaults/main.yml" did the trick. However, it seems odd that single quotes are breaking this.

@abadger
Copy link
Contributor

abadger commented Mar 7, 2016

Just tested this with current stable-1.9 and was unable to reproduce so this seems to be fixed. Going to close it.

@abadger abadger closed this as completed Mar 7, 2016
@ansibot ansibot added bug This issue/PR relates to a bug. and removed bug_report labels Mar 7, 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. P2 Priority 2 - Issue Blocks Release
Projects
None yet
Development

No branches or pull requests

4 participants