SlideShare uma empresa Scribd logo
1 de 17
Anxious about DevOps
management & deploy ?
DevOps made simple.
@baiolo
http://www.ansible.com/home
From the main website:
“Deploy apps.
Manage systems. Crush complexity.
Ansible is a powerful automation tool that you can
learn quickly.”
https://github.com/ansible/ansible
“Ansible is a radically simple IT automation platform ...
Avoid writing scripts or custom code ... automate in a
language that approaches plain English, using SSH,
with no agents to install on remote systems.”
The Octocat says:
Some design principles:
Manage machines very quickly and in parallel.
Avoid custom-agents and additional open ports, be agentless by leveraging the
existing SSH daemon.
Describe infrastructure in a language that is both machine and human friendly.
Manage new remote machines instantly, without bootstrapping any software.
Allow module development in any dynamic language.
Ok, so it seems so damn’ c00l ! Install !
$ git clone git://github.com/ansible/ansible.git --recursive
$ cd ./ansible
$ source ./hacking/env-setup
You can use the dev release to get latest features & bugfix.
Root permissions are not required.
No daemons or database setup are required.
Install, take two:
$ sudo aptitude install ansible
And then let’s roll:
Create /etc/ansible/hosts and put one or more remote systems in it.
Your public SSH key should be located in authorized_keys on those systems.
[aruba]
ext-ubudb01
ext-ubudb02
ext-ubudemo01
ext-debweb01
Inventory
[webservers]
foo.example.com
bar.example.com
[dbservers]
one.example.com
two.example.com
three.example.com
Inventory… a bit more
[webservers]
www[01:50].example.com
[databases]
db-[a:f].example.com
My first ansible command:
$ ansible all -m ping -u root
Answer:
...
ext-ubudb01 | FAILED => SSH encountered an unknown error...
ext-ubudb02 | success >> {
"changed": false,
"ping": "pong"
}
...
My second ansible command:
$ ansible all -a "/bin/echo hello"
Answer:
...
ext-ubudb02 | success | rc=0 >>
hello
ext-ubudemo01 | success | rc=0 >>
hello
...
Modules:
ansible webservers -m service -a "name=httpd
state=started"
ansible webservers -m ping
ansible webservers -m command -a "/sbin/reboot -t now"
Modules… just a index:
Cloud Modules
Commands Modules
Database Modules
Files Modules
Inventory Modules
Messaging Modules
Monitoring Modules
Network Modules
Notification Modules
Packaging Modules
Source Control Modules
System Modules
Utilities Modules
Web Infrastructure Modules
Windows Modules
Modules… some file modules:
acl - Sets and retrieves file ACL information.
assemble - Assembles a configuration file from fragments
copy - Copies files to remote locations.
fetch - Fetches a file from remote nodes
file - Sets attributes of files
find - return a list of files based on specific criteria
...
Last piece: PlayBooks
Playbooks are Ansible’s configuration, deployment, and
orchestration language.
They can describe a policy you want your remote
systems to enforce, or a set of steps in a general IT
process.
Last piece: PlayBooks
github.com/ansible/ansible-examples/blob/master/lamp_simple/site.yml
# This playbook deploys the whole application stack in this site.
- name: apply common configuration to all nodes
hosts: all
remote_user: root
roles:
- common
- name: configure and deploy the webservers and application code
hosts: webservers
remote_user: root
roles:
- web
- name: deploy MySQL and configure the databases
hosts: dbservers
remote_user: root
roles:
- db
Last piece: PlayBooks
##
# Example Ansible playbook that uses the MySQL module.
#
- hosts: all
user: root
tasks:
- name: Create database user
mysql_user: user=bob password=12345 priv=*.*:ALL state=present
- name: Create database
mysql_db: db=bobdata state=present
- name: Ensure no user named 'sally' exists and delete if found.
mysql_user: user=sally state=absent
That’s All !
and don’t be
anxious !

Mais conteúdo relacionado

