SlideShare a Scribd company logo
ANSIBLE PLAYBOOKS
• Playbooks are text file written in YAML format. Compared to the
languages used in other configuration management tools such
as puppet, the syntax used in playbook is much easier to write
and comprehend.
• In comparison with ad-hoc commands, playbooks are used in
complex scenarios, and they offer increased flexibility.
• Playbooks use YAML format, so there is not much syntax
needed, but indentation must be respected. Ansible playbooks
tend to be more of a configuration language than a
programming language.
• Like the name is saying, a playbook is a collection of plays.
Through a playbook, you can designate specific roles to some of
the hosts and other roles to other hosts. By doing so, you can
orchestrate multiple servers in very diverse scenarios, all in
one playbook.
A SIMPLE
PLAYBOOK
MULTIPLE
PLAYS
COMMANDS
• ansible-playbook playbook.yml –syntax-check //checking
the syntax of the playbook
• ansible-playbook playbook.yml //run
the playbook
• ansible-playbook –i inventory playbook.yml // run the
playbook with custom inventory
• ansible-playbook --step playbook.yml //run
the playbook with step by step execution
MANAGING VARIABLES
• Variables in Playbook
• Host variables and group variables
• Managing Facts
MANAGING
VARIABLE
Ansible day 03
Ansible day 03
Ansible day 03
Ansible day 03
ANSIBLE
FACTS
Ansible day 03
Ansible day 03
JINGA2 TEMPLATES
• Introduction to Jinga2 Templates
• String manipulation
• Examples
INTRODUCTION TO JINGA2 TEMPLATES
Ansible day 03
Ansible day 03
Ansible day 03

More Related Content

PPTX
Final exam study guide mazure paul
PPTX
Adnible day 2.ppt
PPT
Abstract beach
PPT
Back to school supplies
PPT
Crusing new year
PPT
School lockers
PPT
University days
PPTX
Animated sea of questions
Final exam study guide mazure paul
Adnible day 2.ppt
Abstract beach
Back to school supplies
Crusing new year
School lockers
University days
Animated sea of questions

What's hot (18)

PPT
The flow green
PPT
Water world
PPT
Back to school black board
PPT
The flow blue
PPT
Chat bubble yellow
PPT
Sea of questions
PPT
Chat bubble teal
PPT
Recycle concept
PPT
Holding the sun
PPT
Enter new year
PPT
Computer instructor
PPT
Chat bubble
PPT
Abc apple crayons
PPT
Big question red
PPT
Tablet learning
PPT
Last minute to new year
PPT
The flow red
PPT
Crowd communication
The flow green
Water world
Back to school black board
The flow blue
Chat bubble yellow
Sea of questions
Chat bubble teal
Recycle concept
Holding the sun
Enter new year
Computer instructor
Chat bubble
Abc apple crayons
Big question red
Tablet learning
Last minute to new year
The flow red
Crowd communication
Ad

Similar to Ansible day 03 (20)

PPTX
Ansible day02
PPTX
Adnible day 2.ppt
PDF
Jenkins and ansible reference
PPTX
Introduction to Ansible - Peter Halligan
PPTX
Ansible
PDF
Introduction to Ansible in RHEL- RHCE.pdf
PDF
Configuration management I - Ansible + Packer
PDF
Getting started with Ansible
PPTX
Ansible as configuration management tool for devops
PDF
Network Automation: Ansible 101
PDF
Getting Started with Ansible - Jake.pdf
PDF
Ansible Variables in Playbook - RHCE.pdf
PPTX
Ansible Automation Best Practices From Startups to Enterprises - Minnebar 12
PDF
Ansible for Configuration Management for Lohika DevOps training 2018 @ Lohika...
PPTX
SESSION Ansible how to deploy and push resources
PDF
Ansible Overview - System Administration and Maintenance
PPTX
Introduction to ansible
PDF
Automating with ansible (part a)
PDF
Ansible day02
Adnible day 2.ppt
Jenkins and ansible reference
Introduction to Ansible - Peter Halligan
Ansible
Introduction to Ansible in RHEL- RHCE.pdf
Configuration management I - Ansible + Packer
Getting started with Ansible
Ansible as configuration management tool for devops
Network Automation: Ansible 101
Getting Started with Ansible - Jake.pdf
Ansible Variables in Playbook - RHCE.pdf
Ansible Automation Best Practices From Startups to Enterprises - Minnebar 12
Ansible for Configuration Management for Lohika DevOps training 2018 @ Lohika...
SESSION Ansible how to deploy and push resources
Ansible Overview - System Administration and Maintenance
Introduction to ansible
Automating with ansible (part a)
Ad

More from Gourav Varma (20)

