• Like
Application Deployment Using Ansible
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

Application Deployment Using Ansible

  • 9,748 views
Published

 

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
No Downloads

Views

Total Views
9,748
On SlideShare
0
From Embeds
0
Number of Embeds
5

Actions

Shares
Downloads
83
Comments
1
Likes
24

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. APPLICATION DEPLOYMENT USING ANSIBLE Cliffano Subagio | @cliffano | Sensis
  • 2. /me > Continuous Integration/Deployment/Delivery > Most important lesson: Never ever write a deployment framework in Ant!
  • 3. /project > Micro-services architecture > 15 applications > 2 data centers > 2 x 10 app servers > 2 x 3 db servers > Hundreds of deployments to date
  • 4. ansible > Orchestration + automation engine > Application deployment > System provisioning
  • 5. why ansible > Push via SSH > No agents on remote systems > Readable playbook > Tasks executed in order > Built-in + custom modules > Community growth
  • 6. sample usage ansible-playbook --inventory-file=hosts.ini --module-path=path/to/custom-modules --extra-vars=”ENV=testVERSION=1.2.3” --tags ci -u username --verbose app-playbook.yml
  • 7. sample inventory file [foo-dev] devhost1.some.domain.com [foo-test] testhost1.some.domain.com testhost2.some.domain.com [bar-test] testhost1.some.domain.com
  • 8. sample playbook - hosts: foo-$ENV vars: BASE=/app/ tasks: - name: Send artifact file to remote system copy: src=foo-$VERSION.tar.gz dest=$BASE/builds tags: - ci
  • 9. separation of concerns > Playbook defines how to deploy an app > Inventory file defines where to deploy those apps
  • 10. artifacts app1 playbook.yml app2 playbook.yml app3 playbook.yml app4 playbook.yml app5 playbook.yml app6 playbook.yml project inventoryfile package.json > Avoid monolithic deployment configuration
  • 11. deployment flow artifact-repo app6-0.0.3.tar.gz jenkins deploy- server dev source-repo test stage prod release-repo project-2.3.4.tar.gz
  • 12. custom module > Usage: cleanbuilds dir=/app/foo/builds/ keep=5 > Keeps the last N builds > Controls disk usage > Written in python
  • 13. gnu parallel > Improve deployment time > (echo app1 && echo app2) | parallel ansible-playbook ... > Grouping and ordering of stdout & stderr > Optimised to available CPU cores
  • 14. what’s next > Write more common Ansible modules > ControlMaster, 0mq > AnsibleWorks AWX
  • 15. AWX
  • 16. conclusions > Ansible really works (no pun intended) > Modules encourage reusability > I’m not writing a deployment framework > Collaboration between dev, devops, ops teams
  • 17. questions + discussion
  • 18. slide notes > http://www.ansibleworks.com/ > http://www.ansibleworks.com/docs/modules.html > http://jpmens.net/2012/10/01/dramatically-speeding-up-ansible-runs/ > http://www.gnu.org/software/parallel > http://ant.apache.org > http://jenkins-ci.org