kdo
2013-Sep-08 23:37 UTC
[Puppet Users] Run a build module on first logon for new puppet clients
Hey All, I have been wondering how it might be possible to run a specific build module when a puppet client signs in for the first time after being built. So I guess the puppet master would need to be run in auto sign in mode and then have a specific build module applied, ideally just once. Anyone looked into this before ? this build module is used to configure a server from start to finish at build time only and is the removed. this would remove an additional step in our build process -- 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+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out.
Martin Alfke
2013-Sep-09 07:35 UTC
Re: [Puppet Users] Run a build module on first logon for new puppet clients
Hi Karl, you can achieve this by one of the following procedures: 1. by stage - enable stages http://docs.puppetlabs.com/puppet/latest/reference/lang_run_stages.html - put build class into an early stage - put all other classes into main stage Pro: does need one puppet run only. 2. by fact - in initial class we manage a fact (/etc/facter/facts.d) and provide all required resources which are needed initially. - in standard modules we check for fact availability. Note: the fact does not get delivered via pluginsync. Con: needs two puppet runs as minimum. hth, Martin On Sep 9, 2013, at 1:37 AM, kdo <karl@hampels.com.au> wrote:> Hey All, > > I have been wondering how it might be possible to run a specific build module when a puppet client signs in for the first time after being built. So I guess the puppet master would need to be run in auto sign in mode and then have a specific build module applied, ideally just once. Anyone looked into this before ? > > this build module is used to configure a server from start to finish at build time only and is the removed. this would remove an additional step in our build process > > > > > > -- > 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+unsubscribe@googlegroups.com. > To post to this group, send email to puppet-users@googlegroups.com. > Visit this group at http://groups.google.com/group/puppet-users. > For more options, visit https://groups.google.com/groups/opt_out.-- 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+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out.
jcbollinger
2013-Sep-09 13:51 UTC
Re: [Puppet Users] Run a build module on first logon for new puppet clients
On Monday, September 9, 2013 2:35:39 AM UTC-5, Martin Alfke wrote:> > Hi Karl, > > you can achieve this by one of the following procedures: > > 1. by stage > - enable stages > http://docs.puppetlabs.com/puppet/latest/reference/lang_run_stages.html > - put build class into an early stage > - put all other classes into main stage > > Pro: does need one puppet run only. > >Con: does not accomplish the OP''s objective. He wants to apply a module only on the first Puppet run (or at least that''s how I read him). Using stages could cause the module to be applied before all the others, but would not prevent it from being applied on every run.> 2. by fact > - in initial class we manage a fact (/etc/facter/facts.d) and provide all > required resources which are needed initially. > - in standard modules we check for fact availability. > > Note: the fact does not get delivered via pluginsync. > Con: needs two puppet runs as minimum. > >I think two runs is exactly what the OP is looking for: the first run is different from all subsequent ones. A fact-based approach can accomplish this, either with a full-fledged, plugin-synced custom fact or with a facts.d-based one. The basic idea is that declaration of the system-initialization class is conditioned on some fact value, and application of that class modifies the system so that the fact value reported on subsequent runs is different (so that the condition for declaring the system-initialization class is no longer satisfied). 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 puppet-users+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out.
kdo
2013-Sep-10 23:24 UTC
[Puppet Users] Re: Run a build module on first logon for new puppet clients
Thank you very much for your replies, they got me thinking and I now think I have a work around that could work in our environment using a custom fact at first sign in which then calls a build module. once the build module has run it clears up the trigger and the server then gets filtered as normal depending on the environment its in. many thanks for taking the time to reply, very much appreciated. On Monday, September 9, 2013 9:37:55 AM UTC+10, kdo wrote:> > Hey All, > > I have been wondering how it might be possible to run a specific build > module when a puppet client signs in for the first time after being built. > So I guess the puppet master would need to be run in auto sign in mode and > then have a specific build module applied, ideally just once. Anyone looked > into this before ? > > this build module is used to configure a server from start to finish at > build time only and is the removed. this would remove an additional step in > our build process > > > > >-- 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+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out.