YAML
- This is data representation language which uses name values
<name>: <value>
- YAML is inspired from python, so indentation’s become mandatory
- YAML files generally have
.yaml or .yml as extensions
- Lets categorize data
- Scalar/Simple
- Complex
- list/array
- map/dictionary/object
- Refer Here for YAML syntax
---
name: test
mobile: '999999999'
email: test@test.com
CareerObjective: |
A motivated individual with in-depth knowledge of languages
and development tools, seeking a position in a growth-oriented
company where I can use my skills to the advantage of the
company while having the scope to develop my own skills.
ProfessionalSummary:
- Involved in designing CI/CD pipleines
- Hands on experience in Develpoing Ansible playbooks
Skills:
os:
- windows
- linux
cm:
- Ansible
container:
- Docker
Work experience:
- company: xyz limited
duration: Dec 2021 - present
designation: DevOps Engineer
RandR:
- Ensuring Pipelines are healthy
- Developing playbooks
- company: abc limited
duration: Dec 2019 - Dec 2021
designation: DevOps Engineer
RandR:
- Ensuring Pipelines are healthy
- Developing playbooks
- Basic structure of Ansible playbook
---
- name: <name of playbook - text>
hosts: <where to execute-text>
become: <need sudo permissions -bool>
tasks: # <list of task>
- name: Ensure apache is at the latest version # name of task
ansible.builtin.yum: # module name
name: httpd # module arguments
state: latest # state
- Ansible Playbook structure

Lets create a simple playbook
- Goal: create a file @
/tmp/1.txt
- manual:
touch /tmp/1.txt
- where to execute: all machines
- Approximate playbook
---
- name: create file play
become: false
hosts: all
tasks:
- name: create file
ansible.builtin.file:
path: '/tmp/1.txt'
state: file
Like this:
Like Loading...