On Tuesday, January 31, 2012 at 9:33 AM, Siddharth Deshpande wrote:
On Tuesday 31 January 2012 05:04 PM, Nick wrote:Ideally, I'd be able to re-deploy a new Cobbler server in exactly the same wayas another node.Puppet modules which allow automating setting up repos, profiles, systems etc.don't seem to exist on the public internet.I've been working on this exact thing (minus the systems because i don'tneed them replicated everywhere) in the recent past. It's a bit uncookedatm so probably not worth sharing as is. Though i can share the generalapproach i've been using. For examples, for repos:define cobbler::repo($mirror, $local = "N") {$test_command = "/usr/bin/cobbler repo report --name=${name} >/dev/null"$params = "--name=${name} --arch=x86_64 --breed=yum--mirror=$mirror --mirror-locally=$local"Exec {require => Cobbler::Distro[$cobbler_distros_list],}exec { "/usr/bin/cobbler repo add $params":unless => $test_command,}exec { "/usr/bin/cobbler repo edit $params":onlyif => $test_command,}}...And, an actual instance:cobbler::repo { "EPEL-x86_64":mirror =>}----Similarly, for profiles:define cobbler::profile($distro = "centos5.6-x86_64", $kickstart, $repos= "",$kopts = "") {$ksdir = "/var/lib/cobbler/kickstarts"$test_command = "/usr/bin/cobbler profile report --name=${name}> /dev/null"$params = " --name=${name} --distro=$distro --repos=\"$repos\"--kickstart=$ksdir/$kickstart --kopts=\"$kopts\""Exec {require => Cobbler::Repo[$cobbler_repos_list],}exec { "/usr/bin/cobbler profile add $params":unless => $test_command,}exec { "/usr/bin/cobbler profile edit $params":onlyif => $test_command,}}...example usage:cobbler::profile { "Dell-OMSA-livecd" :distro => "Dell-OMSA-livecd",kickstart => "default.ks",}cobbler::profile { "linux-rescue" :kickstart => "default.ks",kopts => "text rescue",}----It's not really well tested, but in what little testing i did it seemedto work without noticeable trouble, but YMMV. I'll try to publish thewhole module once it's properly done; in the meanwhile you can probablyuse this as a starting point. And do let me know if something doesn'twork for you. And ideas for making it better are welcome, of course.--cheers,siddharth._______________________________________________cobbler mailing list