When the output of a command is stored in a register, this will create a stdout_lines field in the result object that contains stdout split into a list of lines. This list can then be iterated over using with_items.