Mais procurados

Ansible Tutorial For Beginners | What Is Ansible And How It Works? | Ansible ...
Ansible Tutorial For Beginners | What Is Ansible And How It Works? | Ansible ...Ansible Tutorial For Beginners | What Is Ansible And How It Works? | Ansible ...
Ansible Tutorial For Beginners | What Is Ansible And How It Works? | Ansible ...
Simplilearn
 
Backbone.js and rails - BanLV
Backbone.js and rails - BanLVBackbone.js and rails - BanLV
Backbone.js and rails - BanLV
Framgia Vietnam
 
What is new in PHP 5.5 - HuyenNT
What is new in PHP 5.5 - HuyenNTWhat is new in PHP 5.5 - HuyenNT
What is new in PHP 5.5 - HuyenNT
Framgia Vietnam
 

Mais procurados (20)

Ansible Tutorial For Beginners | What Is Ansible And How It Works? | Ansible ...
Ansible Tutorial For Beginners | What Is Ansible And How It Works? | Ansible ...Ansible Tutorial For Beginners | What Is Ansible And How It Works? | Ansible ...
Ansible Tutorial For Beginners | What Is Ansible And How It Works? | Ansible ...
 
DEPLOYING WORDPRESS BLOG USING DOCKER COMPOSE & ANSIBLE ON AWS​
DEPLOYING WORDPRESS BLOG USING DOCKER COMPOSE & ANSIBLE ON AWS​DEPLOYING WORDPRESS BLOG USING DOCKER COMPOSE & ANSIBLE ON AWS​
DEPLOYING WORDPRESS BLOG USING DOCKER COMPOSE & ANSIBLE ON AWS​
 
Backbone.js and rails - BanLV
Backbone.js and rails - BanLVBackbone.js and rails - BanLV
Backbone.js and rails - BanLV
 
Advance discussion on Ansible - Rahul Inti
Advance discussion on Ansible - Rahul IntiAdvance discussion on Ansible - Rahul Inti
Advance discussion on Ansible - Rahul Inti
 
Ansible container
Ansible containerAnsible container
Ansible container
 
Automation with ansible
Automation with ansibleAutomation with ansible
Automation with ansible
 
Automating with Ansible
Automating with AnsibleAutomating with Ansible
Automating with Ansible
 
Introduction to ansible
Introduction to ansibleIntroduction to ansible
Introduction to ansible
 
Ansible
AnsibleAnsible
Ansible
 
What is new in PHP 5.5 - HuyenNT
What is new in PHP 5.5 - HuyenNTWhat is new in PHP 5.5 - HuyenNT
What is new in PHP 5.5 - HuyenNT
 
Ansible whirlwind tour
Ansible whirlwind tourAnsible whirlwind tour
Ansible whirlwind tour
 
Puppet - an introduction
Puppet - an introductionPuppet - an introduction
Puppet - an introduction
 
Basics of Ansible - Sahil Davawala
Basics of Ansible - Sahil DavawalaBasics of Ansible - Sahil Davawala
Basics of Ansible - Sahil Davawala
 
Introduction to ansible
Introduction to ansibleIntroduction to ansible
Introduction to ansible
 
A Networking View for the DevOps Crew: SDN
A Networking View for the DevOps Crew: SDNA Networking View for the DevOps Crew: SDN
A Networking View for the DevOps Crew: SDN
 
Python for the Network Nerd
Python for the Network NerdPython for the Network Nerd
Python for the Network Nerd
 
Puppet Camp DC 2015: Distributed OpenSCAP Compliance Validation with MCollective
Puppet Camp DC 2015: Distributed OpenSCAP Compliance Validation with MCollectivePuppet Camp DC 2015: Distributed OpenSCAP Compliance Validation with MCollective
Puppet Camp DC 2015: Distributed OpenSCAP Compliance Validation with MCollective
 
