Joshua Barratt
2009-Jul-01 15:42 UTC
[Puppet Users] Manage Directory/Purge Contents technique not working?
Hello all, I have done my best to RTFM, and this seems to be exactly the problem I have: http://reductivelabs.com/trac/puppet/wiki/FrequentlyAskedQuestions#i-want-to-manage-a-directory-and-purge-its-contents I am attempting to manage a lighttpd module, so I''d like to manage what''s in the the various conf-* directories. Thus, file { ["$conf_dir/ssl", "$conf_dir/conf-include", "$conf_dir/conf- enabled", "$conf_dir/conf-available"]: ensure => directory, purge => true, recurse => true, force => true, source => "puppet:///lighttpd/empty", } Sadly, I get a string of errors: err: //lighttpd/File[/etc/lighttpd/ssl]: Failed to generate additional resources during transaction: None of the provided sources exist debug: //lighttpd/File[/etc/lighttpd/ssl]/checksum: Initializing checksum hash debug: //lighttpd/File[/etc/lighttpd/ssl]: Creating checksum {mtime} Fri Jun 19 01:39:34 -0700 2009 err: //lighttpd/File[/etc/lighttpd/ssl]: Failed to retrieve current state of resource: No specified source was found from puppet:///lighttpd/empty err: //lighttpd/File[/etc/lighttpd/conf-enabled]: Failed to generate additional resources during transaction: None of the provided sources exist debug: //lighttpd/File[/etc/lighttpd/conf-enabled]/checksum: Initializing checksum hash debug: //lighttpd/File[/etc/lighttpd/conf-enabled]: Creating checksum {mtime}Fri Jun 19 13:58:35 -0700 2009 err: //lighttpd/File[/etc/lighttpd/conf-enabled]: Failed to retrieve current state of resource: No specified source was found from puppet:///lighttpd/empty And so forth. And, these aren''t ''ignorable'' errors -- it doesn''t actually clean the directory. This is pretty essential to have working, as otherwise you get what led me to try and track this down in the first place, which is a change to the puppet manifest leading to 2 different lighttpd configs trying to have the same Document Root directory. (When, in fact, one of them should have no longer existed.) I have the identical problem managing an /etc/monit.d/* directory''s contents -- switching from, say, apache to lighttpd means monit will still have the /etc/monit.d/apache file in there and they''ll be fighting over port 80. (Sadface.) The last message referring to this as a valid workaround seems to have been about 2 months ago, so it "should" still work? puppet: 0.24.8 facter: 1.5.1 ruby: ruby 1.8.7 (2008-08-11 patchlevel 72) [x86_64-linux] --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Joshua Barratt
2009-Jul-01 16:28 UTC
[Puppet Users] Manage Directory/Purge Contents technique not working?
Hello all, I attempted to RTFM on this one but to no avail. (Also, this may be a repost? Google appeared to eat the first email I sent several hours ago.) I am trying to clean out the /etc/lighttpd/sites-enabled directory using this technique: http://reductivelabs.com/trac/puppet/wiki/FrequentlyAskedQuestions#i-want-to-manage-a-directory-and-purge-its-contents This is needed because, let us say, a node goes from running ''myoldsite'' to running ''mynewsite''. If I don''t purge the sites-enabled directory, I''ll try to load both lighttpd configs simultaneously, which conflict. Here''s my code: file { ["$conf_dir/ssl", "$conf_dir/conf-include", "$conf_dir/conf-enabled", "$conf_dir/conf-available"]: ensure => directory, purge => true, recurse => true, force => true, source => "puppet:///lighttpd/empty", } } I get errors like this: err: //lighttpd/File[/etc/lighttpd/conf-enabled]: Failed to generate additional resources during transaction: None of the provided sources exist debug: //lighttpd/File[/etc/lighttpd/conf-enabled]/checksum: Initializing checksum hash debug: //lighttpd/File[/etc/lighttpd/conf-enabled]: Creating checksum {mtime}Tue Jun 30 19:46:37 -0700 2009 err: //lighttpd/File[/etc/lighttpd/conf-enabled]: Failed to retrieve current state of resource: No specified source was found from puppet:///lighttpd/empty I need to do the same thing for ''monit'', so I tested this in my monit module as well, with the identical (i.e. errors + doesn''t work) results. The above FAQ link was handed out as recently as May 27th-ish, so if this technique is deprecated, it hasn''t been for long. And the salient bits: puppetversion => 0.24.8 rubyversion => 1.8.7 facterversion => 1.5.1 Would appreciate any guidance. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Joshua Barratt
2009-Jul-01 22:57 UTC
[Puppet Users] Re: Manage Directory/Purge Contents technique not working?
Answering myself here, Turns out the empty directory you point at DOES need to exist, contrary to the explicit directions in the Wiki. I''ll update the wiki. Josh On Wed, Jul 1, 2009 at 8:42 AM, Joshua Barratt <joshuabarratt@gmail.com>wrote:> > Hello all, > > I have done my best to RTFM, and this seems to be exactly the problem > I have: > > > http://reductivelabs.com/trac/puppet/wiki/FrequentlyAskedQuestions#i-want-to-manage-a-directory-and-purge-its-contents > > I am attempting to manage a lighttpd module, so I''d like to manage > what''s in the the various conf-* directories. > > Thus, > > file { ["$conf_dir/ssl", "$conf_dir/conf-include", "$conf_dir/conf- > enabled", "$conf_dir/conf-available"]: > ensure => directory, > purge => true, > recurse => true, > force => true, > source => "puppet:///lighttpd/empty", > } > > Sadly, I get a string of errors: > > err: //lighttpd/File[/etc/lighttpd/ssl]: Failed to generate additional > resources during transaction: None of the provided sources exist > debug: //lighttpd/File[/etc/lighttpd/ssl]/checksum: Initializing > checksum hash > debug: //lighttpd/File[/etc/lighttpd/ssl]: Creating checksum {mtime} > Fri Jun 19 01:39:34 -0700 2009 > err: //lighttpd/File[/etc/lighttpd/ssl]: Failed to retrieve current > state of resource: No specified source was found from > puppet:///lighttpd/empty > err: //lighttpd/File[/etc/lighttpd/conf-enabled]: Failed to generate > additional resources during transaction: None of the provided sources > exist > debug: //lighttpd/File[/etc/lighttpd/conf-enabled]/checksum: > Initializing checksum hash > debug: //lighttpd/File[/etc/lighttpd/conf-enabled]: Creating checksum > {mtime}Fri Jun 19 13:58:35 -0700 2009 > err: //lighttpd/File[/etc/lighttpd/conf-enabled]: Failed to retrieve > current state of resource: No specified source was found from > puppet:///lighttpd/empty > > And so forth. > > And, these aren''t ''ignorable'' errors -- it doesn''t actually clean the > directory. > > This is pretty essential to have working, as otherwise you get what > led me to try and track this down in the first place, which is a > change to the puppet manifest leading to 2 different lighttpd configs > trying to have the same Document Root directory. (When, in fact, one > of them should have no longer existed.) > > I have the identical problem managing an /etc/monit.d/* directory''s > contents -- switching from, say, apache to lighttpd means monit will > still have the /etc/monit.d/apache file in there and they''ll be > fighting over port 80. (Sadface.) > > The last message referring to this as a valid workaround seems to have > been about 2 months ago, so it "should" still work? > > puppet: 0.24.8 > facter: 1.5.1 > ruby: ruby 1.8.7 (2008-08-11 patchlevel 72) [x86_64-linux] > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---