Hi all, I''m working thru the tutorial (http://docs.puppetlabs.com/learning/ manifests.html) using the VM provided (http://www.puppetlabs.com/ downloads/learning/learn_puppet_centos_ovf.2011.07.15.tar.bz). When asked to write a manifest that ensures httpd is running, I wrote: service { ''httpd'': ensure => running, enable => true, } I named this manifest "httpd.pp". When I ran `puppet apply httpd.pp` nothing happens. If I rename this manifest to something else `puppet apply` works as I would expect. This was/is extremely confusing. I figured what better way to name the manifest than to name the service it''s ensuring. Is this a known issue? Documentation problem? Something else? Thanks for you help. Matthew -- 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 Tue, Nov 15, 2011 at 04:40:29PM -0800, Matthew O''Connor wrote:> Hi all, > > I''m working thru the tutorial (http://docs.puppetlabs.com/learning/ > manifests.html) using the VM provided (http://www.puppetlabs.com/ > downloads/learning/learn_puppet_centos_ovf.2011.07.15.tar.bz). When > asked to write a manifest that ensures httpd is running, I wrote: > > service { ''httpd'': > ensure => running, > enable => true, > } > > I named this manifest "httpd.pp". When I ran `puppet apply httpd.pp` > nothing happens. If I rename this manifest to something else `puppet > apply` works as I would expect.puppet apply --debug --verbose httpd.pp If the service is already running and enabled then puppet won''t do anything.> This was/is extremely confusing. I figured what better way to name the > manifest than to name the service it''s ensuring. Is this a known > issue? Documentation problem? Something else?I don''t know that filenames of manifests affect anything. Running with debug and verbose flags as above will show you more about what''s going on.> Thanks for you help. > > Matthew > > -- > 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.
When I run `puppet apply --verbose --debug httpd.pp`, the last lines printed are: debug: Finishing transaction -608038528 debug: Loaded state in 0.00 seconds info: Applying configuration version ''1321356508'' debug: Service[httpd](provider=redhat): Executing ''ps -ef'' debug: Service[httpd](provider=redhat): PID is 17243 debug: Puppet::Type::Service::ProviderRedhat: Executing ''/sbin/chkconfig httpd'' debug: Finishing transaction -608222128 debug: Storing state debug: Stored state in 0.01 seconds When I run `puppet apply --verbose --debug start.pp`, the last lines printed are: debug: Finishing transaction -607971218 debug: Loaded state in 0.00 seconds info: Applying configuration version ''1321356691'' debug: Service[httpd](provider=redhat): Executing ''ps -ef'' debug: Puppet::Type::Service::ProviderRedhat: Executing ''/sbin/chkconfig httpd'' debug: Service[httpd](provider=redhat): Executing ''/sbin/service httpd start'' debug: Puppet::Type::Service::ProviderRedhat: Executing ''/sbin/chkconfig httpd'' notice: /Stage[main]//Service[httpd]/ensure: ensure changed ''stopped'' to ''running'' debug: Finishing transaction -608154818 debug: Storing state debug: Stored state in 0.01 seconds I made sure to stop `httpd` before each run. `start.pp` and `httpd.pp` have the same contents. Any other thoughts? On Wed, Nov 16, 2011 at 9:00 AM, Christopher Wood < christopher_wood@pobox.com> wrote:> On Tue, Nov 15, 2011 at 04:40:29PM -0800, Matthew O''Connor wrote: > > Hi all, > > > > I''m working thru the tutorial (http://docs.puppetlabs.com/learning/ > > manifests.html) using the VM provided (http://www.puppetlabs.com/ > > downloads/learning/learn_puppet_centos_ovf.2011.07.15.tar.bz). When > > asked to write a manifest that ensures httpd is running, I wrote: > > > > service { ''httpd'': > > ensure => running, > > enable => true, > > } > > > > I named this manifest "httpd.pp". When I ran `puppet apply httpd.pp` > > nothing happens. If I rename this manifest to something else `puppet > > apply` works as I would expect. > > puppet apply --debug --verbose httpd.pp > > If the service is already running and enabled then puppet won''t do > anything. > > > This was/is extremely confusing. I figured what better way to name the > > manifest than to name the service it''s ensuring. Is this a known > > issue? Documentation problem? Something else? > > I don''t know that filenames of manifests affect anything. Running with > debug and verbose flags as above will show you more about what''s going on. > > > Thanks for you help. > > > > Matthew > > > > -- > > 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.
Do you have another http daemon running, by chance? If I''m reading this right, the first run seems to think it found another httpd server on PID 17243 - what''s running on that process? On Wed, Nov 16, 2011 at 9:37 AM, Matthew O''Connor <thegreendragon@gmail.com>wrote:> When I run `puppet apply --verbose --debug httpd.pp`, the last lines > printed are: > > debug: Finishing transaction -608038528 > debug: Loaded state in 0.00 seconds > info: Applying configuration version ''1321356508'' > debug: Service[httpd](provider=redhat): Executing ''ps -ef'' > debug: Service[httpd](provider=redhat): PID is 17243 > debug: Puppet::Type::Service::ProviderRedhat: Executing ''/sbin/chkconfig > httpd'' > debug: Finishing transaction -608222128 > debug: Storing state > debug: Stored state in 0.01 seconds > > When I run `puppet apply --verbose --debug start.pp`, the last lines > printed are: > > debug: Finishing transaction -607971218 > debug: Loaded state in 0.00 seconds > info: Applying configuration version ''1321356691'' > debug: Service[httpd](provider=redhat): Executing ''ps -ef'' > debug: Puppet::Type::Service::ProviderRedhat: Executing ''/sbin/chkconfig > httpd'' > debug: Service[httpd](provider=redhat): Executing ''/sbin/service httpd > start'' > debug: Puppet::Type::Service::ProviderRedhat: Executing ''/sbin/chkconfig > httpd'' > notice: /Stage[main]//Service[httpd]/ensure: ensure changed ''stopped'' to > ''running'' > debug: Finishing transaction -608154818 > debug: Storing state > debug: Stored state in 0.01 seconds > > I made sure to stop `httpd` before each run. `start.pp` and `httpd.pp` > have the same contents. > > Any other thoughts? > > > On Wed, Nov 16, 2011 at 9:00 AM, Christopher Wood < > christopher_wood@pobox.com> wrote: > >> On Tue, Nov 15, 2011 at 04:40:29PM -0800, Matthew O''Connor wrote: >> > Hi all, >> > >> > I''m working thru the tutorial (http://docs.puppetlabs.com/learning/ >> > manifests.html) using the VM provided (http://www.puppetlabs.com/ >> > downloads/learning/learn_puppet_centos_ovf.2011.07.15.tar.bz). When >> > asked to write a manifest that ensures httpd is running, I wrote: >> > >> > service { ''httpd'': >> > ensure => running, >> > enable => true, >> > } >> > >> > I named this manifest "httpd.pp". When I ran `puppet apply httpd.pp` >> > nothing happens. If I rename this manifest to something else `puppet >> > apply` works as I would expect. >> >> puppet apply --debug --verbose httpd.pp >> >> If the service is already running and enabled then puppet won''t do >> anything. >> >> > This was/is extremely confusing. I figured what better way to name the >> > manifest than to name the service it''s ensuring. Is this a known >> > issue? Documentation problem? Something else? >> >> I don''t know that filenames of manifests affect anything. Running with >> debug and verbose flags as above will show you more about what''s going on. >> >> > Thanks for you help. >> > >> > Matthew >> > >> > -- >> > 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.
I looked for that. There''s not any other http daemon running. The PID that the first returns changes every time (now at 23052, 23139, etc.). The second one never returns a PID (unless there''s actually an httpd running). On Wed, Nov 16, 2011 at 10:54 AM, Russell Van Tassell <russellvt@gmail.com>wrote:> Do you have another http daemon running, by chance? If I''m reading this > right, the first run seems to think it found another httpd server on PID > 17243 - what''s running on that process? > > > > On Wed, Nov 16, 2011 at 9:37 AM, Matthew O''Connor < > thegreendragon@gmail.com> wrote: > >> When I run `puppet apply --verbose --debug httpd.pp`, the last lines >> printed are: >> >> debug: Finishing transaction -608038528 >> debug: Loaded state in 0.00 seconds >> info: Applying configuration version ''1321356508'' >> debug: Service[httpd](provider=redhat): Executing ''ps -ef'' >> debug: Service[httpd](provider=redhat): PID is 17243 >> debug: Puppet::Type::Service::ProviderRedhat: Executing ''/sbin/chkconfig >> httpd'' >> debug: Finishing transaction -608222128 >> debug: Storing state >> debug: Stored state in 0.01 seconds >> >> When I run `puppet apply --verbose --debug start.pp`, the last lines >> printed are: >> >> debug: Finishing transaction -607971218 >> debug: Loaded state in 0.00 seconds >> info: Applying configuration version ''1321356691'' >> debug: Service[httpd](provider=redhat): Executing ''ps -ef'' >> debug: Puppet::Type::Service::ProviderRedhat: Executing ''/sbin/chkconfig >> httpd'' >> debug: Service[httpd](provider=redhat): Executing ''/sbin/service httpd >> start'' >> debug: Puppet::Type::Service::ProviderRedhat: Executing ''/sbin/chkconfig >> httpd'' >> notice: /Stage[main]//Service[httpd]/ensure: ensure changed ''stopped'' to >> ''running'' >> debug: Finishing transaction -608154818 >> debug: Storing state >> debug: Stored state in 0.01 seconds >> >> I made sure to stop `httpd` before each run. `start.pp` and `httpd.pp` >> have the same contents. >> >> Any other thoughts? >> >> >> On Wed, Nov 16, 2011 at 9:00 AM, Christopher Wood < >> christopher_wood@pobox.com> wrote: >> >>> On Tue, Nov 15, 2011 at 04:40:29PM -0800, Matthew O''Connor wrote: >>> > Hi all, >>> > >>> > I''m working thru the tutorial (http://docs.puppetlabs.com/learning/ >>> > manifests.html) using the VM provided (http://www.puppetlabs.com/ >>> > downloads/learning/learn_puppet_centos_ovf.2011.07.15.tar.bz). When >>> > asked to write a manifest that ensures httpd is running, I wrote: >>> > >>> > service { ''httpd'': >>> > ensure => running, >>> > enable => true, >>> > } >>> > >>> > I named this manifest "httpd.pp". When I ran `puppet apply httpd.pp` >>> > nothing happens. If I rename this manifest to something else `puppet >>> > apply` works as I would expect. >>> >>> puppet apply --debug --verbose httpd.pp >>> >>> If the service is already running and enabled then puppet won''t do >>> anything. >>> >>> > This was/is extremely confusing. I figured what better way to name the >>> > manifest than to name the service it''s ensuring. Is this a known >>> > issue? Documentation problem? Something else? >>> >>> I don''t know that filenames of manifests affect anything. Running with >>> debug and verbose flags as above will show you more about what''s going on. >>> >>> > Thanks for you help. >>> > >>> > Matthew >>> > >>> > -- >>> > 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. >-- 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 Wed, Nov 16, 2011 at 2:14 PM, Matthew O''Connor <thegreendragon@gmail.com> wrote:> I looked for that. There''s not any other http daemon running. The PID that > the first returns changes every time (now at 23052, 23139, etc.). The second > one never returns a PID (unless there''s actually an httpd running). >Add hasstatus so it uses service instead of ps -ef for checking the service: service { ''httpd'': ensure => running, enable => true, hasstatus => true, } Thanks, Nan -- 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.
That fixed it. Oh, I think I see what''s going on: When I run `puppet httpd.pp`, it runs `ps` and finds a process with `httpd` in the name and so concludes the service is running. If I rename the script to something else then Puppet no longer finds any process with ''httpd'' in its name. Perhaps Puppet should have a check that prevents thinking it is the satisfying service? Thanks, Matt On Wed, Nov 16, 2011 at 12:54 PM, Nan Liu <nan@puppetlabs.com> wrote:> On Wed, Nov 16, 2011 at 2:14 PM, Matthew O''Connor > <thegreendragon@gmail.com> wrote: > > I looked for that. There''s not any other http daemon running. The PID > that > > the first returns changes every time (now at 23052, 23139, etc.). The > second > > one never returns a PID (unless there''s actually an httpd running). > > > > Add hasstatus so it uses service instead of ps -ef for checking the > service: > > service { ''httpd'': > ensure => running, > enable => true, > hasstatus => true, > } > > Thanks, > > Nan > > -- > 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 can setup a "pattern" with a regular expression to weed-out the process list if you don''t use "hasstatus" http://docs.puppetlabs.com/references/latest/type.html#service ...but, sounds like you nailed it. On Wed, Nov 16, 2011 at 12:18 PM, Matthew O''Connor <thegreendragon@gmail.com> wrote:> That fixed it. > > Oh, I think I see what''s going on: > > When I run `puppet httpd.pp`, it runs `ps` and finds a process with > `httpd` in the name and so concludes the service is running. If I rename > the script to something else then Puppet no longer finds any process with > ''httpd'' in its name. > > Perhaps Puppet should have a check that prevents thinking it is the > satisfying service? > > Thanks, > Matt > > > On Wed, Nov 16, 2011 at 12:54 PM, Nan Liu <nan@puppetlabs.com> wrote: > >> On Wed, Nov 16, 2011 at 2:14 PM, Matthew O''Connor >> <thegreendragon@gmail.com> wrote: >> > I looked for that. There''s not any other http daemon running. The PID >> that >> > the first returns changes every time (now at 23052, 23139, etc.). The >> second >> > one never returns a PID (unless there''s actually an httpd running). >> > >> >> Add hasstatus so it uses service instead of ps -ef for checking the >> service: >> >> service { ''httpd'': >> ensure => running, >> enable => true, >> hasstatus => true, >> } >> >> Thanks, >> >> Nan >> >> -- >> 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.
On Wed, Nov 16, 2011 at 12:18 PM, Matthew O''Connor <thegreendragon@gmail.com> wrote:> That fixed it. > > Oh, I think I see what''s going on: > > When I run `puppet httpd.pp`, it runs `ps` and finds a process with > `httpd` in the name and so concludes the service is running. If I rename > the script to something else then Puppet no longer finds any process with > ''httpd'' in its name. > > Perhaps Puppet should have a check that prevents thinking it is the > satisfying service? > >That seems reasonable, but how would you handle the case where you want puppet to handle the puppet service? -- 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.
Hm, I hadn''t thought of that. Do you have a time where one instance of Puppet would manage itself - versus managing another running copy of Puppet? On Wed, Nov 16, 2011 at 3:54 PM, Nigel Kersten <nigel@puppetlabs.com> wrote:> > > On Wed, Nov 16, 2011 at 12:18 PM, Matthew O''Connor < > thegreendragon@gmail.com> wrote: > >> That fixed it. >> >> Oh, I think I see what''s going on: >> >> When I run `puppet httpd.pp`, it runs `ps` and finds a process with >> `httpd` in the name and so concludes the service is running. If I rename >> the script to something else then Puppet no longer finds any process with >> ''httpd'' in its name. >> >> Perhaps Puppet should have a check that prevents thinking it is the >> satisfying service? >> >> > That seems reasonable, but how would you handle the case where you want > puppet to handle the puppet service? > > -- > 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 Wed, Nov 16, 2011 at 08:09:11PM -0700, Matthew O''Connor wrote:> Hm, I hadn''t thought of that. > > Do you have a time where one instance of Puppet would manage itself - > versus managing another running copy of Puppet?I do this. A virtual machine template is configured with a puppet.conf that asks the puppetmaster every minute for its configuration. Part of the first puppet run with a newly duped server involves setting the runinterval to a custom value between 3600 and 7200 seconds.> On Wed, Nov 16, 2011 at 3:54 PM, Nigel Kersten <[1]nigel@puppetlabs.com> > wrote: > > On Wed, Nov 16, 2011 at 12:18 PM, Matthew O''Connor > <[2]thegreendragon@gmail.com> wrote: > > That fixed it. > > Oh, I think I see what''s going on: > > When I run `puppet httpd.pp`, it runs `ps` and finds a process with > `httpd` in the name and so concludes the service is running. If I > rename the script to something else then Puppet no longer finds any > process with ''httpd'' in its name. > > Perhaps Puppet should have a check that prevents thinking it is the > satisfying service? > > That seems reasonable, but how would you handle the case where you want > puppet to handle the puppet service? � > > -- > You received this message because you are subscribed to the Google > Groups "Puppet Users" group. > To post to this group, send email to [3]puppet-users@googlegroups.com. > To unsubscribe from this group, send email to > [4]puppet-users+unsubscribe@googlegroups.com. > For more options, visit this group at > [5]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. > > References > > Visible links > 1. mailto:nigel@puppetlabs.com > 2. mailto:thegreendragon@gmail.com > 3. mailto:puppet-users@googlegroups.com > 4. mailto:puppet-users%2Bunsubscribe@googlegroups.com > 5. 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.