DevOps Classroomnotes 06/Oct/2023

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
      • text
      • number
      • boolean
    • 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
Published
Categorized as Uncategorized Tagged

By continuous learner

devops & cloud enthusiastic learner

Leave a comment

Turn on JavaScript to leave a comment.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Please turn AdBlock off
Customized Social Media Icons from Acurax Digital Marketing Agency
Exit mobile version
%%footer%%