SlideShare a Scribd company logo
Writing your First Ansible Playbook
By Sana Khan
About me
➔ Infrastructure Engineer/ SysAdmin
➔ Former Software Developer
➔ GNOME Outreach Intern (2016) - OpenStack
➔ RGSoC Intern (2014)
Agenda
➔ Challenges in managing server configurations before Configuration Management
tools.
➔ Benefits of Configuration Management tool.
➔ Where does Ansible fit in the suite of IaaC tools?
➔ What are the features of IaaC tools?
➔ Why learn Ansible?
➔ Understanding an Ansible Setup.
➔ Basics concepts of Ansible.
➔ Writing your own Playbook.
➔ Security Best Practices.
Before Configuration Management Tools
Setup a Webserver (nginx) & an application stack (php)
➔ Step-1: Login to the server
➔ Step-2: Install the nginx package
➔ Step-3: Configure nginx configuration
➔ Step-4: Ensure required users, groups are present
➔ Step-5: Ensure correct permissions, user roles are assigned to conf files.
➔ Step-6: Install php packages
➔ Step-7: Configure the application
➔ Step-8: Configure web server to redirect to application
Before Configuration Management Tools -2
➔ Doable
➔ Couple of servers
➔ The only form of automation
available: Bash Scripts
➔ Inconsistent environments
Problem: Large groups of servers that need to be managed in a flexible way.
Configuration Management Tools - Today
Goal: Install, manage software and configuration at scale with ease.
➔ Helps automate Infrastructure
➔ Centralized management
➔ Helps manage Infrastructure at large scale
➔ Consistent environments
Where does Ansible fit in suite of IaaC Tools?
What are the features of IaaC Tools?
➔ Declarative Syntax
(describes the state of the infrastructure)
➔ Code form
(revision control)
➔ Idempotence
( current state == desired state )? -> take actions accordingly.
Why Ansible?
➔ Learning curve is less, easy to pick it up.
➔ Agentless, only requires Python to be installed on the managed
servers.
➔ Modules are written in Python, easily accessible.
➔ Modules that integrate with Cloud Providers like AWS, OpenStack.
➔ Modules for Docker, Ovirt, etc.
➔ Modules for network devices, windows, etc.
Ansible Setup
Prerequisites:
➔ Python needs to
be installed
➔ Sudo user
➔ SSH access
Ansible Concepts
➔ Inventory file
➔ Syntax of a YAML file
➔ Tasks
➔ Modules
➔ Ad-Hoc Commands
➔ Playbooks
➔ Roles (Ready to use playbooks - Ansible Galaxy)
YAML Basics
➔ All YAML files begin with ---
➔ At basic level YAML file consists of lists and dictionaries.
➔ YAML file starts with a list.
YAML Basics -- contd
Source: YAML Syntax
Demo
➔ Ansible | jonatanblue
➔ https://github.com/sanakhanlibre/Ansible101
Security Best Practices
➔ Control Node needs to be secure/hardened.
➔ Don’t use passwords, use Key based Authentication.
➔ Use Ansible Vault for secrets.
➔ Don’t expose sensitive data in Ansible Output.
➔ Verify before using Roles from Ansible Galaxy.
Thank You.
Ad

More Related Content

What's hot (18)

Extending ansible
Extending ansibleExtending ansible
Extending ansible
Yan Kurniawan
 
Infrastructure as Code
Infrastructure as CodeInfrastructure as Code
Infrastructure as Code
Sascha Möllering
 
Using hapi plugins to version your API (hapiDays 2014)
Using hapi plugins to version your API (hapiDays 2014)Using hapi plugins to version your API (hapiDays 2014)
Using hapi plugins to version your API (hapiDays 2014)
Dave Stevens
 
End to End Testing with nightwatchjs
End to End  Testing with nightwatchjsEnd to End  Testing with nightwatchjs
End to End Testing with nightwatchjs
Srikanth Madduri
 
High Available Drupal
High Available DrupalHigh Available Drupal
High Available Drupal
Bram Vogelaar
 
