On Thursday, January 24, 2013 4:08:21 AM UTC-6, Benoit BARTHELEMY wrote:
>
> Correction, the class is the following :
>
> class site::yum_repository{
>
>   class{'mrepo::params':
>     src_root     => hiera('mrepo::params::src_root'),
>     www_root     => hiera('mrepo::params::www_root'),
>     user         => hiera('mrepo::params::user'),
>     group        => hiera('mrepo::params::group'),
>     source       => hiera('mrepo::params::source'),
>     selinux      => hiera('mrepo::params::selinux'),
>     rhn          => hiera('mrepo::params::rhn'),
>     rhn_username => hiera('mrepo::params::rhn_username'),
>     rhn_password => hiera('mrepo::params::rhn_password'),
>     mailto       => hiera('mrepo::params::mailto')
>   }
>


Never, ever do that.  It's awful.  You've gone to all the trouble hierify 
your class parameters, and then thrown away the biggest advantages of doing 
so.  If you're going to rely on hiera for class parameters (a good thing) 
then declare that class via the 'include' function:

include 'mrepo::params'

The advantages go far beyond brevity, but I'll leave the rest for some 
other post.

 

>   $repos = hiera('site::yum_repository::repos')
>   create_resources(mrepo::repo::rhn, $repos)
> }
>
>
The cycle is not (directly) in the manifests and data you presented.  It 
appears to be a problem in the mrepo module, whether in defined type 
mrepo::repo::rhn or some other component used by that definition.

I find this step of the dependency cycle particularly suspect: Service[httpd] 
=> Class[Apache].  Supposing that Class[apache] manages installing and 
configuring the apache server, one would normally expect to require it to 
be applied *before* Service[httpd], not after.

Supposing that Class[apache] provides for the parent directory of 
File[/srv/mrepo], and that it, in turn, is the parent directory of File[
10-mrepo.conf], the relationships should probably be like this instead 
(expressed via Puppet chaining operators):

Class[Apache] -> File[/srv/www/mrepo] -> File[10-mrepo.conf] ~> 
Service[httpd]
Class[Apache] ~> Service[httpd]

Except as discussed above, that's consistent with the relationships Puppet 
reports, and it does not contain a cycle.  The second chain is not (wholly) 
redundant.


John

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/puppet-users/-/4AhYYAwHtwkJ.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to