PuppetCamp SEA 1 - Version Control with Puppet

441 views

Published on

Choon Ming Goh, System Administrator at OnApp Malaysia, gave a presentation on how OnApp implements version control. Since they have quite a few repositories, this is all puppetised and that is quite a nice way of doing version control.

Published in: Technology
  • Be the first to comment

  • Be the first to like this

PuppetCamp SEA 1 - Version Control with Puppet

  1. 1. Version Control with Puppet Choon Ming Goh CDN Division Choonming.goh@onapp.com
  2. 2. AboutSystem AdministratorBackend DeveloperPuppet userCloud industryBuilds CDN software
  3. 3. Why version control?
  4. 4. Versioning
  5. 5. Coordination
  6. 6. Centralised repository
  7. 7. Accountability
  8. 8. Experimentation
  9. 9. What do I use?
  10. 10. Git and Subversion
  11. 11. How do I do that?
  12. 12. Defined Types
  13. 13. define subversion::create($user = false, $group = false){ include subversion::aflexi $user_real = $user ? { false => 0, default => $user } $group_real = $group ? { false => 0, default => $group } Exec { path => "/usr/bin:/bin:/opt/local/bin:/usr/local/bin", } exec { "svnadmin-create-$name": command => "/usr/bin/svnadmin create $name", creates => "$name/db", user => $user_real, group => $group_real, environment => "HOME=", }}
  14. 14. define git::workdir($repository, $local_container, $local_name = false, $post_checkout_script =undef, $post_update_script = undef, $runas_user = "root", $runas_group = "root", $branch ="master"){ $owner_real = $owner ? { false => 0, default => $owner } $group_real = $group ? { false => 0, default => $group } $local_name_real = $local_name ? { false => $name, default => $local_name } exec { "git-clone-$name": command => "git clone --branch $branch $repository $local_name_real", cwd => $local_container, require => [ File["$local_container"], Package["git-core"]], creates => "$local_container/$local_name_real/.git", } exec { "git-pull-$name": command => "git pull", cwd => "$local_container/$local_name_real", require => Exec["git-clone-$name"], }}
  15. 15. Whats next?
  16. 16. subversion::create { "/var/lib/svn/$svnrepo": user => "www-data", group => "www-data",}
  17. 17. git::workdir { "mygitrepo": repository => $portal_src, local_container => "/etc/puppet/", local_name => "mygitrepo", branch => $portal_branch,}
  18. 18. Why do I want to puppetize it?
  19. 19. Quick setup for another puppetmaster
  20. 20. Almost not necessary to change manifests manually ever!
  21. 21. Fix what you break policy
  22. 22. Questions?
  23. 23. ContactChoonming.goh@onapp.comTwitter - @choonmingIRC – Freenode #puppet, #myoss, #debian choonmingSkype – gchoonming (please identify yourself)Gtalk – choonming2002 (please identify yourself)

×