Drone your Ansible

2,821 views
2,436 views

Published on

Testing Ansible code with Drone.

Published in: Technology
0 Comments
3 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
2,821
On SlideShare
0
From Embeds
0
Number of Embeds
916
Actions
Shares
0
Downloads
13
Comments
0
Likes
3
Embeds 0
No embeds

No notes for slide

Drone your Ansible

  1. 1. Drone your Ansible Dennis Rowe @shr3kst3r wpengine.com
  2. 2. Drone •https://github.com/drone/drone •“Drone is a Continuous Integration platform built on Docker, written in Go” •Buzzword score: 4
  3. 3. Show Time •Deploy Droid •Hook it up to Github •Test some Ansible code •Poke around the Drone UI
  4. 4. Update Kernel •apt-get update •apt-get install linux-image- generic-lts-raring linux-headers- generic-lts-raring •reboot
  5. 5. Install Docker • apt-key adv --keyserver hkp:// keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D 21E9 • sh -c "echo deb https://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/ docker.list" • apt-get update • apt-get install lxc-docker
  6. 6. Install Drone •wget http://downloads.drone.io/ latest/drone.deb •dpkg -i drone.deb •start drone
  7. 7. http://IP/install
  8. 8. Register Drone with Github
  9. 9. Important Numbers
  10. 10. Add to Drone
  11. 11. New Repository
  12. 12. Authorize
  13. 13. Add Repository
  14. 14. Notes •First run can take a looooong time because it needs to download the Docker image.
  15. 15. Completed Run
  16. 16. Poking at Docker
  17. 17. Now the Configuration
  18. 18. Pull •GitHub •BitBucket
  19. 19. Deployment •Cloud Foundry •Engine Yard •Git Push •Bash •Heroku •Modulus •Nodejitsu •Tsuru
  20. 20. Publish •S3 •Swift •PyPI •NPM •Docker
  21. 21. Services •cassandra •couchdb •elasticsearch •neo4j •mongodb •mysql •postgres •rabbitmq •redis •riak •zookeeper
  22. 22. Notifications •E-Mail •Webhook •Hipchat
  23. 23. Other Stuff •Can launch custom Docker containers •Can persist directories between builds •Parameter injection in to the .drone.yml
  24. 24. .drone.yml image: python2.7 env: script: - sudo apt-get update - sudo apt-get install software-properties-common - sudo apt-add-repository ppa:ansible/ansible - sudo apt-get update - sudo apt-get install ansible - sudo pip install https://github.com/willthames/ansible-lint/archive/master.zip - sudo apt-get install rubygems - sudo gem install serverspec - sudo gem install rake - sudo ./drone_it notify: email: recipients: - dennis@wpengine.com
  25. 25. drone_it •Lints the Ansible code •Deploys the Ansible code •Runs server-spec to verify •https://github.com/shr3kst3r/ ansible-drone-example/blob/ master/drone_it
  26. 26. Thoughts •Would like to be able to test multiple docker images (https:// github.com/drone/drone/issues/6). •Hard to create complex setups. •Can’t edit /etc/hosts because it is a bind mount.
  27. 27. Odds and Ends •https://github.com/shr3kst3r/ ansible-drone-example •You can reach me at dennis@wpengine.com or @shr3kst3r on the twitters

×