I have choosen to split my module into several .pp files as i have seen in an example and makes it cleaner i think. \modules\mysoftware\ init.pp install.pp config.pp service.pp Is that recommended or too many disadvantages ? So my install.pp went through fine, config.pp as well. When i change a config-file and puppet runs again i want the automatic service restart but doesnt work unfortunately. Does someone know the proper syntax how to trigger from config.pp the function in service.pp for such a case ? Examples like these dont work :-( notify => Class["mysoftware::service"] notify => Class["mysoftware::service::mysoftwarerestart"] ... I should mention that the service has to restart via a shell-script, not via init services ! So may be the service.pp needs some corrections too ? service.pp class mysoftware::service ( $user = "myuser", ) { exec {"mysoftwarerestart": command => "/opt/mysoftware/bin/script.sh restart", require => Class["mysoftware::config"], } } -- 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.
On Thursday, April 12, 2012 4:07:40 PM UTC-4, puppetguest wrote:> > I have choosen to split my module into several .pp files as i have > seen in an example and makes it cleaner i think. > > \modules\mysoftware\ > init.pp > install.pp > config.pp > service.pp > > Is that recommended or too many disadvantages ? > > So my install.pp went through fine, config.pp as well. > When i change a config-file and puppet runs again i want the automatic > service restart but doesnt work unfortunately. > > Does someone know the proper syntax how to trigger from config.pp the > function in service.pp for such a case ? > > Examples like these dont work :-( > notify => Class["mysoftware::service"] > notify => Class["mysoftware::service::mysoftwarerestart"] > ... > >How about: notify => Exec[''mysoftwarerestart''] You could also look at ''refreshonly'' under the type reference for exec: http://docs.puppetlabs.com/references/2.7.0/type.html#exec> I should mention that the service has to restart via a shell-script, > not via init services ! > So may be the service.pp needs some corrections too ? > > service.pp > > class mysoftware::service ( > $user = "myuser", > ) { > > exec {"mysoftwarerestart": > command => "/opt/mysoftware/bin/script.sh restart", > require => Class["mysoftware::config"], > } > > } > >-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/hzUXRE0EmLMJ. 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.
"notify => Class["mysoftware::service"]" should work without any problem. Did you remember to include it beforehand? include mysoftware::service "notify => Exec[''mysoftwarerestart'']" should work too. Cheers!! On Apr 12, 11:39 pm, Trevor Smith <trevor.c.sm...@gmail.com> wrote:> On Thursday, April 12, 2012 4:07:40 PM UTC-4, puppetguest wrote: > > > I have choosen to split my module into several .pp files as i have > > seen in an example and makes it cleaner i think. > > > \modules\mysoftware\ > > init.pp > > install.pp > > config.pp > > service.pp > > > Is that recommended or too many disadvantages ? > > > So my install.pp went through fine, config.pp as well. > > When i change a config-file and puppet runs again i want the automatic > > service restart but doesnt work unfortunately. > > > Does someone know the proper syntax how to trigger from config.pp the > > function in service.pp for such a case ? > > > Examples like these dont work :-( > > notify => Class["mysoftware::service"] > > notify => Class["mysoftware::service::mysoftwarerestart"] > > ... > > How about: > > notify => Exec[''mysoftwarerestart''] > > You could also look at ''refreshonly'' under the type reference for exec: http://docs.puppetlabs.com/references/2.7.0/type.html#exec > > > > > > > > > I should mention that the service has to restart via a shell-script, > > not via init services ! > > So may be the service.pp needs some corrections too ? > > > service.pp > > > class mysoftware::service ( > > $user = "myuser", > > ) { > > > exec {"mysoftwarerestart": > > command => "/opt/mysoftware/bin/script.sh restart", > > require => Class["mysoftware::config"], > > } > > > }-- 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.
Works like a charm now: include mysoftware::service and notify => Class["mysoftware::service"], Thanks! 2012/4/13 Sans <r.santanu.das@gmail.com>> "notify => Class["mysoftware::service"]" should work without any > problem. Did you remember to include it beforehand? > > include mysoftware::service > > > "notify => Exec[''mysoftwarerestart'']" should work too. Cheers!! > > > > On Apr 12, 11:39 pm, Trevor Smith <trevor.c.sm...@gmail.com> wrote: > > On Thursday, April 12, 2012 4:07:40 PM UTC-4, puppetguest wrote: > > > > > I have choosen to split my module into several .pp files as i have > > > seen in an example and makes it cleaner i think. > > > > > \modules\mysoftware\ > > > init.pp > > > install.pp > > > config.pp > > > service.pp > > > > > Is that recommended or too many disadvantages ? > > > > > So my install.pp went through fine, config.pp as well. > > > When i change a config-file and puppet runs again i want the automatic > > > service restart but doesnt work unfortunately. > > > > > Does someone know the proper syntax how to trigger from config.pp the > > > function in service.pp for such a case ? > > > > > Examples like these dont work :-( > > > notify => Class["mysoftware::service"] > > > notify => Class["mysoftware::service::mysoftwarerestart"] > > > ... > > > > How about: > > > > notify => Exec[''mysoftwarerestart''] > > > > You could also look at ''refreshonly'' under the type reference for exec: > http://docs.puppetlabs.com/references/2.7.0/type.html#exec > > > > > > > > > > > > > > > > > I should mention that the service has to restart via a shell-script, > > > not via init services ! > > > So may be the service.pp needs some corrections too ? > > > > > service.pp > > > > > class mysoftware::service ( > > > $user = "myuser", > > > ) { > > > > > exec {"mysoftwarerestart": > > > command => "/opt/mysoftware/bin/script.sh restart", > > > require => Class["mysoftware::config"], > > > } > > > > > } > > -- > 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.
On Apr 12, 3:07 pm, puppetguest <amorph...@gmail.com> wrote:> I have choosen to split my module into several .pp files as i have > seen in an example and makes it cleaner i think. > > \modules\mysoftware\ > init.pp > install.pp > config.pp > service.pp > > Is that recommended or too many disadvantages ?The recommended method is to put each class and each definition in its own file. If there is a class with the same qualified name as the module then it goes in the init.pp; all other classes and definitions should go into files whose names correspond to the name of the class or definition they contain. How you assign resources to classes is an entirely separate question. That may be more what you were asking about, but if you want opinions on that question then you''ll need to show us what you''re doing. 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.