SlideShare a Scribd company logo
1 of 20
Download to read offline
Ansible Meetup
Kickoff
So I want to batch run this thing...
Do the API servers in production have a clock skew
problem? Quick check.
ansible -i prod api -a date
These commands look similar...
Classic nodejs deploy:
ssh prod-api-1
cd /opt/myapp
git pull
npm install
sudo service myapp restart
… for each prod-api-* ...
Make them a playbook
- hosts: api
vars:
app: myapp
tasks:
- name: clone from git
git: repo=”git@github.com:bigpandaio/{{app}}" dest=”/opt/
{{app}}"
- name: npm install
command: npm install --production
- name: restart service
service: name=”{{app}}” state=restarted
sudo: yes
But wait! My deployment also needs...
HipChat notification
tasks:
- hipchat: room=ops token={{token}} msg=”
Starting deploy”
...rest of playbook...
But wait! My deployment also needs...
Remove from ELB:
tasks:
- local_action:
module: ec2_elb
region: “{{region}}”
instance_id: “{{ec2_id}}”
ec2_elbs: “{{elb_name}}”
state: absent
But wait! My deployment also needs...
Re-add to ELB:
...
- local_action:
module: ec2_elb
region: “{{region}}”
instance_id: “{{ec2_id}}”
ec2_elbs: “{{elb_name}}”
state: present
But wait! My deployment also needs...
Notify BigPanda (*wink* *tug*)
- bigpanda: component={{app}} version=
{{version}} state=started
…
- bigpanda: component={{app}} version=
{{version}} state=finished
Some velvet morning...
Quick heartbleed patch
- hosts: frontend
sudo: yes
serial: 1
tasks:
- name: Unregister machine from elb
local_action:
…
- apt: pkg=libssl1.0.0 state=latest update_cache=yes
- service: name=nginx state=restarted
- name: Add machine to elb
local_action:
…
Grouping tasks into components
● Ansible’s solution is roles
● A role can be an app, service, common settings
○ roles/app1
○ roles/app2
○ roles/rabbitmq
○ roles/mongodb
○ roles/maintenance_cronjobs
My apps’ roles look the same!
● Use a generic parametrized role
● roles/nodejs_app
○ notifies bigpanda
○ git pull {{app}}
○ npm install
○ service {{app}} restart
○ self test the {{app}} service
● Specific roles depend on it
Deploying to stage with same roles
Use a different inventory for prod and stage:
ansible-playbook -i prod api.yml
ansible-playbook -i stage api.yml
Deploy ALL THE THINGS!
site.yml:
- include: api.yml
- include: mongodb.yml
- include: frontend.yml
Deploy some of the things
Tag all of your tasks/roles with their relevant app/service
name
- { role: app1, tags: app1 }
- name: Generate configuration
template: src=config.j2 dest=/dest/path
tags: [ myservice_config, myservice ]
Deploy some of the things
Then you can:
ansible-playbook -i prod site.yml --tags
app1
Or even:
alias deploy-prod=’ansible-playbook -i prod
site.yml --tags’
deploy-prod app1
..aaahhhhh..
And the logical conclusion
Provision a server in EC2
● The ec2 module creates new instances
● We have the rest of the config as roles
● Simple solution:
ansible-playbook -i prod ec2_create.yml -e
type=frontend
ansible-playbook -i prod site.yml --limit
frontend
Provision a DC
Same thing really:
for i in frontend api mongodb; do
ansible-playbook -i prod ec2_create -e
type=$i
done
ansible-playbook -i prod site.yml
Thanks!
Questions?

More Related Content

What's hot

Reduce dependency on Rx with Kotlin Coroutines
Reduce dependency on Rx with Kotlin CoroutinesReduce dependency on Rx with Kotlin Coroutines
Reduce dependency on Rx with Kotlin CoroutinesLINE Corporation
 
!!Con - The Creative Programmer
!!Con - The Creative Programmer!!Con - The Creative Programmer
!!Con - The Creative ProgrammerCatt Small
 
