Silviu Paragina
2010-Jun-28 18:00 UTC
[Puppet Users] Puppetlabs Apache module - problem/solution/question
I''m trying out the apache module from puppet labs. Note the a2mod type in it. Now I have uncovered the classical provider problem with it. If you require some apache modules enabled and you don''t have apache installed you get the classical no provider for a2mod (in this particular case) and puppet bails out, without actually doing anything aside from fact/type sync. Now leaving aside augeas/cron which might be considered puppet requirements, apache might not be installed on a system, therefore, it is a requirement for this module to work with apache installed or not. Adding a fact for "is apache installed" is kind of cumbersome for this case and my solution was to add a bogus provider. nona2mod.rb: Puppet::Type.type(:a2mod).provide(:nona2mod) do desc "Provider in case there is no a2enmod/a2dismod installed on the current system." def create fail("Apache not yet installed") end def destroy fail("Apache not yet installed") end def exists? mod= "/etc/apache2/mods-enabled/" + resource[:name] + ".load" File.exists?(mod) end end This works for me, by failing the a2mod resources in case apache in not installed. Now the questions (hope you get to read till here :) ) 1. Is this a good ideea? (if not why not?) From other discussions, I know that this is how puppet should behave in general about type providers. 2. Should I open a ticket to add this new file for the apache module? 3. This seems trivial. Why wasn''t it done for augeas/cron? Should I open a ticket for those, possibly adding the code? Silviu -- 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.
Peter Meier
2010-Jun-28 18:16 UTC
Re: [Puppet Users] Puppetlabs Apache module - problem/solution/question
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1> 1. Is this a good ideea? (if not why not?) From other discussions, I > know that this is how puppet should behave in general about type providers. > 2. Should I open a ticket to add this new file for the apache module? > 3. This seems trivial. Why wasn''t it done for augeas/cron? Should I open > a ticket for those, possibly adding the code?according to Luke @ puppetcamp Europe this is a problem that should be fixed within puppet. So it should be possible to define that package cron or apache should be installed and all the cron/a2mod depend on that package and puppet shouldn''t fail before. I''m not sure if somebody already opened a ticket for that (probably for the cron issue). I not go ahead and create one. cheers pete -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkwo5xcACgkQbwltcAfKi38AOQCeKrUoETphZsfcTa6k2DQq9RyT 1dkAnj2WgRVbr67HS1Ny0s/hP8zrCDmr =b+A9 -----END PGP SIGNATURE----- -- 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.
Silviu Paragina
2010-Jun-28 18:33 UTC
Re: [Puppet Users] Puppetlabs Apache module - problem/solution/question
On 28.06.2010 21:16, Peter Meier wrote:> -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > >> 1. Is this a good ideea? (if not why not?) From other discussions, I >> know that this is how puppet should behave in general about type providers. >> 2. Should I open a ticket to add this new file for the apache module? >> 3. This seems trivial. Why wasn''t it done for augeas/cron? Should I open >> a ticket for those, possibly adding the code? >> > according to Luke @ puppetcamp Europe this is a problem that should be > fixed within puppet. So it should be possible to define that package > cron or apache should be installed and all the cron/a2mod depend on that > package and puppet shouldn''t fail before. >I totally agree with this, but shouldn''t the apache module work prior to this happening in puppet? My big big question is if should I submit this file to James, for the apache module? Looking from a practical viewpoint augeas usually gets installed with puppet automatically, and cron is probably already there. But on a new system to have apache already installed is improbable. Silviu -- 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.
James Turnbull
2010-Jun-28 20:27 UTC
Re: [Puppet Users] Puppetlabs Apache module - problem/solution/question
Silviu Paragina wrote:>> according to Luke @ puppetcamp Europe this is a problem that should be >> fixed within puppet. So it should be possible to define that package >> cron or apache should be installed and all the cron/a2mod depend on that >> package and puppet shouldn''t fail before. >> > I totally agree with this, but shouldn''t the apache module work prior to > this happening in puppet? My big big question is if should I submit this > file to James, for the apache module? Looking from a practical viewpoint > augeas usually gets installed with puppet automatically, and cron is > probably already there. But on a new system to have apache already > installed is improbable.Let me discuss this internally a little and see what Luke had planned for the fix - I agree it''s an issue. Of interest on the same topic - does anyone have a good way to include/remove modules on non-Debian/Ubuntu Apache installations? Regards James Turnbull -- Puppet Labs - http://www.puppetlabs.com C: 503-734-8571 -- 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.