Using Capifony for Symfony apps deployment (updated)
Using Capifony for Symfony apps deployment (updated)Using Capifony for Symfony apps deployment (updated)
Using Capifony for Symfony apps deployment (updated)
 
Openbar 5 - Leuven - Automating everything with Ansible - Piros
Openbar 5 - Leuven - Automating everything with Ansible - PirosOpenbar 5 - Leuven - Automating everything with Ansible - Piros
Openbar 5 - Leuven - Automating everything with Ansible - Piros
 
Hands on ansible
Hands on ansibleHands on ansible
Hands on ansible
 

Semelhante a Ansible Hands On

Ansible automation tool with modules
Ansible automation tool with modulesAnsible automation tool with modules
Ansible automation tool with modules
mohamedmoharam
 

Semelhante a Ansible Hands On (20)

Ansible automation tool with modules
Ansible automation tool with modulesAnsible automation tool with modules
Ansible automation tool with modules
 
Ansible - Hands on Training
Ansible - Hands on TrainingAnsible - Hands on Training
Ansible - Hands on Training
 
Containerization is more than the new Virtualization: enabling separation of ...
Containerization is more than the new Virtualization: enabling separation of ...Containerization is more than the new Virtualization: enabling separation of ...
Containerization is more than the new Virtualization: enabling separation of ...
 
Ansible Tutorial.pdf
Ansible Tutorial.pdfAnsible Tutorial.pdf
Ansible Tutorial.pdf
 
Docker - Demo on PHP Application deployment
Docker - Demo on PHP Application deployment Docker - Demo on PHP Application deployment
Docker - Demo on PHP Application deployment
 
Module 4 Embedded Linux
Module 4 Embedded LinuxModule 4 Embedded Linux
Module 4 Embedded Linux
 
Containerization Is More than the New Virtualization
Containerization Is More than the New VirtualizationContainerization Is More than the New Virtualization
Containerization Is More than the New Virtualization
 
Unit 6 Operating System TEIT Savitribai Phule Pune University by Tushar B Kute
Unit 6 Operating System TEIT Savitribai Phule Pune University by Tushar B KuteUnit 6 Operating System TEIT Savitribai Phule Pune University by Tushar B Kute
Unit 6 Operating System TEIT Savitribai Phule Pune University by Tushar B Kute
 
06 network automationwithansible
06 network automationwithansible06 network automationwithansible
06 network automationwithansible
 
Weave User Group Talk - DockerCon 2017 Recap
Weave User Group Talk - DockerCon 2017 RecapWeave User Group Talk - DockerCon 2017 Recap
Weave User Group Talk - DockerCon 2017 Recap
 
ansible_rhel.pdf
ansible_rhel.pdfansible_rhel.pdf
ansible_rhel.pdf
 
Lightweight Virtualization in Linux
Lightweight Virtualization in LinuxLightweight Virtualization in Linux
Lightweight Virtualization in Linux
 
Deploying Symfony2 app with Ansible
Deploying Symfony2 app with AnsibleDeploying Symfony2 app with Ansible
Deploying Symfony2 app with Ansible
 
IBM Index 2018 Conference Workshop: Modernizing Traditional Java App's with D...
IBM Index 2018 Conference Workshop: Modernizing Traditional Java App's with D...IBM Index 2018 Conference Workshop: Modernizing Traditional Java App's with D...
IBM Index 2018 Conference Workshop: Modernizing Traditional Java App's with D...
 
Docker-v3.pdf
Docker-v3.pdfDocker-v3.pdf
Docker-v3.pdf
 
Linux containers and docker
Linux containers and dockerLinux containers and docker
Linux containers and docker
 
CoreOS and cloud provider integration: simple cloud-init example at Exoscale
CoreOS and cloud provider integration: simple cloud-init example at ExoscaleCoreOS and cloud provider integration: simple cloud-init example at Exoscale
CoreOS and cloud provider integration: simple cloud-init example at Exoscale
 
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
 
