Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Drone your Ansible


Published on

Testing Ansible code with Drone.

Published in: Technology
  • Be the first to comment

Drone your Ansible

  1. 1. Drone your Ansible Dennis Rowe @shr3kst3r
  2. 2. 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:// --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D 21E9 • sh -c "echo deb docker main > /etc/apt/sources.list.d/ docker.list" • apt-get update • apt-get install lxc-docker
  6. 6. Install Drone •wget 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 - sudo apt-get install rubygems - sudo gem install serverspec - sudo gem install rake - sudo ./drone_it notify: email: recipients: -
  25. 25. drone_it •Lints the Ansible code •Deploys the Ansible code •Runs server-spec to verify • ansible-drone-example/blob/ master/drone_it
  26. 26. Thoughts •Would like to be able to test multiple docker images (https:// •Hard to create complex setups. •Can’t edit /etc/hosts because it is a bind mount.
  27. 27. Odds and Ends • ansible-drone-example •You can reach me at or @shr3kst3r on the twitters