Gigigo Rails Workshop
Gigigo Rails WorkshopGigigo Rails Workshop
Gigigo Rails WorkshopAlex Rupérez
 
Leo Burnett: Augmented Reality — версия для Adobe Flash и AIR on Mobiles
 Leo Burnett: Augmented Reality — версия для Adobe Flash и AIR on Mobiles Leo Burnett: Augmented Reality — версия для Adobe Flash и AIR on Mobiles
Leo Burnett: Augmented Reality — версия для Adobe Flash и AIR on MobilesDevGAMM Conference
 
ServiceWorker: Exploring the Core of the Progressive Web App-Bagus Aji Santos...
ServiceWorker: Exploring the Core of the Progressive Web App-Bagus Aji Santos...ServiceWorker: Exploring the Core of the Progressive Web App-Bagus Aji Santos...
ServiceWorker: Exploring the Core of the Progressive Web App-Bagus Aji Santos...DicodingEvent
 
Wire once, rewire twice! (Haskell exchange-2018)
Wire once, rewire twice! (Haskell exchange-2018)Wire once, rewire twice! (Haskell exchange-2018)
Wire once, rewire twice! (Haskell exchange-2018)Eric Torreborre
 
Coffee script grunt
Coffee script gruntCoffee script grunt
Coffee script gruntKien Pham
 
Gearman bundle, Warszawa 2013 edition
Gearman bundle, Warszawa 2013 editionGearman bundle, Warszawa 2013 edition
Gearman bundle, Warszawa 2013 editionMarc Morera
 
Frontend Finesse with Angular & Rails 4
Frontend Finesse with Angular & Rails 4Frontend Finesse with Angular & Rails 4
Frontend Finesse with Angular & Rails 4undecisive
 
Finagle - an intro to rpc & a sync programming in jvm
Finagle - an intro to rpc & a sync programming in jvmFinagle - an intro to rpc & a sync programming in jvm
Finagle - an intro to rpc & a sync programming in jvmPrasannaKumar Sathyanarayanan
 
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​Ramit Surana
 
ServiceWorkerとES6 Modules時代のTypescript開発考察
ServiceWorkerとES6 Modules時代のTypescript開発考察ServiceWorkerとES6 Modules時代のTypescript開発考察
ServiceWorkerとES6 Modules時代のTypescript開発考察Taketoshi 青野健利
 
Cross Platform Mobile Automation with Calabash on Cloud and More
Cross Platform Mobile Automation with Calabash on Cloud and MoreCross Platform Mobile Automation with Calabash on Cloud and More
Cross Platform Mobile Automation with Calabash on Cloud and MoreMesut Günes
 
Simple Tips and Tricks with Ansible
Simple Tips and Tricks with AnsibleSimple Tips and Tricks with Ansible
Simple Tips and Tricks with AnsibleKeith Resar
 

What's hot (20)

Reduce dependency on Rx with Kotlin Coroutines
Reduce dependency on Rx with Kotlin CoroutinesReduce dependency on Rx with Kotlin Coroutines
Reduce dependency on Rx with Kotlin Coroutines
 
!!Con - The Creative Programmer
!!Con - The Creative Programmer!!Con - The Creative Programmer
!!Con - The Creative Programmer
 
Gigigo Rails Workshop
Gigigo Rails WorkshopGigigo Rails Workshop
Gigigo Rails Workshop
 
Virthualenvwrapper
VirthualenvwrapperVirthualenvwrapper
Virthualenvwrapper
 
Leo Burnett: Augmented Reality — версия для Adobe Flash и AIR on Mobiles
 Leo Burnett: Augmented Reality — версия для Adobe Flash и AIR on Mobiles Leo Burnett: Augmented Reality — версия для Adobe Flash и AIR on Mobiles
Leo Burnett: Augmented Reality — версия для Adobe Flash и AIR on Mobiles
 
Flamingo in Production
Flamingo in ProductionFlamingo in Production
Flamingo in Production
 