Why I am hooked on the future of React
Why I am hooked on the future of ReactWhy I am hooked on the future of React
Why I am hooked on the future of React
Maurice De Beijer [MVP]
 
An Introduction to hapi.js
An Introduction to hapi.jsAn Introduction to hapi.js
An Introduction to hapi.js
Dave Stevens
 
Cypress Automation
Cypress  AutomationCypress  Automation
Cypress Automation
Susantha Pathirana
 
How to Hack (And Secure) Serverless Apps on Azure
How to Hack (And Secure) Serverless Apps on AzureHow to Hack (And Secure) Serverless Apps on Azure
How to Hack (And Secure) Serverless Apps on Azure
Dean Bryen
 
SQL Start! 2019 - Ancona - Distribuisci ed amministra le tue istanze SQL Serv...
SQL Start! 2019 - Ancona - Distribuisci ed amministra le tue istanze SQL Serv...SQL Start! 2019 - Ancona - Distribuisci ed amministra le tue istanze SQL Serv...
SQL Start! 2019 - Ancona - Distribuisci ed amministra le tue istanze SQL Serv...
Marco Obinu
 
Rack
RackRack
Rack
Kerry Buckley
 
Women Who Code Connect 2018 Conference
Women Who Code Connect 2018 ConferenceWomen Who Code Connect 2018 Conference
Women Who Code Connect 2018 Conference
Supriya Premkumar
 
Protecting your site by detection
Protecting your site by detectionProtecting your site by detection
Protecting your site by detection
Marko Heijnen
 
Building an API in Node with HapiJS
Building an API in Node with HapiJSBuilding an API in Node with HapiJS
Building an API in Node with HapiJS
Loc Nguyen
 
ASP.NET Core
ASP.NET CoreASP.NET Core
ASP.NET Core
Andrea Dottor
 
Serverless architecture: introduction & first steps
Serverless architecture: introduction & first stepsServerless architecture: introduction & first steps
Serverless architecture: introduction & first steps
The Software House
 
Ansible @ Red Hat | December 2015 Ansible Meetup in Melbourne
Ansible @ Red Hat | December 2015 Ansible Meetup in MelbourneAnsible @ Red Hat | December 2015 Ansible Meetup in Melbourne
Ansible @ Red Hat | December 2015 Ansible Meetup in Melbourne
Ken Thompson
 
“ASP.NET Core. Features and architecture”
“ASP.NET Core. Features and architecture” “ASP.NET Core. Features and architecture”
“ASP.NET Core. Features and architecture”
HYS Enterprise
 
Using hapi plugins to version your API (hapiDays 2014)
Using hapi plugins to version your API (hapiDays 2014)Using hapi plugins to version your API (hapiDays 2014)
Using hapi plugins to version your API (hapiDays 2014)
Dave Stevens
 
End to End Testing with nightwatchjs
End to End  Testing with nightwatchjsEnd to End  Testing with nightwatchjs
End to End Testing with nightwatchjs
Srikanth Madduri
 
High Available Drupal
High Available DrupalHigh Available Drupal
High Available Drupal
Bram Vogelaar
 
An Introduction to hapi.js
An Introduction to hapi.jsAn Introduction to hapi.js
An Introduction to hapi.js
Dave Stevens
 
How to Hack (And Secure) Serverless Apps on Azure
How to Hack (And Secure) Serverless Apps on AzureHow to Hack (And Secure) Serverless Apps on Azure
How to Hack (And Secure) Serverless Apps on Azure
Dean Bryen
 
SQL Start! 2019 - Ancona - Distribuisci ed amministra le tue istanze SQL Serv...
SQL Start! 2019 - Ancona - Distribuisci ed amministra le tue istanze SQL Serv...SQL Start! 2019 - Ancona - Distribuisci ed amministra le tue istanze SQL Serv...
SQL Start! 2019 - Ancona - Distribuisci ed amministra le tue istanze SQL Serv...
Marco Obinu
 