PPTX
Jenkins introduction
PPTX
Docker introduction (1)
PPTX
Aws day 4
PPTX
Aws day 3
PPTX
Aws day 2
PPTX
Ansible day 4
PPTX
Ansible day 3
PPTX
Ansible day 1.ppt
PPTX
Version control git day03(amarnath dada)
PPTX
Version control git day02
PPTX
Version control git day01
PPTX
Dev ops
PPTX
Shell programming 2
PPTX
Introduction to linux
PPTX
Final terraform
PPTX
Version control git day03
PPTX
Version control git day02
PPTX
Version control git day01
PPT
Docker swarm
PPTX
Docker advance topic (2)
Jenkins introduction
Docker introduction (1)
Aws day 4
Aws day 3
Aws day 2
Ansible day 4
Ansible day 3
Ansible day 1.ppt
Version control git day03(amarnath dada)
Version control git day02
Version control git day01
Dev ops
Shell programming 2
Introduction to linux
Final terraform
Version control git day03
Version control git day02
Version control git day01
Docker swarm
Docker advance topic (2)

Recently uploaded (20)

PDF
BRKDCN-2613.pdf Cisco AI DC NVIDIA presentation
PPTX
Unit 5 BSP.pptxytrrftyyydfyujfttyczcgvcd
PPTX
Practice Questions on recent development part 1.pptx
PPTX
Simulation of electric circuit laws using tinkercad.pptx
PDF
July 2025: Top 10 Read Articles Advanced Information Technology
PPTX
ANIMAL INTERVENTION WARNING SYSTEM (4).pptx
PDF
A Framework for Securing Personal Data Shared by Users on the Digital Platforms
PDF
Monitoring Global Terrestrial Surface Water Height using Remote Sensing - ARS...
PDF
Traditional Exams vs Continuous Assessment in Boarding Schools.pdf
PPTX
TE-AI-Unit VI notes using planning model
PDF
Queuing formulas to evaluate throughputs and servers
PPT
High Data Link Control Protocol in Data Link Layer
PDF
6th International Conference on Artificial Intelligence and Machine Learning ...
PDF
Introduction to Data Science: data science process
PDF
Top 10 read articles In Managing Information Technology.pdf
PPTX
Recipes for Real Time Voice AI WebRTC, SLMs and Open Source Software.pptx
PPTX
Lesson 3_Tessellation.pptx finite Mathematics
PPT
SCOPE_~1- technology of green house and poyhouse
PPTX
anatomy of limbus and anterior chamber .pptx
BRKDCN-2613.pdf Cisco AI DC NVIDIA presentation
Unit 5 BSP.pptxytrrftyyydfyujfttyczcgvcd
Practice Questions on recent development part 1.pptx
Simulation of electric circuit laws using tinkercad.pptx
July 2025: Top 10 Read Articles Advanced Information Technology
ANIMAL INTERVENTION WARNING SYSTEM (4).pptx
A Framework for Securing Personal Data Shared by Users on the Digital Platforms
Monitoring Global Terrestrial Surface Water Height using Remote Sensing - ARS...
Traditional Exams vs Continuous Assessment in Boarding Schools.pdf
TE-AI-Unit VI notes using planning model
Queuing formulas to evaluate throughputs and servers
High Data Link Control Protocol in Data Link Layer
6th International Conference on Artificial Intelligence and Machine Learning ...
Introduction to Data Science: data science process
Top 10 read articles In Managing Information Technology.pdf
Recipes for Real Time Voice AI WebRTC, SLMs and Open Source Software.pptx
Lesson 3_Tessellation.pptx finite Mathematics
SCOPE_~1- technology of green house and poyhouse
anatomy of limbus and anterior chamber .pptx

Ansible day 03

  • 1. ANSIBLE PLAYBOOKS • Playbooks are text file written in YAML format. Compared to the languages used in other configuration management tools such as puppet, the syntax used in playbook is much easier to write and comprehend. • In comparison with ad-hoc commands, playbooks are used in complex scenarios, and they offer increased flexibility. • Playbooks use YAML format, so there is not much syntax needed, but indentation must be respected. Ansible playbooks tend to be more of a configuration language than a programming language. • Like the name is saying, a playbook is a collection of plays. Through a playbook, you can designate specific roles to some of the hosts and other roles to other hosts. By doing so, you can orchestrate multiple servers in very diverse scenarios, all in one playbook.
  • 4. COMMANDS • ansible-playbook playbook.yml –syntax-check //checking the syntax of the playbook • ansible-playbook playbook.yml //run the playbook • ansible-playbook –i inventory playbook.yml // run the playbook with custom inventory • ansible-playbook --step playbook.yml //run the playbook with step by step execution
  • 5. MANAGING VARIABLES • Variables in Playbook • Host variables and group variables • Managing Facts
  • 14. JINGA2 TEMPLATES • Introduction to Jinga2 Templates • String manipulation • Examples