Introduction to Ansible

This topic is to discuss the following lesson:

Hi, I have a quick question.

In this YAML file

# Employee records
- martin:
    name: Martin D'vloper
    job: Developer
    skills:
      - python
      - perl
      - pascal
- tabitha:
    name: Tabitha Bitumen
    job: Developer
    skills:
      - lisp
      - fortran
      - erlang

skills: is a list that contains three values - python, perl, and pascal? (for the first employee record).

Thank you.
David

Hello David

Yes, that is correct. The skills field for the first employee (martin) is a YAML list (array) containing three values: python, perl, and pascal. YAML uses hyphens (-) to denote individual items in a list, with each item on a separate line.

Similarly, the skills field for the second employee (tabitha) contains three elements: lisp, fortran, and erlang.

So in both employee records, the skills field represents an array with three elements each.

I hope this has been helpful!

Laz