Women Who Code Connect 2018 Conference
Women Who Code Connect 2018 ConferenceWomen Who Code Connect 2018 Conference
Women Who Code Connect 2018 Conference
Supriya Premkumar
 
Protecting your site by detection
Protecting your site by detectionProtecting your site by detection
Protecting your site by detection
Marko Heijnen
 
Building an API in Node with HapiJS
Building an API in Node with HapiJSBuilding an API in Node with HapiJS
Building an API in Node with HapiJS
Loc Nguyen
 
Serverless architecture: introduction & first steps
Serverless architecture: introduction & first stepsServerless architecture: introduction & first steps
Serverless architecture: introduction & first steps
The Software House
 
Ansible @ Red Hat | December 2015 Ansible Meetup in Melbourne
Ansible @ Red Hat | December 2015 Ansible Meetup in MelbourneAnsible @ Red Hat | December 2015 Ansible Meetup in Melbourne
Ansible @ Red Hat | December 2015 Ansible Meetup in Melbourne
Ken Thompson
 
“ASP.NET Core. Features and architecture”
“ASP.NET Core. Features and architecture” “ASP.NET Core. Features and architecture”
“ASP.NET Core. Features and architecture”
HYS Enterprise
 

Similar to Writing your First Ansible Playbook (20)

Ansible - Hands on Training
Ansible - Hands on TrainingAnsible - Hands on Training
Ansible - Hands on Training
Mehmet Ali Aydın
 
Ansible Tutorial.pdf
Ansible Tutorial.pdfAnsible Tutorial.pdf
Ansible Tutorial.pdf
NigussMehari4
 
Introduction to ansible
Introduction to ansibleIntroduction to ansible
Introduction to ansible
Dharmit Shah
 
MongoDB Ops Manager and Kubernetes - James Broadhead
MongoDB Ops Manager and Kubernetes - James BroadheadMongoDB Ops Manager and Kubernetes - James Broadhead
MongoDB Ops Manager and Kubernetes - James Broadhead
MongoDB
 
Velocity NYC 2016 - Containers @ Netflix
Velocity NYC 2016 - Containers @ NetflixVelocity NYC 2016 - Containers @ Netflix
Velocity NYC 2016 - Containers @ Netflix
aspyker
 
Infrastructure as Code
Infrastructure as CodeInfrastructure as Code
Infrastructure as Code
Albert Suwandhi
 
Ransack, an Application Built on Ansible's API for Rackspace -- AnsibleFest N...
Ransack, an Application Built on Ansible's API for Rackspace -- AnsibleFest N...Ransack, an Application Built on Ansible's API for Rackspace -- AnsibleFest N...
Ransack, an Application Built on Ansible's API for Rackspace -- AnsibleFest N...
Paul Durivage
 
Devops with Python by Yaniv Cohen DevopShift
Devops with Python by Yaniv Cohen DevopShiftDevops with Python by Yaniv Cohen DevopShift
Devops with Python by Yaniv Cohen DevopShift
Yaniv cohen
 
Creating pools of Virtual Machines - ApacheCon NA 2013
Creating pools of Virtual Machines - ApacheCon NA 2013Creating pools of Virtual Machines - ApacheCon NA 2013
Creating pools of Virtual Machines - ApacheCon NA 2013
Andrei Savu
 
Deployment automation
Deployment automationDeployment automation
Deployment automation
Riccardo Lemmi
 
ansible_rhel.pdf
ansible_rhel.pdfansible_rhel.pdf
ansible_rhel.pdf
ssuser6d347b
 
Apache Provisionr (incubating) - Bucharest JUG 10
Apache Provisionr (incubating) - Bucharest JUG 10Apache Provisionr (incubating) - Bucharest JUG 10
Apache Provisionr (incubating) - Bucharest JUG 10
Andrei Savu
 
Backroll: Production Grade KVM Backup Solution Integrated in CloudStack
Backroll: Production Grade KVM Backup Solution Integrated in CloudStackBackroll: Production Grade KVM Backup Solution Integrated in CloudStack
Backroll: Production Grade KVM Backup Solution Integrated in CloudStack
ShapeBlue
 
