Thank you for the replies, @Gavin, I attempted as you suggested but it still suffers from amnesia regarding the repos themselves. But it did get me looking at other work arounds and reading through to see if I can find a way for puppet with a meta parameter or such to recognize these files exist.
@jamese, that was what I was afraid of. We have a huge number of repositories due to the way we distribute software internally, I will keep that idea in my back pocket, but if I can avoid creating resources for each repo file, that would be much better. Onto more reading, and messing around then. At least it works now. Albeit cluttering the dashboard. If I figure something out Ill be sure to post back. Best regards, ~Chris On Friday, April 17, 2015 at 4:41:37 AM UTC-4, Gavin Williams wrote: > > And the link: > https://docs.puppetlabs.com/references/latest/type.html#resources > > Gav > > On Friday, 17 April 2015 09:41:03 UTC+1, Gavin Williams wrote: >> >> Chris >> >> Take a look at the 'resources'[1] type, which you can use to purge >> unmanaged resources of a specific type. >> >> So rather than purging the entire directory using a file resource, you >> just purge the yum-repo files themselves... >> >> Something like: >> resources {'yumrepo': >> purge => true >> } >> should do you... >> >> HTH >> Gav >> >> On Thursday, 16 April 2015 18:36:25 UTC+1, Christopher Hyatt wrote: >>> >>> Repositories defined in yaml, yum module below. Understand some of my >>> floundering is still in this module so things like ensure => "present" are >>> not intended to be taken literally >>> >>> What this really does is wipe out the entire /etc/yum.repos.d/ directory >>> then recreates the repos from yaml, not ideal as it fills my dashboard with >>> constant changes in my infrastructure. >>> >>> *Puppet 3.7.5-1 on Red Hat 6.5, 64bit* >>> >>> I would hope a work around would make puppet understand and catalogue >>> properly every repository created with create_resources. The require was to >>> stop Puppet from obliterating the /etc/yum.repos.d/ directory after >>> creating the repositories. >>> I've searched plenty but perhaps I'm not using the right terminology. I >>> can see several ways to handle it but none of them pretty, was hoping >>> someone else saw this in the wild... >>> >>> Regards, ~Chris >>> >>> #init.pp >>> class yum { >>> $yumconfig = hiera_array("yum::configuration") >>> $repos = hiera("yum::repos") >>> $repodefaults = { >>> ensure => "present", >>> require => File[ "/etc/yum.repos.d"], >>> } >>> create_resources(yumrepo, $repos, $repodefaults) >>> file { "/etc/yum.repos.d": >>> ensure => "directory", >>> owner => "root", >>> group => "root", >>> mode => "0755", >>> purge => "true", >>> recurse => "true", >>> } >>> file { "/etc/yum.conf": >>> ensure => "file", >>> owner => "root", >>> group => "root", >>> mode => "0644", >>> content => template("yum/yum_conf.erb"), >>> } >>> } >>> >>> >>> -- 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 puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/1d79639e-4ef6-43a7-b97d-0e99c1ce74f6%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.