Hi Brian,  thanks for your reply.

I tried your both suggestion now getting another error 

for *when: "'hadoop-namenode' in group_names"*

TASK [hadoop-master : include_vars] 
********************************************
fatal: [hnn001.dev.abc.com]: FAILED! => {"failed": true, "msg": "The 
conditional check 'inventory_hostname in groups['hadoop-namenode']' failed. 
The error was: error while evaluating conditional (inventory_hostname in 
groups['hadoop-namenode']): Unable to look up a name or access an attribute 
in template string. Make sure your variable name does not contain invalid 
characters like '-'.\n\nThe error appears to have been in 
'~/ansible/roles/hadoop-master/tasks/main.yml': line 6, column 3, but 
may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe 
offending line appears to be:\n\n\n- include_vars: namenode.yml\n  ^ 
here\n"}

 This is what I have in my namenode.yml

---

role : hadoop-namenode

monitoring_tags : ""

datadog_http_checks:
  - name: Magnetic {{ env }} NameNode
    url : http://{{ inventory_hostname }}:50070/dfshealth.jsp
    threshold : 5
    window : 5
    timeout : 10

 


If I remove the *when: inventory_hostname in groups['hadoop-namenode']* then 
it works as expected.

any idea why I am missing here ?

-- 
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/e8e2d5f3-8628-496c-a840-6dfb4787e168%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to