Ranger admin dev overview
Ranger admin dev overviewRanger admin dev overview
Ranger admin dev overview
Tushar Dudhatra
 
Extending Build to the Client: A Maven User's Guide to Grunt.js
Extending Build to the Client: A Maven User's Guide to Grunt.jsExtending Build to the Client: A Maven User's Guide to Grunt.js
Extending Build to the Client: A Maven User's Guide to Grunt.js
Petr Jiricka
 
Omaha (Google Update) server
Omaha (Google Update) serverOmaha (Google Update) server
Omaha (Google Update) server
Dmitry Lyfar
 
apidays LIVE Paris 2021 - Edge Side APIs by Kevin Dunglas, Les Tilleuls
apidays LIVE Paris 2021 - Edge Side APIs by Kevin Dunglas, Les Tilleulsapidays LIVE Paris 2021 - Edge Side APIs by Kevin Dunglas, Les Tilleuls
apidays LIVE Paris 2021 - Edge Side APIs by Kevin Dunglas, Les Tilleuls
apidays
 
DevOpsDays Taipei 2019 - Mastering IaC the DevOps Way
DevOpsDays Taipei 2019 - Mastering IaC the DevOps WayDevOpsDays Taipei 2019 - Mastering IaC the DevOps Way
DevOpsDays Taipei 2019 - Mastering IaC the DevOps Way
smalltown
 
La sécurité avec Kubernetes et les conteneurs Docker (June 19th, 2019)
La sécurité avec Kubernetes et les conteneurs Docker (June 19th, 2019)La sécurité avec Kubernetes et les conteneurs Docker (June 19th, 2019)
La sécurité avec Kubernetes et les conteneurs Docker (June 19th, 2019)
Alexandre Roman
 
Ansible is the simplest way to automate. SymfonyCafe, 2015
Ansible is the simplest way to automate. SymfonyCafe, 2015Ansible is the simplest way to automate. SymfonyCafe, 2015
Ansible is the simplest way to automate. SymfonyCafe, 2015
Alex S
 
Ansible Tutorial.pdf
Ansible Tutorial.pdfAnsible Tutorial.pdf
Ansible Tutorial.pdf
NigussMehari4
 
Introduction to ansible
Introduction to ansibleIntroduction to ansible
Introduction to ansible
Dharmit Shah
 
MongoDB Ops Manager and Kubernetes - James Broadhead
MongoDB Ops Manager and Kubernetes - James BroadheadMongoDB Ops Manager and Kubernetes - James Broadhead
MongoDB Ops Manager and Kubernetes - James Broadhead
MongoDB
 
Velocity NYC 2016 - Containers @ Netflix
Velocity NYC 2016 - Containers @ NetflixVelocity NYC 2016 - Containers @ Netflix
Velocity NYC 2016 - Containers @ Netflix
aspyker
 
Ransack, an Application Built on Ansible's API for Rackspace -- AnsibleFest N...
Ransack, an Application Built on Ansible's API for Rackspace -- AnsibleFest N...Ransack, an Application Built on Ansible's API for Rackspace -- AnsibleFest N...
Ransack, an Application Built on Ansible's API for Rackspace -- AnsibleFest N...
Paul Durivage
 
Devops with Python by Yaniv Cohen DevopShift
Devops with Python by Yaniv Cohen DevopShiftDevops with Python by Yaniv Cohen DevopShift
Devops with Python by Yaniv Cohen DevopShift
Yaniv cohen
 
Creating pools of Virtual Machines - ApacheCon NA 2013
Creating pools of Virtual Machines - ApacheCon NA 2013Creating pools of Virtual Machines - ApacheCon NA 2013
Creating pools of Virtual Machines - ApacheCon NA 2013
Andrei Savu
 
Apache Provisionr (incubating) - Bucharest JUG 10
Apache Provisionr (incubating) - Bucharest JUG 10Apache Provisionr (incubating) - Bucharest JUG 10
Apache Provisionr (incubating) - Bucharest JUG 10
Andrei Savu
 
