Ansible: Automated App Deployment
-
Upload
rand-graham -
Category
Software
-
view
1.437 -
download
1
Transcript of Ansible: Automated App Deployment
![Page 1: Ansible: Automated App Deployment](https://reader031.fdocuments.net/reader031/viewer/2022021506/5876fdfc1a28abf3398b6b95/html5/thumbnails/1.jpg)
Ansible: Automated App Deployment
Presented By:
Rand Graham
![Page 3: Ansible: Automated App Deployment](https://reader031.fdocuments.net/reader031/viewer/2022021506/5876fdfc1a28abf3398b6b95/html5/thumbnails/3.jpg)
• “Deploying Rails applications used to be a pain…” - Michael Hartl
Rails’ Reputation
rmcore.com
•“Rails sucks•My experience is admittedly limited here, but as far as I
can tell, installing a Rails app is impossible.” -Eevee
![Page 4: Ansible: Automated App Deployment](https://reader031.fdocuments.net/reader031/viewer/2022021506/5876fdfc1a28abf3398b6b95/html5/thumbnails/4.jpg)
Drawbacks•Fragile
•Hard to debug
•Error recovery
Shell Scripts
rmcore.com
![Page 7: Ansible: Automated App Deployment](https://reader031.fdocuments.net/reader031/viewer/2022021506/5876fdfc1a28abf3398b6b95/html5/thumbnails/7.jpg)
• Agentless
Ansible Advantages
rmcore.com
• Configuration as Data (YAML)
• Idempotent
![Page 8: Ansible: Automated App Deployment](https://reader031.fdocuments.net/reader031/viewer/2022021506/5876fdfc1a28abf3398b6b95/html5/thumbnails/8.jpg)
•Playbooks contain Plays•Plays contain Tasks• Tasks call Modules
•Everything is sequentially ordered except handlers that run at the end.
Ansible Playbooks
rmcore.com
![Page 9: Ansible: Automated App Deployment](https://reader031.fdocuments.net/reader031/viewer/2022021506/5876fdfc1a28abf3398b6b95/html5/thumbnails/9.jpg)
A task calls a module to do the work.
Ansible Tasks
rmcore.com
---
- name: Install git yum: pkg=git state=installed
![Page 10: Ansible: Automated App Deployment](https://reader031.fdocuments.net/reader031/viewer/2022021506/5876fdfc1a28abf3398b6b95/html5/thumbnails/10.jpg)
Apply changes to multiple machines
Inventory
rmcore.com
[web]webserver-1.foo.comwebserver-2.foo.com
[db]dbserver-1.foo.com
![Page 11: Ansible: Automated App Deployment](https://reader031.fdocuments.net/reader031/viewer/2022021506/5876fdfc1a28abf3398b6b95/html5/thumbnails/11.jpg)
not all tasks are run:
Output of playbook
rmcore.com
PLAY [rails]
GATHERING FACTS ok: [136.166.60.99] PLAY RECAP 136.166.60.99 : ok=14 changed=7 unreachable=0 failed=0
![Page 12: Ansible: Automated App Deployment](https://reader031.fdocuments.net/reader031/viewer/2022021506/5876fdfc1a28abf3398b6b95/html5/thumbnails/12.jpg)
ansible-playbook -i inventories/staging site.yml
Ansible One Liners
rmcore.com
ansible-playbook -i inventories/staging deploy_app.yml
Provision
Deploy
![Page 15: Ansible: Automated App Deployment](https://reader031.fdocuments.net/reader031/viewer/2022021506/5876fdfc1a28abf3398b6b95/html5/thumbnails/15.jpg)
Connect with me on twitter:@rdg_rmcoreRead more at my website: http://rmcore.com/
On the internets
rmcore.com
![Page 16: Ansible: Automated App Deployment](https://reader031.fdocuments.net/reader031/viewer/2022021506/5876fdfc1a28abf3398b6b95/html5/thumbnails/16.jpg)
• The sad state of web app deployment
• Ruby on Rails Tutorial
• Efficient Rails DevOps
• An Overview of Chef
• Ansible Quick Start Video
• Stockfighter CTF
• There Is No Cloud
•Cloudcast Ansible Episode
• Postgresql Automation w/Ansible
References
rmcore.com
![Page 17: Ansible: Automated App Deployment](https://reader031.fdocuments.net/reader031/viewer/2022021506/5876fdfc1a28abf3398b6b95/html5/thumbnails/17.jpg)
•Photo of forge by Andrew Stawarz.
Credits
rmcore.com