ServiceWorker: Exploring the Core of the Progressive Web App-Bagus Aji Santos...
ServiceWorker: Exploring the Core of the Progressive Web App-Bagus Aji Santos...ServiceWorker: Exploring the Core of the Progressive Web App-Bagus Aji Santos...
ServiceWorker: Exploring the Core of the Progressive Web App-Bagus Aji Santos...
 
Wire once, rewire twice! (Haskell exchange-2018)
Wire once, rewire twice! (Haskell exchange-2018)Wire once, rewire twice! (Haskell exchange-2018)
Wire once, rewire twice! (Haskell exchange-2018)
 
Coffee script grunt
Coffee script gruntCoffee script grunt
Coffee script grunt
 
MLBlock
MLBlockMLBlock
MLBlock
 
ES6 ECMA2015
ES6 ECMA2015ES6 ECMA2015
ES6 ECMA2015
 
Gearman bundle, Warszawa 2013 edition
Gearman bundle, Warszawa 2013 editionGearman bundle, Warszawa 2013 edition
Gearman bundle, Warszawa 2013 edition
 
Concurrency in ruby
Concurrency in rubyConcurrency in ruby
Concurrency in ruby
 
Frontend Finesse with Angular & Rails 4
Frontend Finesse with Angular & Rails 4Frontend Finesse with Angular & Rails 4
Frontend Finesse with Angular & Rails 4
 
Event Machine
Event MachineEvent Machine
Event Machine
 
Finagle - an intro to rpc & a sync programming in jvm
Finagle - an intro to rpc & a sync programming in jvmFinagle - an intro to rpc & a sync programming in jvm
Finagle - an intro to rpc & a sync programming in jvm
 
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​
 
ServiceWorkerとES6 Modules時代のTypescript開発考察
ServiceWorkerとES6 Modules時代のTypescript開発考察ServiceWorkerとES6 Modules時代のTypescript開発考察
ServiceWorkerとES6 Modules時代のTypescript開発考察
 
Cross Platform Mobile Automation with Calabash on Cloud and More
Cross Platform Mobile Automation with Calabash on Cloud and MoreCross Platform Mobile Automation with Calabash on Cloud and More
Cross Platform Mobile Automation with Calabash on Cloud and More
 
Simple Tips and Tricks with Ansible
Simple Tips and Tricks with AnsibleSimple Tips and Tricks with Ansible
Simple Tips and Tricks with Ansible
 

Viewers also liked

Tibetan govt technology installation
Tibetan govt technology installationTibetan govt technology installation
Tibetan govt technology installationPeggy Brannigan, MBA
 
新加坡Reits发行简介
新加坡Reits发行简介新加坡Reits发行简介
新加坡Reits发行简介翔 付
 
Raising awareness via art installations
Raising awareness via art installationsRaising awareness via art installations
Raising awareness via art installationsPeggy Brannigan, MBA
 
Saumya_Finance_&_Marketing_Manager
Saumya_Finance_&_Marketing_ManagerSaumya_Finance_&_Marketing_Manager
Saumya_Finance_&_Marketing_ManagerSaumya Chauhan
 
Dr. Arlene Adams - Construction of Intimacy 2014
Dr. Arlene Adams - Construction of Intimacy 2014Dr. Arlene Adams - Construction of Intimacy 2014
Dr. Arlene Adams - Construction of Intimacy 2014Arlene Adams Dr
 
Patient Access POS Collections Training Section 1
Patient Access POS Collections Training Section 1Patient Access POS Collections Training Section 1
Patient Access POS Collections Training Section 1Bob Stearnes
 
Dr. Arlene Adams - CV Full - 2015
Dr. Arlene Adams - CV Full -  2015Dr. Arlene Adams - CV Full -  2015
Dr. Arlene Adams - CV Full - 2015Arlene Adams Dr
 

Viewers also liked (15)

KINITH
KINITHKINITH
KINITH
 
Tibetan govt technology installation
Tibetan govt technology installationTibetan govt technology installation
Tibetan govt technology installation
 
Abono.club
Abono.clubAbono.club
Abono.club
 
Oh Old
Oh OldOh Old
Oh Old
 
Updated cv (2016)
Updated cv (2016)Updated cv (2016)
Updated cv (2016)
 
