Let's say you are using the vars plugin to create variables. Notice in this example that var2 contains null and var3 contains no value.
vars:
var1: "Hello World"
var2: null
var3:
The debug module can be used to print the value of each variable.
- name: output the 'var1' variable
debug:
var: var1
- name: output the 'var2' variable
debug:
var: var2
- name: output the 'var3' variable
debug:
var: var3
Something like this should be returned. Notice that both var2 and var3 contain no value.
TASK [output the 'var1' variable]
ok: [server1.example.com] => {
"var1": "Hello World"
}
TASK [output the 'var2' variable]
ok: [server1.example.com] => {
"var2": ""
}
TASK [output the 'var3' variable]
ok: [server1.example.com] => {
"var3": ""
}