Another reply to myself.

I also inverstigated using defines like in:
http://reductivelabs.com/trac/puppet/wiki/Recipes/AptKeys

Which resulted in this code:

define cobbler::repo($name, $source, $arch="", $ensure="present",
$local=1) {
  case $ensure {
    present: {
      exec { "ensure_cobbler_repo $name":
        command => "cobbler_repo_ensure -n $name -s $source -m $local -a
$arch",
        path =>
"/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/sbin",
        user => "root",
        unless => "cobbler_repo_exists -n $name",
        logoutput => on_failure,
        notify => Exec["cobbler_repo_sync"],
        require => [
File["/usr/local/bin/cobbler_repo_ensure"],
File["/usr/local/bin/cobbler_repo_insync"]
        ]
      }
    }
    absent: {
      exec { "remove_cobbler_repo $name":
        command => "cobbler repo remove --name=$name",
        path =>
"/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/sbin",
        user => "root",
        onlyif => "cobbler_repo_exists -n $name",
        logoutput => on_failure,
        notify => Exec["cobbler_repo_sync"],
        require => File["/usr/local/bin/cobbler_repo_exists"]
      }
    }
    insync: {
      exec { "ensure_cobbler_repo $name":
      command => "cobbler_repo_ensure -n $name -s $source -m $local -a
$arch",
      path =>
"/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/sbin",
      user => "root",
      unless => "cobbler_repo_insync -n $name -s $source -m $local -a
$arch",
      logoutput => on_failure,
      notify => Exec["cobbler_repo_sync"],
      require => [
File["/usr/local/bin/cobbler_repo_ensure"],
File["/usr/local/bin/cobbler_repo_insync"]
      ]
    }
    default: {
      fail "Invalid 'ensure' value for cobbler::repo: $ensure"
    }
  }
}


However, I didn't find out how I could require a repository which was
created this way in another define (for a system profile for example).

As before, help would be appreciated.

Regards,
Sven

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to