新加坡Reits发行简介
新加坡Reits发行简介新加坡Reits发行简介
新加坡Reits发行简介
 
Raising awareness via art installations
Raising awareness via art installationsRaising awareness via art installations
Raising awareness via art installations
 
Networking with Solar Innovators
Networking with Solar InnovatorsNetworking with Solar Innovators
Networking with Solar Innovators
 
Updated CV (2016)
Updated CV (2016)Updated CV (2016)
Updated CV (2016)
 
CV SMH 14
CV SMH 14CV SMH 14
CV SMH 14
 
Saumya_Finance_&_Marketing_Manager
Saumya_Finance_&_Marketing_ManagerSaumya_Finance_&_Marketing_Manager
Saumya_Finance_&_Marketing_Manager
 
Dr. Arlene Adams - Construction of Intimacy 2014
Dr. Arlene Adams - Construction of Intimacy 2014Dr. Arlene Adams - Construction of Intimacy 2014
Dr. Arlene Adams - Construction of Intimacy 2014
 
Patient Access POS Collections Training Section 1
Patient Access POS Collections Training Section 1Patient Access POS Collections Training Section 1
Patient Access POS Collections Training Section 1
 
Dr. Arlene Adams - CV Full - 2015
Dr. Arlene Adams - CV Full -  2015Dr. Arlene Adams - CV Full -  2015
Dr. Arlene Adams - CV Full - 2015
 
Library Networks
Library NetworksLibrary Networks
Library Networks
 

Similar to Ansible Meetup Kickoff - Batch Run Commands

Haibu: dev deployment is fast and easy again
Haibu: dev deployment is fast and easy againHaibu: dev deployment is fast and easy again
Haibu: dev deployment is fast and easy againFrank Rousseau
 
Node.js basics
Node.js basicsNode.js basics
Node.js basicsBen Lin
 
DevFest 2022 - GitHub Actions를 활용한 Flutter 배포 자동화하기
DevFest 2022 - GitHub Actions를 활용한 Flutter 배포 자동화하기DevFest 2022 - GitHub Actions를 활용한 Flutter 배포 자동화하기
DevFest 2022 - GitHub Actions를 활용한 Flutter 배포 자동화하기SuJang Yang
 
Introduction to ansible
Introduction to ansibleIntroduction to ansible
Introduction to ansibleOmid Vahdaty
 
Gitlab and Lingvokot
Gitlab and LingvokotGitlab and Lingvokot
Gitlab and LingvokotLingvokot
 
JS Fest 2018. Алексей Волков. Полезные инструменты для JS разработки
JS Fest 2018. Алексей Волков. Полезные инструменты для JS разработкиJS Fest 2018. Алексей Волков. Полезные инструменты для JS разработки
JS Fest 2018. Алексей Волков. Полезные инструменты для JS разработкиJSFestUA
 
Quest for the Perfect Workflow for McrFRED
Quest for the Perfect Workflow for McrFREDQuest for the Perfect Workflow for McrFRED
Quest for the Perfect Workflow for McrFREDAndi Smith
 
Toolbox of a Ruby Team
Toolbox of a Ruby TeamToolbox of a Ruby Team
Toolbox of a Ruby TeamArto Artnik
 
Zero Downtime Deployment with Ansible
Zero Downtime Deployment with AnsibleZero Downtime Deployment with Ansible
Zero Downtime Deployment with AnsibleStein Inge Morisbak
 
Capifony. Minsk PHP MeetUp #11
Capifony. Minsk PHP MeetUp #11Capifony. Minsk PHP MeetUp #11
Capifony. Minsk PHP MeetUp #11Yury Pliashkou
 
Linux Cluster Job Management Systems (SGE)
Linux Cluster Job Management Systems (SGE)Linux Cluster Job Management Systems (SGE)
Linux Cluster Job Management Systems (SGE)anandvaidya
 
Getting Started with Ansible - Jake.pdf
Getting Started with Ansible - Jake.pdfGetting Started with Ansible - Jake.pdf
Getting Started with Ansible - Jake.pdfssuserd254491
 
Using Chef and Vagrant at Gengo
Using Chef and Vagrant at GengoUsing Chef and Vagrant at Gengo
Using Chef and Vagrant at GengoGengo
 
CI/CD Using Ansible and Jenkins for Infrastructure
CI/CD Using Ansible and Jenkins for InfrastructureCI/CD Using Ansible and Jenkins for Infrastructure
CI/CD Using Ansible and Jenkins for InfrastructureFaisal Shaikh
 
Introducing cvm...
Introducing cvm...Introducing cvm...
Introducing cvm...Offirmo
 
Deploying Symfony | symfony.cat
Deploying Symfony | symfony.catDeploying Symfony | symfony.cat
Deploying Symfony | symfony.catPablo Godel
 
OSDC.no 2015 introduction to node.js workshop
OSDC.no 2015 introduction to node.js workshopOSDC.no 2015 introduction to node.js workshop
OSDC.no 2015 introduction to node.js workshopleffen
 

Similar to Ansible Meetup Kickoff - Batch Run Commands (20)

Haibu: dev deployment is fast and easy again
Haibu: dev deployment is fast and easy againHaibu: dev deployment is fast and easy again
Haibu: dev deployment is fast and easy again
 
Node.js basics
Node.js basicsNode.js basics
Node.js basics
 
DevFest 2022 - GitHub Actions를 활용한 Flutter 배포 자동화하기
DevFest 2022 - GitHub Actions를 활용한 Flutter 배포 자동화하기DevFest 2022 - GitHub Actions를 활용한 Flutter 배포 자동화하기
DevFest 2022 - GitHub Actions를 활용한 Flutter 배포 자동화하기
 
Introduction to ansible
Introduction to ansibleIntroduction to ansible
Introduction to ansible
 
Gitlab and Lingvokot
Gitlab and LingvokotGitlab and Lingvokot
Gitlab and Lingvokot
 
JS Fest 2018. Алексей Волков. Полезные инструменты для JS разработки
JS Fest 2018. Алексей Волков. Полезные инструменты для JS разработкиJS Fest 2018. Алексей Волков. Полезные инструменты для JS разработки
JS Fest 2018. Алексей Волков. Полезные инструменты для JS разработки
 
Gearman & PHP
Gearman & PHPGearman & PHP
Gearman & PHP
 
Gulp - The Streaming Build System
Gulp - The Streaming Build SystemGulp - The Streaming Build System
Gulp - The Streaming Build System
 
Quest for the Perfect Workflow for McrFRED
Quest for the Perfect Workflow for McrFREDQuest for the Perfect Workflow for McrFRED
Quest for the Perfect Workflow for McrFRED
 
Toolbox of a Ruby Team
Toolbox of a Ruby TeamToolbox of a Ruby Team
Toolbox of a Ruby Team
 
Zero Downtime Deployment with Ansible
Zero Downtime Deployment with AnsibleZero Downtime Deployment with Ansible
Zero Downtime Deployment with Ansible
 
Capifony. Minsk PHP MeetUp #11
Capifony. Minsk PHP MeetUp #11Capifony. Minsk PHP MeetUp #11
Capifony. Minsk PHP MeetUp #11
 
Linux Cluster Job Management Systems (SGE)
Linux Cluster Job Management Systems (SGE)Linux Cluster Job Management Systems (SGE)
Linux Cluster Job Management Systems (SGE)
 
Node js
Node jsNode js
Node js
 
Getting Started with Ansible - Jake.pdf
Getting Started with Ansible - Jake.pdfGetting Started with Ansible - Jake.pdf
Getting Started with Ansible - Jake.pdf
 
Using Chef and Vagrant at Gengo
Using Chef and Vagrant at GengoUsing Chef and Vagrant at Gengo
Using Chef and Vagrant at Gengo
 
CI/CD Using Ansible and Jenkins for Infrastructure
CI/CD Using Ansible and Jenkins for InfrastructureCI/CD Using Ansible and Jenkins for Infrastructure
CI/CD Using Ansible and Jenkins for Infrastructure
 
