DevOps Classroom notes 23/Feb/2024

Ansible Contd

Writing Playbooks

  • Refer Here for official docs of Ansible Playbook
  • Playbook defines the configuration management expressed in desired state using YAML
  • Ansible Playbook organization
    Preview
  • In Ansible the smallest unit of execution is done by modules

First Playbook: Install tree

  • Manual steps
sudo apt install tree -y
  • Search for module for each step apt => ansible.builtin.apt
    Preview
  • Refer Here for the playbook and executed plabook
    Preview

Exercise

  • List out what are the areas which you need to fill in your resume
name
phone number
email 
professional summary
skillset
work experience
education
  • We have list out names/keys then we need fill values
name = text
phone number = text
email text
professional summar text
skillset
   <skill name>: <skill values>
work experience: 
    experience list:
        company name
        duration
        role and responsibilities: text array/list

YAML

  • It is collection of name value or key value pair used to represent data.
  • Generally it is stored in files with extension .yml or .yaml
<name>: <value>
  • Values can be of different types
    • Simple
      • text: can be represented in single or double quotes tool: ansible
      • number: numbers in non quote format age: 10
      • boolean: true, false, yes, no online: yes
    • Complex
      • list: array
        colors:
        – black
        – white
      • object/dictionary:

        address:
        flatno: 601
        building: nilgiri
        area: Ameerpet
        city: Hyderabad
  • Refer Here for YAML documentation from ansible
  • Try to come up with a YAML format to describe your home town
  • What does --- in yaml signify

Published
Categorized as Uncategorized Tagged

By continuous learner

devops & cloud enthusiastic learner

Leave a Reply

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

Please turn AdBlock off
Animated Social Media Icons by Acurax Responsive Web Designing Company

Discover more from Direct DevOps from Quality Thought

Subscribe now to keep reading and get access to the full archive.

Continue reading

Visit Us On FacebookVisit Us On LinkedinVisit Us On Youtube