How is a play marked in an Ansible playbook?

Prepare for the Cisco Certified DevNet Associate Exam. Use flashcards and multiple choice questions to boost your knowledge, with hints and explanations to guide you. Ace your exam effectively!

In an Ansible playbook, plays are marked with a hyphen at the leftmost position. This is a key aspect of YAML syntax, which is used for writing Ansible playbooks. Each play in the playbook begins with a hyphen followed by the name of the play, making it clear to the parser that this is the start of a new play. This structured format allows Ansible to interpret and organize the tasks intended for execution on the managed nodes.

Using a hyphen indicates a list structure in YAML, which is appropriate for defining multiple plays in a playbook. This clear delineation ensures that each play's objectives, such as the target hosts and the tasks to be executed, are properly formatted and recognized. The hyphen serves as a standard convention in YAML for listing items, helping maintain readability and clarity within the playbook.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy