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
  • 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
  • Refer Here for the playbook and executed plabook

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 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
Social Media Icons Powered by Acurax Web Design Company
Exit mobile version
%%footer%%