SlideShare a Scribd company logo
1 of 22
Ansible
Hsi-Kai Wang
o Introduction
o Install
o Inventory
o Ad-Hoc/CLI
o Playbook
Outline
© 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY2
o What
• Ansible is an IT automation tool. It can configure systems, deploy software, and orchestrate more
advanced IT tasks such as continuous deployments or zero downtime rolling updates.
o Current version
• Community: Ansible 2.2(stable), 2.3(devel)
• Enterprise: Ansible tower
o Feature
• SSH Protocol
• Agent-less (push mode)
• Idempotent
• Role defined
• DSL: YAML(yml), Jinja2(j2)
Introduction
© 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY3
https://www.ansible.com/
Workflow
© 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY4
control
playbook
managed
ad-hoc/cli
SSH
o Requirements
• Python 2.6, 2.7 for control
• Python 2.4, 2.5 for managed
o # method1: install via yum
centos:~ # yum install epel-release
centos:~ # yum install ansible
o # method2: install via pip
centos:~ # pip install ansible
Install
© 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY5
o Config Order
1. ANSIBLE_CONFIG environment variable
2. ./ansible.cfg
3. ~/.ansible.cfg
4. /etc/ansible/ansible.cfg
o control:~ # cat /etc/ansible/ansible.cfg
[defaults]
ansible_python_interpreter = /usr/bin/python2
nocows = 1
...
Config File
© 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY6
o Main command
• ansible
• ansible-playbook
• ansible-doc
o Other command
• ansible-galaxy
• ansible-pull
• ansible-console
• ansible-vault
Command
© 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY7
Inventory
© 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY8
Ref: http://docs.ansible.com/ansible/intro_inventory.html
host group
group of group
group variable
o control:~ # cat hosts
node1 ansible_ssh_host=192.168.0.11 ansible_ssh_user=root 
ansible_ssh_pass=password ansible_become_pass=password 
node2 ansible_ssh_host=192.168.0.12 ansible_ssh_user=root 
ansible_ssh_private_key_file=private_file
o # run ansible via ad-hoc
control:~ # ansible all -i hosts -m ping -vvv
control:~ # ansible node1 -i hosts -m command -a uptime
Ad-Hoc/CLI
© 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY9
module
host inventory
o Ansible Module
• http://docs.ansible.com/ansible/modules_by_category.html
Module
© 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY10
Module – setup (gather fact)
© 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY11
playbook content
---
- hosts: all
tasks:
- name: Hello World
shell: echo "hello world"
[
{host: "all”},
{
tasks: [
{ name: "Hello World",
shell: "echo "hello world“”}
]
}
]
YAML & JSON
© 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY12
Playbook - content
© 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY13
module
disable gather fact
Playbook - execute
© 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY14
Playbook - vars
© 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY15
Playbook - example
© 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY16
copy file from control to managed
loop
notify
condition
Playbook - roles
© 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY17
Directory Structure
© 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY18
Playbook - tags
© 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY19
Playbook - tasks
© 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY20
o Ansible
o Ansible Document
o Ansible: Up and Running
o 現代 IT 人一定要知道的 Ansible 自動化組態技巧
Reference
© 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY21
Thank you!
© 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY
@ruckuswirelessfacebook.com/ruckuswirelesswww.ruckuswireless.com
22

More Related Content

What's hot

What's hot (20)

Ansible best practices
Ansible best practicesAnsible best practices
Ansible best practices
 
Introduction to Ansible
Introduction to AnsibleIntroduction to Ansible
Introduction to Ansible
 
Ansible Introduction - Ansible Brno #1 - David Karban
Ansible Introduction - Ansible Brno #1 - David KarbanAnsible Introduction - Ansible Brno #1 - David Karban
Ansible Introduction - Ansible Brno #1 - David Karban
 
Ansible roles done right
Ansible roles done rightAnsible roles done right
Ansible roles done right
 
Ansible presentation
Ansible presentationAnsible presentation
Ansible presentation
 
Ansible, best practices
Ansible, best practicesAnsible, best practices
Ansible, best practices
 
Jenkins and ansible reference
Jenkins and ansible referenceJenkins and ansible reference
Jenkins and ansible reference
 
Getting Started with Ansible
Getting Started with AnsibleGetting Started with Ansible
Getting Started with Ansible
 
Using Ansible Dynamic Inventory with Amazon EC2
Using Ansible Dynamic Inventory with Amazon EC2Using Ansible Dynamic Inventory with Amazon EC2
Using Ansible Dynamic Inventory with Amazon EC2
 
Ansible presentation
Ansible presentationAnsible presentation
Ansible presentation
 
Ansible - Introduction
Ansible - IntroductionAnsible - Introduction
Ansible - Introduction
 
Ansible is the simplest way to automate. MoldCamp, 2015
Ansible is the simplest way to automate. MoldCamp, 2015Ansible is the simplest way to automate. MoldCamp, 2015
Ansible is the simplest way to automate. MoldCamp, 2015
 
Ansible Automation Best Practices From Startups to Enterprises - Minnebar 12
Ansible Automation Best Practices From Startups to Enterprises - Minnebar 12Ansible Automation Best Practices From Startups to Enterprises - Minnebar 12
Ansible Automation Best Practices From Startups to Enterprises - Minnebar 12
 
Ansible 101
Ansible 101Ansible 101
Ansible 101
 
#OktoCampus - Workshop : An introduction to Ansible
#OktoCampus - Workshop : An introduction to Ansible#OktoCampus - Workshop : An introduction to Ansible
#OktoCampus - Workshop : An introduction to Ansible
 
Ansible introduction - XX Betabeers Galicia
Ansible introduction - XX Betabeers GaliciaAnsible introduction - XX Betabeers Galicia
Ansible introduction - XX Betabeers Galicia
 
DevOpsDaysCPT Ansible Infrastrucutre as Code 2017
DevOpsDaysCPT Ansible Infrastrucutre as Code 2017DevOpsDaysCPT Ansible Infrastrucutre as Code 2017
DevOpsDaysCPT Ansible Infrastrucutre as Code 2017
 
Automation with ansible
Automation with ansibleAutomation with ansible
Automation with ansible
 
Learn basic ansible using docker
Learn basic ansible using dockerLearn basic ansible using docker
Learn basic ansible using docker
 
Ansible for beginners
Ansible for beginnersAnsible for beginners
Ansible for beginners
 

Viewers also liked

An Introduction to Maven
An Introduction to MavenAn Introduction to Maven
An Introduction to Maven
Vadym Lotar
 
Busque, Compare Y Si Encuentra Algo Mejor3
Busque, Compare Y Si Encuentra Algo Mejor3Busque, Compare Y Si Encuentra Algo Mejor3
Busque, Compare Y Si Encuentra Algo Mejor3
guest9e6bc3
 
Concorrencia geral UFPE 2014
Concorrencia geral UFPE 2014Concorrencia geral UFPE 2014
Concorrencia geral UFPE 2014
Portal NE10
 
Estructura atómica 1º
Estructura atómica 1ºEstructura atómica 1º
Estructura atómica 1º
jpache80
 

Viewers also liked (20)

Ansible Tower - Drew Bomhof, Brandon Dunne - ManageIQ Design Summit 2016
Ansible Tower - Drew Bomhof, Brandon Dunne - ManageIQ Design Summit 2016Ansible Tower - Drew Bomhof, Brandon Dunne - ManageIQ Design Summit 2016
Ansible Tower - Drew Bomhof, Brandon Dunne - ManageIQ Design Summit 2016
 
Phantom app: Ansible Tower
Phantom app:  Ansible TowerPhantom app:  Ansible Tower
Phantom app: Ansible Tower
 
Du cycle en V à DevOps, en passant par agile - Normation
Du cycle en V à DevOps, en passant par agile - NormationDu cycle en V à DevOps, en passant par agile - Normation
Du cycle en V à DevOps, en passant par agile - Normation
 
An Introduction to Maven
An Introduction to MavenAn Introduction to Maven
An Introduction to Maven
 
Ansible loves Python, Python Philadelphia meetup
Ansible loves Python, Python Philadelphia meetupAnsible loves Python, Python Philadelphia meetup
Ansible loves Python, Python Philadelphia meetup
 
Network Automation: Ansible 102
Network Automation: Ansible 102Network Automation: Ansible 102
Network Automation: Ansible 102
 
Busque, Compare Y Si Encuentra Algo Mejor3
Busque, Compare Y Si Encuentra Algo Mejor3Busque, Compare Y Si Encuentra Algo Mejor3
Busque, Compare Y Si Encuentra Algo Mejor3
 
2016/01/04付 オリジナルiTunes週間トップソングトピックス
2016/01/04付 オリジナルiTunes週間トップソングトピックス2016/01/04付 オリジナルiTunes週間トップソングトピックス
2016/01/04付 オリジナルiTunes週間トップソングトピックス
 
Test
TestTest
Test
 
88L10 MARINE CERT
88L10 MARINE CERT88L10 MARINE CERT
88L10 MARINE CERT
 
Krasjkurs i twitter. Forskningskommunikasjon i sosiale medier
Krasjkurs i twitter. Forskningskommunikasjon i sosiale medier Krasjkurs i twitter. Forskningskommunikasjon i sosiale medier
Krasjkurs i twitter. Forskningskommunikasjon i sosiale medier
 
Concorrencia geral UFPE 2014
Concorrencia geral UFPE 2014Concorrencia geral UFPE 2014
Concorrencia geral UFPE 2014
 
All Tomorrow's Programs: New Modes of Librarian Engagement and Student Collab...
All Tomorrow's Programs: New Modes of Librarian Engagement and Student Collab...All Tomorrow's Programs: New Modes of Librarian Engagement and Student Collab...
All Tomorrow's Programs: New Modes of Librarian Engagement and Student Collab...
 
Outubro rosa 15.10
Outubro rosa 15.10Outubro rosa 15.10
Outubro rosa 15.10
 
Outsourcing de exploración en Argentina
Outsourcing de exploración en ArgentinaOutsourcing de exploración en Argentina
Outsourcing de exploración en Argentina
 
QI, not QA
QI, not QAQI, not QA
QI, not QA
 
Estructura atómica 1º
Estructura atómica 1ºEstructura atómica 1º
Estructura atómica 1º
 
Consolidating your Services Portfolio with GFI MAX - Jason Parsons and Steve ...
Consolidating your Services Portfolio with GFI MAX - Jason Parsons and Steve ...Consolidating your Services Portfolio with GFI MAX - Jason Parsons and Steve ...
Consolidating your Services Portfolio with GFI MAX - Jason Parsons and Steve ...
 
BubbleMap Application
BubbleMap ApplicationBubbleMap Application
BubbleMap Application
 
2015/09/28付 オリジナルiTunes週間トップソングトピックス
2015/09/28付 オリジナルiTunes週間トップソングトピックス2015/09/28付 オリジナルiTunes週間トップソングトピックス
2015/09/28付 オリジナルiTunes週間トップソングトピックス
 

Similar to Ansible intro

Ansible automation sa technical deck q2 fy19
Ansible automation sa technical deck q2 fy19Ansible automation sa technical deck q2 fy19
Ansible automation sa technical deck q2 fy19
dvillaco
 

Similar to Ansible intro (20)

Ansible automation sa technical deck q2 fy19
Ansible automation sa technical deck q2 fy19Ansible automation sa technical deck q2 fy19
Ansible automation sa technical deck q2 fy19
 
Automação do físico ao NetSecDevOps
Automação do físico ao NetSecDevOpsAutomação do físico ao NetSecDevOps
Automação do físico ao NetSecDevOps
 
Nagios intro
Nagios intro Nagios intro
Nagios intro
 
Ansible & Salt - Vincent Boon
Ansible & Salt - Vincent BoonAnsible & Salt - Vincent Boon
Ansible & Salt - Vincent Boon
 
Automation day red hat ansible
   Automation day red hat ansible    Automation day red hat ansible
Automation day red hat ansible
 
Splunk n-box-splunk conf-2017
Splunk n-box-splunk conf-2017Splunk n-box-splunk conf-2017
Splunk n-box-splunk conf-2017
 
CloudOpen 2014 - Extending Cloud Automation, When OpenStack Meets Ansible
CloudOpen 2014 - Extending Cloud Automation, When OpenStack Meets AnsibleCloudOpen 2014 - Extending Cloud Automation, When OpenStack Meets Ansible
CloudOpen 2014 - Extending Cloud Automation, When OpenStack Meets Ansible
 
Getting to the Next Level with Eclipse Concierge - Jan Rellermeyer + Tim Verb...
Getting to the Next Level with Eclipse Concierge - Jan Rellermeyer + Tim Verb...Getting to the Next Level with Eclipse Concierge - Jan Rellermeyer + Tim Verb...
Getting to the Next Level with Eclipse Concierge - Jan Rellermeyer + Tim Verb...
 
Ansible101
Ansible101Ansible101
Ansible101
 
Install MariaDB on IBM i - Tips, troubleshooting, and more
Install MariaDB on IBM i - Tips, troubleshooting, and moreInstall MariaDB on IBM i - Tips, troubleshooting, and more
Install MariaDB on IBM i - Tips, troubleshooting, and more
 
How to deploy spark instance using ansible 2.0 in fiware lab v2
How to deploy spark instance using ansible 2.0 in fiware lab v2How to deploy spark instance using ansible 2.0 in fiware lab v2
How to deploy spark instance using ansible 2.0 in fiware lab v2
 
How to Deploy Spark Instance Using Ansible 2.0 in FIWARE Lab
How to Deploy Spark Instance Using Ansible 2.0 in FIWARE LabHow to Deploy Spark Instance Using Ansible 2.0 in FIWARE Lab
How to Deploy Spark Instance Using Ansible 2.0 in FIWARE Lab
 
Fuel Plugins
Fuel PluginsFuel Plugins
Fuel Plugins
 
PHP Installed on IBM i - the Nickel Tour
PHP Installed on IBM i - the Nickel TourPHP Installed on IBM i - the Nickel Tour
PHP Installed on IBM i - the Nickel Tour
 
Lessons Learned: Using Concourse In Production
Lessons Learned: Using Concourse In ProductionLessons Learned: Using Concourse In Production
Lessons Learned: Using Concourse In Production
 
Introduction to Ansible. Meetup Infracoders
Introduction to Ansible. Meetup InfracodersIntroduction to Ansible. Meetup Infracoders
Introduction to Ansible. Meetup Infracoders
 
OpenNMS - Jeff Gehlbach - ManageIQ Design Summit 2016
OpenNMS - Jeff Gehlbach - ManageIQ Design Summit 2016OpenNMS - Jeff Gehlbach - ManageIQ Design Summit 2016
OpenNMS - Jeff Gehlbach - ManageIQ Design Summit 2016
 
06 network automationwithansible
06 network automationwithansible06 network automationwithansible
06 network automationwithansible
 
Snap - the universal packaging format for linux distros
Snap - the universal packaging format for linux distrosSnap - the universal packaging format for linux distros
Snap - the universal packaging format for linux distros
 
Ansible intro
Ansible introAnsible intro
Ansible intro
 

Recently uploaded

Recently uploaded (20)

2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 

Ansible intro

  • 2. o Introduction o Install o Inventory o Ad-Hoc/CLI o Playbook Outline © 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY2
  • 3. o What • Ansible is an IT automation tool. It can configure systems, deploy software, and orchestrate more advanced IT tasks such as continuous deployments or zero downtime rolling updates. o Current version • Community: Ansible 2.2(stable), 2.3(devel) • Enterprise: Ansible tower o Feature • SSH Protocol • Agent-less (push mode) • Idempotent • Role defined • DSL: YAML(yml), Jinja2(j2) Introduction © 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY3 https://www.ansible.com/
  • 4. Workflow © 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY4 control playbook managed ad-hoc/cli SSH
  • 5. o Requirements • Python 2.6, 2.7 for control • Python 2.4, 2.5 for managed o # method1: install via yum centos:~ # yum install epel-release centos:~ # yum install ansible o # method2: install via pip centos:~ # pip install ansible Install © 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY5
  • 6. o Config Order 1. ANSIBLE_CONFIG environment variable 2. ./ansible.cfg 3. ~/.ansible.cfg 4. /etc/ansible/ansible.cfg o control:~ # cat /etc/ansible/ansible.cfg [defaults] ansible_python_interpreter = /usr/bin/python2 nocows = 1 ... Config File © 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY6
  • 7. o Main command • ansible • ansible-playbook • ansible-doc o Other command • ansible-galaxy • ansible-pull • ansible-console • ansible-vault Command © 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY7
  • 8. Inventory © 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY8 Ref: http://docs.ansible.com/ansible/intro_inventory.html host group group of group group variable
  • 9. o control:~ # cat hosts node1 ansible_ssh_host=192.168.0.11 ansible_ssh_user=root ansible_ssh_pass=password ansible_become_pass=password node2 ansible_ssh_host=192.168.0.12 ansible_ssh_user=root ansible_ssh_private_key_file=private_file o # run ansible via ad-hoc control:~ # ansible all -i hosts -m ping -vvv control:~ # ansible node1 -i hosts -m command -a uptime Ad-Hoc/CLI © 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY9 module host inventory
  • 10. o Ansible Module • http://docs.ansible.com/ansible/modules_by_category.html Module © 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY10
  • 11. Module – setup (gather fact) © 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY11 playbook content
  • 12. --- - hosts: all tasks: - name: Hello World shell: echo "hello world" [ {host: "all”}, { tasks: [ { name: "Hello World", shell: "echo "hello world“”} ] } ] YAML & JSON © 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY12
  • 13. Playbook - content © 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY13 module disable gather fact
  • 14. Playbook - execute © 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY14
  • 15. Playbook - vars © 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY15
  • 16. Playbook - example © 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY16 copy file from control to managed loop notify condition
  • 17. Playbook - roles © 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY17
  • 18. Directory Structure © 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY18
  • 19. Playbook - tags © 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY19
  • 20. Playbook - tasks © 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY20
  • 21. o Ansible o Ansible Document o Ansible: Up and Running o 現代 IT 人一定要知道的 Ansible 自動化組態技巧 Reference © 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY21
  • 22. Thank you! © 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY @ruckuswirelessfacebook.com/ruckuswirelesswww.ruckuswireless.com 22