DevOps Classroomnotes 29/Jul/2022

YAML

  • Is a data definition/expression format.
  • The data which we define is name & value pairs
  • YAML File Extension => .yaml or .yml extension
  • Refer Here for the official docs
  • Structure of ansible playbook
---
- name: <describe your playbook here>
  tasks:
    - name: <what this task is about>
      <module>:
         <module-parameter-1>: <module-value-1>
         ..
         <module-parameter-n>: <module-value-n>
         state: <value (present)>
    - name: <what this task is about>
      <module>:
         <module-parameter-1>: <module-value-1>
         ..
         <module-parameter-n>: <module-value-n>
         state: <value (present)>

  • Sample playbook
---
- name: install apache server
  become: yes
  hosts: all
  tasks:
    - name: install apache2 and update packages
      apt:
        name: apache2
        state: present
    - name: restart apache2
      service:
        name: apache2
        state: restarted

Published
Categorized as Uncategorized Tagged

By continuous learner

devops & cloud enthusiastic learner

Leave a ReplyCancel reply

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

Discover more from Direct DevOps from Quality Thought

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

Continue reading

Exit mobile version
%%footer%%