Silviu Paragina
2009-Dec-07 19:31 UTC
[Puppet Users] Stop(or restart and/or reload facts/providers) execution on some conditions
Is this possible? There are some cases when you really require this. Some are related to providers which don''t load unless some packages are installed (see augeas, the recent post about cron). The biggest problem where I need to do this is when lsb-release isn''t installed on a Ubuntu system and as a result the system is detected as debian, which can seriously damage the system. 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.
Silviu Paragina
2009-Dec-07 20:01 UTC
Re: [Puppet Users] Stop(or restart and/or reload facts/providers) execution on some conditions
I forgot to add, I need some resources applied in this case so fail won''t be enough because it fails before applying any resources. example: in the case where lsb-release isn''t installed on a $operatingsystem == "Debian" system I would like to install lsb-realease and then fail or restart just to be sure I''m not actually on a Ubuntu system Another example would be augeas, where, even if in a run augeas would be installed, puppet would fail because of missing augeas provider. Silviu PS sorry for spamming the list :"> On 07.12.2009 21:31, Silviu Paragina wrote:> Is this possible? > > There are some cases when you really require this. Some are related to > providers which don''t load unless some packages are installed (see > augeas, the recent post about cron). > > The biggest problem where I need to do this is when lsb-release isn''t > installed on a Ubuntu system and as a result the system is detected as > debian, which can seriously damage the system. > > > 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. > > >-- 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.
David Schmitt
2009-Dec-08 10:17 UTC
Re: [Puppet Users] Stop(or restart and/or reload facts/providers) execution on some conditions
On 07.12.2009 21:01, Silviu Paragina wrote:> I forgot to add, I need some resources applied in this case so fail > won''t be enough because it fails before applying any resources. > > example: in the case where lsb-release isn''t installed on a > $operatingsystem == "Debian" system I would like to install lsb-realease > and then fail or restart just to be sure I''m not actually on a Ubuntu system > > Another example would be augeas, where, even if in a run augeas would be > installed, puppet would fail because of missing augeas provider.Put all clients which do not have lsb-release and/or augeas installed into a separate bootstrap mode. You can use environments and/or tags to implement this. In this special mode just install the tools you need. The next run will resume with the full information available. Normally this "special" bootstrap run is already done from the installer to make this very easy, e.g. in debian-installer''s postcmd: puppetd --environment bootstrap-debian --onetime --no-daemonize Regards, DavidS> > > Silviu > PS sorry for spamming the list :"> > > > On 07.12.2009 21:31, Silviu Paragina wrote: >> Is this possible? >> >> There are some cases when you really require this. Some are related to >> providers which don''t load unless some packages are installed (see >> augeas, the recent post about cron). >> >> The biggest problem where I need to do this is when lsb-release isn''t >> installed on a Ubuntu system and as a result the system is detected as >> debian, which can seriously damage the system. >> >> >> 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. >> >> >> > > -- > > 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. > > >-- 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
2009-Dec-08 14:00 UTC
Re: [Puppet Users] Stop(or restart and/or reload facts/providers) execution on some conditions
On 08.12.2009 12:17, David Schmitt wrote:> On 07.12.2009 21:01, Silviu Paragina wrote: > >> I forgot to add, I need some resources applied in this case so fail >> won''t be enough because it fails before applying any resources. >> >> example: in the case where lsb-release isn''t installed on a >> $operatingsystem == "Debian" system I would like to install lsb-realease >> and then fail or restart just to be sure I''m not actually on a Ubuntu system >> >> Another example would be augeas, where, even if in a run augeas would be >> installed, puppet would fail because of missing augeas provider. >> > Put all clients which do not have lsb-release and/or augeas installed > into a separate bootstrap mode. You can use environments and/or tags to > implement this. > > In this special mode just install the tools you need. The next run will > resume with the full information available. > > Normally this "special" bootstrap run is already done from the installer > to make this very easy, e.g. in debian-installer''s postcmd: > > puppetd --environment bootstrap-debian --onetime --no-daemonize > > > Regards, DavidS >Can this be automated, if somebody uninstalls lsb-release by mistake for example? aptitude has a bad habit of doing this... And can it be done from a manifest the standard puppet way? One possible way I can think of this is to run puppet (not puppetd) with an exec, but I''m not sure about the locks puppet uses (if the locks are different from puppetd):-? . Silviu>> >> Silviu >> PS sorry for spamming the list :"> >> >> >> On 07.12.2009 21:31, Silviu Paragina wrote: >> >>> Is this possible? >>> >>> There are some cases when you really require this. Some are related to >>> providers which don''t load unless some packages are installed (see >>> augeas, the recent post about cron). >>> >>> The biggest problem where I need to do this is when lsb-release isn''t >>> installed on a Ubuntu system and as a result the system is detected as >>> debian, which can seriously damage the system. >>> >>> >>> 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. >>> >>> >>> >>> >> -- >> >> 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. >> >> >> >> > -- > > 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. > > >-- 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.
David Schmitt
2009-Dec-09 07:25 UTC
Re: [Puppet Users] Stop(or restart and/or reload facts/providers) execution on some conditions
On 08.12.2009 15:00, Silviu Paragina wrote:> On 08.12.2009 12:17, David Schmitt wrote: >> On 07.12.2009 21:01, Silviu Paragina wrote: >> >>> I forgot to add, I need some resources applied in this case so fail >>> won''t be enough because it fails before applying any resources. >>> >>> example: in the case where lsb-release isn''t installed on a >>> $operatingsystem == "Debian" system I would like to install lsb-realease >>> and then fail or restart just to be sure I''m not actually on a Ubuntu system >>> >>> Another example would be augeas, where, even if in a run augeas would be >>> installed, puppet would fail because of missing augeas provider. >>> >> Put all clients which do not have lsb-release and/or augeas installed >> into a separate bootstrap mode. You can use environments and/or tags to >> implement this. >> >> In this special mode just install the tools you need. The next run will >> resume with the full information available. >> >> Normally this "special" bootstrap run is already done from the installer >> to make this very easy, e.g. in debian-installer''s postcmd: >> >> puppetd --environment bootstrap-debian --onetime --no-daemonize >> >> >> Regards, DavidS >> > Can this be automated, if somebody uninstalls lsb-release by mistake for > example? aptitude has a bad habit of doing this... > And can it be done from a manifest the standard puppet way? > One possible way I can think of this is to run puppet (not puppetd) with > an exec, but I''m not sure about the locks puppet uses (if the locks are > different from puppetd):-?If you can detect from the facts that an erreneous situation is ocurring, you could change the environment at the node level or in an external node script. Regards, DavidS -- 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.
jcbollinger
2009-Dec-09 13:56 UTC
[Puppet Users] Re: Stop(or restart and/or reload facts/providers) execution on some conditions
On Dec 9, 1:25 am, David Schmitt <da...@dasz.at> wrote:> If you can detect from the facts that an erreneous situation is > ocurring, you could change the environment at the node level or in an > external node script.Or, if you can know from the facts presented (or otherwise) what the correct provider is, but you can''t rely on Puppet to autodetect it correctly, then you can specify the provider explicitly. Resource default parameters are good for doing that. That removes the need to perform multiple runs. Note also that the above is a general principle of Puppet; it is not restricted to this particular scenario. John -- 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
2009-Dec-09 15:11 UTC
Re: [Puppet Users] Stop(or restart and/or reload facts/providers) execution on some conditions
On 09.12.2009 09:25, David Schmitt wrote:> > If you can detect from the facts that an erreneous situation is > ocurring, you could change the environment at the node level or in an > external node script. > > > Regards, DavidS >You mean something like node problem { if (condition) { }else { #normal stuff } } On 09.12.2009 15:56, jcbollinger wrote:> Or, if you can know from the facts presented (or otherwise) what the > correct provider is, but you can''t rely on Puppet to autodetect it > correctly, then you can specify the provider explicitly. Resource > default parameters are good for doing that. That removes the need to > perform multiple runs. > > Note also that the above is a general principle of Puppet; it is not > restricted to this particular scenario. >My problem case is on Ubuntu sytem where lsb-release isn''t installed as such the system is detected as debian. I don''t want any debian specific stuff going on a ubuntu system. Thank you for your answers, 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.
David Schmitt
2009-Dec-10 09:55 UTC
Re: [Puppet Users] Stop(or restart and/or reload facts/providers) execution on some conditions
On 09.12.2009 16:11, Silviu Paragina wrote:> On 09.12.2009 09:25, David Schmitt wrote: >> >> If you can detect from the facts that an erreneous situation is >> ocurring, you could change the environment at the node level or in an >> external node script. >> >> >> Regards, DavidS >> > You mean something like > node problem > { > if (condition) > { > }else > { > #normal stuff > } > }Exactly!> On 09.12.2009 15:56, jcbollinger wrote: >> Or, if you can know from the facts presented (or otherwise) what the >> correct provider is, but you can''t rely on Puppet to autodetect it >> correctly, then you can specify the provider explicitly. Resource >> default parameters are good for doing that. That removes the need to >> perform multiple runs. >> >> Note also that the above is a general principle of Puppet; it is not >> restricted to this particular scenario. >> > > My problem case is on Ubuntu sytem where lsb-release isn''t installed as > such the system is detected as debian. > I don''t want any debian specific stuff going on a ubuntu system.Well, you can have ($lsb_release == '''') as condition. Then you can just install the lsb-release package and the next run will have the correct facts. Regards, DavidS -- 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.