Dan,

There are a couple problems here; one is a problem with your
manifests, the other is a problem with the mental model you are using.

Let's start with the manifests:

>   package{
>     "vsftpd":
>       require => Yumrepo["base"],
>       ensure => installed;
> }

Here you are saying that the package depends on a yumrepo resource
with the title "base".

>   birepo {
>     "bia.$bi_linux_name-base":
>       descr       => "$bi_linux_name \$releasever - \$basearch - Base",
>       relativeUrl => $base_path,
>       alias       => "base",
>       require => Exec["import-gpg-keys"];
>   }

Here you are creating a birepo resource with the alias "base". Clearly
you thought this would pass through to the below:

>   define birepo($descr, $relativeUrl, $gpgcheck = 1) {
>     yumrepo{$name:
>       baseurl  => "http://172.20.42.90/yum-repo/$relativeUrl";,
>       descr    => $descr,
>       enabled  => 1,
>       gpgcheck => $gpgcheck,
>     }
>   }

But this creates a yumrepo resource with the title from $name; which
is going to be "bia.$bi_linux_name-base", not "base". So, that is why
you are having troubles here.

The more basic problem is with your mental model. You said "I am not
sure about the relationship between dependencies and functions:" You
are not using any functions here. "define" does not create a function,
it creates a collection of resources that Puppet allows you to treat
as a single resource. You also use "calling" when talking about
resources; you don't "call" resources in Puppet, you "declare" them.
Puppet is a declarative language, not an imperative language. People
easily fall into the trap of mistaking resources/defines for function
calls, but this is a Bad Idea(tm) -- you will find yourself making
mistaken assumptions if you continue to model things this way.

Hope that helps,
Paul

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to [email protected]
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