Hi John,

Thanks for replying. I tried using contain.

class profile::base {
  contain '::yum::repo::epel'
  contain '::yum::repo::puppet'
}

Still didn't work for me. Is there a possibility of known bug being
triggered?

On Wed, Dec 17, 2014 at 7:41 PM, jcbollinger <[email protected]>
wrote:
>
>
>
> On Tuesday, December 16, 2014 7:59:00 AM UTC-6, Abhijeet Rastogi wrote:
>
> [...]
>
> class profile::base {
>>   anchor { 'base_repos_start': }
>>   class { '::yum::repo::epel': require   => Anchor['base_repos_start']}
>>   class { '::yum::repo::puppet': require =>  Anchor['base_repos_start']}
>>   anchor { 'base_repos_end': }
>> }
>>
>>
> [...]
>
>
>>
>>
> I think I'm using anchor patterns correctly but they don't seem to be
>> working. Is there anything that I'm doing fundamentally wrong? Any possible
>> reasons this might not be working?
>>
>>
>
> Yes.  Contrary to your assertion, you are not using the anchor pattern
> correctly.  Your contained classes are related only to the starting anchor,
> not to the ending anchor.  Correct use of the anchor pattern would look
> more like this:
>
> class profile::base {
>   anchor { 'base_repos_start': }
>   class { '::yum::repo::epel': require   => Anchor['base_repos_start'],
> before => Anchor['base_repos_end'] }
>   class { '::yum::repo::puppet': require =>  Anchor['base_repos_start'],
> before => Anchor['base_repos_end'] }
>   anchor { 'base_repos_end': }
> }
>
> If you are using a sufficiently recent Puppet, however, then you should
> instead use the new(ish) 'contain()' function
> <https://docs.puppetlabs.com/references/3.4.stable/function.html#contain>.
> In full generality that would look like this:
>
> class profile::base {
>   class { '::yum::repo::epel': }
>   class { '::yum::repo::puppet': }
>   contain '::yum::repo::epel'
>   contain '::yum::repo::puppet'
> }
>
> Since your classes don't (any more) require any parameters to be specified
> in your manifests, however, you can shorten that further to simply
>
> class profile::base {
>   contain '::yum::repo::epel'
>   contain '::yum::repo::puppet'
> }
>
>
> John
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Puppet Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/puppet-users/4e8e0699-0857-47dc-a77b-1b916ab5d9e1%40googlegroups.com
> <https://groups.google.com/d/msgid/puppet-users/4e8e0699-0857-47dc-a77b-1b916ab5d9e1%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>


-- 
Cheers,
Abhijeet Rastogi (shadyabhi)

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/CACXxYfzMrsjJ2OqxiWXrrSoFLfdcdUXA1dXqj0gGVcLr%2BztyQA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to