indentation help

Hi All,

Im new to ansible and want to underestand the syntax better, i have the below file running on my Ubuntu machine but im struggling with knowing where to use the " - " sign as i previously though it was just for “- name”.

im confused with the below lines of config

register: print_output

  • debug: var=print_output.stdout_lines

why does the debug need a “-” infront of it and also why does it need to be indented from the previous line " register: print_output " ?

appologies that this is basic stuff and thanks in advance for any help

Simon

The tasks: header in a play, or just the file itself for a role, is a YAML list. YAML lists are indicated by the first line of the element starting with -

See the following links for additional information:

Thanks for taking the time to reply much appreciated