Introducing cvm...
Introducing cvm...Introducing cvm...
Introducing cvm...
 
Deploying Symfony | symfony.cat
Deploying Symfony | symfony.catDeploying Symfony | symfony.cat
Deploying Symfony | symfony.cat
 
OSDC.no 2015 introduction to node.js workshop
OSDC.no 2015 introduction to node.js workshopOSDC.no 2015 introduction to node.js workshop
OSDC.no 2015 introduction to node.js workshop
 

Recently uploaded

Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesThousandEyes
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...panagenda
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Mark Goldstein
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 

Recently uploaded (20)

Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 

Ansible Meetup Kickoff - Batch Run Commands

  • 2. So I want to batch run this thing... Do the API servers in production have a clock skew problem? Quick check. ansible -i prod api -a date
  • 3. These commands look similar... Classic nodejs deploy: ssh prod-api-1 cd /opt/myapp git pull npm install sudo service myapp restart … for each prod-api-* ...
  • 4. Make them a playbook - hosts: api vars: app: myapp tasks: - name: clone from git git: repo=”git@github.com:bigpandaio/{{app}}" dest=”/opt/ {{app}}" - name: npm install command: npm install --production - name: restart service service: name=”{{app}}” state=restarted sudo: yes
  • 5. But wait! My deployment also needs... HipChat notification tasks: - hipchat: room=ops token={{token}} msg=” Starting deploy” ...rest of playbook...
  • 6. But wait! My deployment also needs... Remove from ELB: tasks: - local_action: module: ec2_elb region: “{{region}}” instance_id: “{{ec2_id}}” ec2_elbs: “{{elb_name}}” state: absent
  • 7. But wait! My deployment also needs... Re-add to ELB: ... - local_action: module: ec2_elb region: “{{region}}” instance_id: “{{ec2_id}}” ec2_elbs: “{{elb_name}}” state: present
  • 8. But wait! My deployment also needs... Notify BigPanda (*wink* *tug*) - bigpanda: component={{app}} version= {{version}} state=started … - bigpanda: component={{app}} version= {{version}} state=finished
  • 10. Quick heartbleed patch - hosts: frontend sudo: yes serial: 1 tasks: - name: Unregister machine from elb local_action: … - apt: pkg=libssl1.0.0 state=latest update_cache=yes - service: name=nginx state=restarted - name: Add machine to elb local_action: …
  • 11. Grouping tasks into components ● Ansible’s solution is roles ● A role can be an app, service, common settings ○ roles/app1 ○ roles/app2 ○ roles/rabbitmq ○ roles/mongodb ○ roles/maintenance_cronjobs
  • 12. My apps’ roles look the same! ● Use a generic parametrized role ● roles/nodejs_app ○ notifies bigpanda ○ git pull {{app}} ○ npm install ○ service {{app}} restart ○ self test the {{app}} service ● Specific roles depend on it
  • 13. Deploying to stage with same roles Use a different inventory for prod and stage: ansible-playbook -i prod api.yml ansible-playbook -i stage api.yml
  • 14. Deploy ALL THE THINGS! site.yml: - include: api.yml - include: mongodb.yml - include: frontend.yml
  • 15. Deploy some of the things Tag all of your tasks/roles with their relevant app/service name - { role: app1, tags: app1 } - name: Generate configuration template: src=config.j2 dest=/dest/path tags: [ myservice_config, myservice ]
  • 16. Deploy some of the things Then you can: ansible-playbook -i prod site.yml --tags app1 Or even: alias deploy-prod=’ansible-playbook -i prod site.yml --tags’ deploy-prod app1 ..aaahhhhh..
  • 17. And the logical conclusion
  • 18. Provision a server in EC2 ● The ec2 module creates new instances ● We have the rest of the config as roles ● Simple solution: ansible-playbook -i prod ec2_create.yml -e type=frontend ansible-playbook -i prod site.yml --limit frontend
  • 19. Provision a DC Same thing really: for i in frontend api mongodb; do ansible-playbook -i prod ec2_create -e type=$i done ansible-playbook -i prod site.yml