indentation help

28 views
Skip to first unread message

simon clarke

unread,
Sep 24, 2021, 11:08:30 AM9/24/21
to Ansible Project
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 

Matt Martz

unread,
Sep 24, 2021, 11:18:04 AM9/24/21
to ansible...@googlegroups.com
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:


--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/6102c282-64e9-4afa-b9cc-2dcdda35a7fen%40googlegroups.com.


--
Matt Martz
@sivel
sivel.net

simon clarke

unread,
Sep 24, 2021, 11:23:07 AM9/24/21
to Ansible Project
Thanks for taking the time to reply much appreciated 
Reply all
Reply to author
Forward
0 new messages