Backroll: Production Grade KVM Backup Solution Integrated in CloudStack
Backroll: Production Grade KVM Backup Solution Integrated in CloudStackBackroll: Production Grade KVM Backup Solution Integrated in CloudStack
Backroll: Production Grade KVM Backup Solution Integrated in CloudStack
ShapeBlue
 
Ranger admin dev overview
Ranger admin dev overviewRanger admin dev overview
Ranger admin dev overview
Tushar Dudhatra
 
Extending Build to the Client: A Maven User's Guide to Grunt.js
Extending Build to the Client: A Maven User's Guide to Grunt.jsExtending Build to the Client: A Maven User's Guide to Grunt.js
Extending Build to the Client: A Maven User's Guide to Grunt.js
Petr Jiricka
 
Omaha (Google Update) server
Omaha (Google Update) serverOmaha (Google Update) server
Omaha (Google Update) server
Dmitry Lyfar
 
apidays LIVE Paris 2021 - Edge Side APIs by Kevin Dunglas, Les Tilleuls
apidays LIVE Paris 2021 - Edge Side APIs by Kevin Dunglas, Les Tilleulsapidays LIVE Paris 2021 - Edge Side APIs by Kevin Dunglas, Les Tilleuls
apidays LIVE Paris 2021 - Edge Side APIs by Kevin Dunglas, Les Tilleuls
apidays
 
DevOpsDays Taipei 2019 - Mastering IaC the DevOps Way
DevOpsDays Taipei 2019 - Mastering IaC the DevOps WayDevOpsDays Taipei 2019 - Mastering IaC the DevOps Way
DevOpsDays Taipei 2019 - Mastering IaC the DevOps Way
smalltown
 
La sécurité avec Kubernetes et les conteneurs Docker (June 19th, 2019)
La sécurité avec Kubernetes et les conteneurs Docker (June 19th, 2019)La sécurité avec Kubernetes et les conteneurs Docker (June 19th, 2019)
La sécurité avec Kubernetes et les conteneurs Docker (June 19th, 2019)
Alexandre Roman
 
Ansible is the simplest way to automate. SymfonyCafe, 2015
Ansible is the simplest way to automate. SymfonyCafe, 2015Ansible is the simplest way to automate. SymfonyCafe, 2015
Ansible is the simplest way to automate. SymfonyCafe, 2015
Alex S
 
Ad

Recently uploaded (20)

Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptxSpecial Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
shyamraj55
 
Quantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur MorganQuantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur Morgan
Arthur Morgan
 
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 
HCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser EnvironmentsHCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser Environments
panagenda
 
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
organizerofv
 
Big Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur MorganBig Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur Morgan
Arthur Morgan
 
Cyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of securityCyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of security
riccardosl1
 
Drupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy ConsumptionDrupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy Consumption
Exove
 
How analogue intelligence complements AI
How analogue intelligence complements AIHow analogue intelligence complements AI
How analogue intelligence complements AI
Paul Rowe
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
TrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business ConsultingTrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business Consulting
Trs Labs
 
tecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdftecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdf
fjgm517
 
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager APIUiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPathCommunity
 
Rusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond SparkRusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond Spark
carlyakerly1
 
Procurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptxProcurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptx
Jon Hansen
 
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven InsightsAndrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell
 
Generative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in BusinessGenerative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in Business
Dr. Tathagat Varma
 
Heap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and DeletionHeap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and Deletion
Jaydeep Kale
 
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Aqusag Technologies
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptxSpecial Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
shyamraj55
 
Quantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur MorganQuantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur Morgan
Arthur Morgan
 
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 
HCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser EnvironmentsHCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser Environments
panagenda
 
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
organizerofv
 
Big Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur MorganBig Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur Morgan
Arthur Morgan
 
Cyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of securityCyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of security
riccardosl1
 
Drupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy ConsumptionDrupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy Consumption
Exove
 
