Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More detailed info on block scalars #2319

Open
wants to merge 1 commit into
base: devel
Choose a base branch
from

Conversation

kk-at-redhat
Copy link

No description provided.

@ansible-documentation-bot ansible-documentation-bot bot added the new_contributor This PR is the first contribution by a new community member. label Jan 1, 2025
@ansible-documentation-bot
Copy link
Contributor

Thanks for your Ansible docs contribution! We talk about Ansible documentation on Matrix at #docs:ansible.im if you ever want to join us and chat about the docs! We meet on Matrix every Tuesday. See the Ansible calendar for meeting details. We welcome additions to our weekly agenda items too. You can add the dawgs-meeting tag to a forum topic to bring it up at the next meeting.

@ansible-documentation-bot
Copy link
Contributor

Thanks for your contribution, @kk-at-redhat! Please make sure that your pull request includes sufficient and meaningful details in the description.
PR descriptions provide important context and allow other developers and our future selves to understand a change's rationale and what it actually fixes or accomplishes.

@samccann samccann added the techreview needs technical review label Mar 20, 2025
@@ -18,15 +18,13 @@ is used in practice.
YAML Basics
-----------

For Ansible, nearly every YAML file starts with a list.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All play and task files are lists

All files that define variables are dictionaries

@@ -68,19 +66,18 @@ More complicated data structures are possible, such as lists of dictionaries, di
- fortran
- erlang

Dictionaries and lists can also be represented in an abbreviated form if you really want to:
Dictionaries and lists can also be written in a short form called "Flow collections":
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

aka YAML shorthand, which is also a superset of JSON

Using a "Folded Block Scalar" ``>`` will fold newlines to spaces; it is used to make what would otherwise be a very long line easier to read and edit.
In either case the indentation will be ignored.
Examples are:
Values can be written as multiple lines using "Block Scalars".
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

String values

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new_contributor This PR is the first contribution by a new community member. techreview needs technical review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants