I am not sure about the relationship between dependencies and functions: 1. From seperate module, calling package{ "vsftpd": require => Yumrepo["base"], ensure => installed; } 2. From the Yum package, calling birepo { "bia.$bi_linux_name-base": descr => "$bi_linux_name \$releasever - \$basearch - Base", relativeUrl => $base_path, alias => "base", require => Exec["import-gpg-keys"]; } where bia-repo is defined as define birepo($descr, $relativeUrl, $gpgcheck = 1) { yumrepo{$name: baseurl => "http://172.20.42.90/yum-repo/$relativeUrl", descr => $descr, enabled => 1, gpgcheck => $gpgcheck, } } and Exec is exec { "rpm --import /etc/yum.repos.d/GPG-keys/$flavor_abbr/*": path => "/bin", require => File["/etc/yum.repos.d/GPG-keys/$flavor_abbr/"], alias => "import-gpg-keys"; } I would expect for these dependencies to hold up, since yumrepo is in birepo which required that the keys are imported before it runs. This is not occurring though, I am getting the error message: err: //Node[SERVER]/s_workstation/vsftpd/Package[vsftpd]/ensure: change from absent to present failed: Execution of ''/usr/bin/yum -d 0 -e 0 -y install vsftpd'' returned 256: warning: rpmts_HdrFromFdno: Header V3 DSA signature: NOKEY, key ID 82fd17b2 I can resolve this issue by moving the Exec dependency inside of the birepo function (which for me is a better idea anyways) But my question, is why does this not work? Why cant we group things into functions in order to group dependent things together? regards, Dan --~--~---------~--~----~------------~-------~--~----~ 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 puppet-users+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
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 puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---