How analogue intelligence complements AI
How analogue intelligence complements AIHow analogue intelligence complements AI
How analogue intelligence complements AI
Paul Rowe
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
TrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business ConsultingTrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business Consulting
Trs Labs
 
tecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdftecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdf
fjgm517
 
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager APIUiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPathCommunity
 
Rusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond SparkRusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond Spark
carlyakerly1
 
Procurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptxProcurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptx
Jon Hansen
 
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven InsightsAndrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell
 
Generative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in BusinessGenerative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in Business
Dr. Tathagat Varma
 
Heap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and DeletionHeap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and Deletion
Jaydeep Kale
 
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Aqusag Technologies
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
Ad

Writing your First Ansible Playbook

  • 1. Writing your First Ansible Playbook By Sana Khan
  • 2. About me ➔ Infrastructure Engineer/ SysAdmin ➔ Former Software Developer ➔ GNOME Outreach Intern (2016) - OpenStack ➔ RGSoC Intern (2014)
  • 3. Agenda ➔ Challenges in managing server configurations before Configuration Management tools. ➔ Benefits of Configuration Management tool. ➔ Where does Ansible fit in the suite of IaaC tools? ➔ What are the features of IaaC tools? ➔ Why learn Ansible? ➔ Understanding an Ansible Setup. ➔ Basics concepts of Ansible. ➔ Writing your own Playbook. ➔ Security Best Practices.
  • 4. Before Configuration Management Tools Setup a Webserver (nginx) & an application stack (php) ➔ Step-1: Login to the server ➔ Step-2: Install the nginx package ➔ Step-3: Configure nginx configuration ➔ Step-4: Ensure required users, groups are present ➔ Step-5: Ensure correct permissions, user roles are assigned to conf files. ➔ Step-6: Install php packages ➔ Step-7: Configure the application ➔ Step-8: Configure web server to redirect to application
  • 5. Before Configuration Management Tools -2 ➔ Doable ➔ Couple of servers ➔ The only form of automation available: Bash Scripts ➔ Inconsistent environments Problem: Large groups of servers that need to be managed in a flexible way.
  • 6. Configuration Management Tools - Today Goal: Install, manage software and configuration at scale with ease. ➔ Helps automate Infrastructure ➔ Centralized management ➔ Helps manage Infrastructure at large scale ➔ Consistent environments
  • 7. Where does Ansible fit in suite of IaaC Tools?
  • 8. What are the features of IaaC Tools? ➔ Declarative Syntax (describes the state of the infrastructure) ➔ Code form (revision control) ➔ Idempotence ( current state == desired state )? -> take actions accordingly.
  • 9. Why Ansible? ➔ Learning curve is less, easy to pick it up. ➔ Agentless, only requires Python to be installed on the managed servers. ➔ Modules are written in Python, easily accessible. ➔ Modules that integrate with Cloud Providers like AWS, OpenStack. ➔ Modules for Docker, Ovirt, etc. ➔ Modules for network devices, windows, etc.
  • 10. Ansible Setup Prerequisites: ➔ Python needs to be installed ➔ Sudo user ➔ SSH access
  • 11. Ansible Concepts ➔ Inventory file ➔ Syntax of a YAML file ➔ Tasks ➔ Modules ➔ Ad-Hoc Commands ➔ Playbooks ➔ Roles (Ready to use playbooks - Ansible Galaxy)
  • 12. YAML Basics ➔ All YAML files begin with --- ➔ At basic level YAML file consists of lists and dictionaries. ➔ YAML file starts with a list.
  • 13. YAML Basics -- contd Source: YAML Syntax
  • 14. Demo ➔ Ansible | jonatanblue ➔ https://github.com/sanakhanlibre/Ansible101
  • 15. Security Best Practices ➔ Control Node needs to be secure/hardened. ➔ Don’t use passwords, use Key based Authentication. ➔ Use Ansible Vault for secrets. ➔ Don’t expose sensitive data in Ansible Output. ➔ Verify before using Roles from Ansible Galaxy.