I am writing a rolling upgrade playbook and would like to print out the hostname of current host been upgraded.
I put inventory_hostname
and ansible_hostname
in task names but that did not work
- name: upgrade softare on {{inventory_hostname}}
- name: current host is {{ansible_hostname}}
debug works fine
- name: Test a variable
debug: var=inventory_hostname
TASK: [Test a variable] *******************************************************
ok: [SERV14] => {
"var": {
"inventory_hostname": "SERV14"
}
}
So what should I do to be able to use those variables in task name descriptions.
Thanks