I'm trying to debug my ansible setup by running
ansible -m debug -a 'var=ansible_distribution' all
but I'm getting
my_ansible_host0 | SUCCESS => {
"ansible_distribution": "VARIABLE IS NOT DEFINED!"
}
It seems I can use {{ansible_distribution}}
in my jinja templates, though. Why is this? (Is this, for example, something to do with the distinction between facts and variables that I haven't been able to figure out yet?) And how can I change my command to get it to print out the value of ansible_distribution
? (Do I need to do something with lookup(...)
?)