I am new in ansible world, trying to figure out playbook where I use ‘grep’ to check for netmask address from a text file and capture the exit code with ‘register’ ( see below).
When outputting a variable with debug, you do NOT use the curly braces.
If you use the curly braces, you are asking debug to output a variable with the name contained in ipmask, rather than the value of ipmask itself. Because the value contained in ipmask is not the name of a variable, debug complains that it is not defined.