Linux Kernel Development
Linux Kernel DevelopmentLinux Kernel Development
Linux Kernel Development
 
Ansible intro
Ansible introAnsible intro
Ansible intro
 

Último

+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
anilsa9823
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
mohitmore19
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
anilsa9823
 

Último (20)

call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 

Ansible Hands On

  • 1. Anxious about DevOps management & deploy ? DevOps made simple. @baiolo
  • 2. http://www.ansible.com/home From the main website: “Deploy apps. Manage systems. Crush complexity. Ansible is a powerful automation tool that you can learn quickly.”
  • 3. https://github.com/ansible/ansible “Ansible is a radically simple IT automation platform ... Avoid writing scripts or custom code ... automate in a language that approaches plain English, using SSH, with no agents to install on remote systems.” The Octocat says:
  • 4. Some design principles: Manage machines very quickly and in parallel. Avoid custom-agents and additional open ports, be agentless by leveraging the existing SSH daemon. Describe infrastructure in a language that is both machine and human friendly. Manage new remote machines instantly, without bootstrapping any software. Allow module development in any dynamic language.
  • 5. Ok, so it seems so damn’ c00l ! Install ! $ git clone git://github.com/ansible/ansible.git --recursive $ cd ./ansible $ source ./hacking/env-setup You can use the dev release to get latest features & bugfix. Root permissions are not required. No daemons or database setup are required. Install, take two: $ sudo aptitude install ansible
  • 6. And then let’s roll: Create /etc/ansible/hosts and put one or more remote systems in it. Your public SSH key should be located in authorized_keys on those systems. [aruba] ext-ubudb01 ext-ubudb02 ext-ubudemo01 ext-debweb01
  • 8. Inventory… a bit more [webservers] www[01:50].example.com [databases] db-[a:f].example.com
  • 9. My first ansible command: $ ansible all -m ping -u root Answer: ... ext-ubudb01 | FAILED => SSH encountered an unknown error... ext-ubudb02 | success >> { "changed": false, "ping": "pong" } ...
  • 10. My second ansible command: $ ansible all -a "/bin/echo hello" Answer: ... ext-ubudb02 | success | rc=0 >> hello ext-ubudemo01 | success | rc=0 >> hello ...
  • 11. Modules: ansible webservers -m service -a "name=httpd state=started" ansible webservers -m ping ansible webservers -m command -a "/sbin/reboot -t now"
  • 12. Modules… just a index: Cloud Modules Commands Modules Database Modules Files Modules Inventory Modules Messaging Modules Monitoring Modules Network Modules Notification Modules Packaging Modules Source Control Modules System Modules Utilities Modules Web Infrastructure Modules Windows Modules
  • 13. Modules… some file modules: acl - Sets and retrieves file ACL information. assemble - Assembles a configuration file from fragments copy - Copies files to remote locations. fetch - Fetches a file from remote nodes file - Sets attributes of files find - return a list of files based on specific criteria ...
  • 14. Last piece: PlayBooks Playbooks are Ansible’s configuration, deployment, and orchestration language. They can describe a policy you want your remote systems to enforce, or a set of steps in a general IT process.
  • 15. Last piece: PlayBooks github.com/ansible/ansible-examples/blob/master/lamp_simple/site.yml # This playbook deploys the whole application stack in this site. - name: apply common configuration to all nodes hosts: all remote_user: root roles: - common - name: configure and deploy the webservers and application code hosts: webservers remote_user: root roles: - web - name: deploy MySQL and configure the databases hosts: dbservers remote_user: root roles: - db
  • 16. Last piece: PlayBooks ## # Example Ansible playbook that uses the MySQL module. # - hosts: all user: root tasks: - name: Create database user mysql_user: user=bob password=12345 priv=*.*:ALL state=present - name: Create database mysql_db: db=bobdata state=present - name: Ensure no user named 'sally' exists and delete if found. mysql_user: user=sally state=absent
  • 17. That’s All ! and don’t be anxious !