[Puppet Users] Re: restart NginX ONCE (after default file has been removed)
Also, it looks like somebody tried to fix this previously but the changes weren't merged in. See https://github.com/voxpupuli/puppet-nginx/issues/333 for example. IMO there should be a class parameter to control this behavior so you might want to submit a PR with any changes you make. On Friday, March 3, 2017 at 7:00:36 AM UTC-5, Steve Button wrote: > > Hi, > > I've got a small piece of puppet in my profile module to remove the > default nginx.conf file which gets installed by the nginx module. > > # Upon install this file gets created and displays "Welcome to NginX" page, > which we don't need. > file { '/etc/nginx/conf.d/default.conf': > ensure => 'absent', > # Need to force NGinx to restart after this change has completed so we > don't get a default page. > notify => Service['ningx'], > } > > > However this fails because the service is defined within with NginX module, > not the profile. > > > Am I going about this in the wrong way? > > > Obviously I don't want it to restart every time Puppet runs, only triggered > by the file being removed. > > > I was to avoid modifying the component module > https://forge.puppet.com/puppet/nginx if at all possible. > > > Thanks, > > -- 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+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/81fb7aab-b02d-4311-80c2-0cf51bbb9ece%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[Puppet Users] Re: restart NginX ONCE (after default file has been removed)
notify events are queued and grouped together so nginx should only be restarted once when puppet runs. You may also need to include nginx in your profile so that the service is properly defined. On Friday, March 3, 2017 at 7:00:36 AM UTC-5, Steve Button wrote: > > Hi, > > I've got a small piece of puppet in my profile module to remove the > default nginx.conf file which gets installed by the nginx module. > > # Upon install this file gets created and displays "Welcome to NginX" page, > which we don't need. > file { '/etc/nginx/conf.d/default.conf': > ensure => 'absent', > # Need to force NGinx to restart after this change has completed so we > don't get a default page. > notify => Service['ningx'], > } > > > However this fails because the service is defined within with NginX module, > not the profile. > > > Am I going about this in the wrong way? > > > Obviously I don't want it to restart every time Puppet runs, only triggered > by the file being removed. > > > I was to avoid modifying the component module > https://forge.puppet.com/puppet/nginx if at all possible. > > > Thanks, > > -- 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+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/3fd6ee29-96e5-4c38-927d-730fb09d8fd0%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.