I''ve been trying to follow several threads around Google about Puppet and it''s use (or non-use) of chkconfig on RH Linux. What prompted me to do this is I noticed that Puppet is, correctly, repeatedly logging that it is changing a services from ON to OFF. Funny, I thought I had disabled that with: service { "ip6tables": enable => false, ensure => stopped, } Which certainly works, but it doesn''t disable the service (ie: "chkconfig servicename off") -- it seems like there should be a provider that correctly integrates with the system "chkconfig" -- I realize that not all init scripts honor that, and for that folks can do whatever. This is a basic functionality of RH Linux that enables, adds, deletes and otherwise alters the levels of basic services. Seems reasonable that Puppet could properly interact with it? We are up to Puppet 3.4.x now. I''m simply asking here as I didn''t seem to find a definitive answer - a lot of code snippets and suggestions, I just wonder if this is on-tap for improvement or if someone has another, perhaps clever approach to working with this? 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+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.
Try ensure disabled, On Sep 11, 2013 5:24 PM, "Forrie" <forrie@gmail.com> wrote:> I''ve been trying to follow several threads around Google about Puppet and > it''s use (or non-use) of chkconfig on RH Linux. > > What prompted me to do this is I noticed that Puppet is, correctly, > repeatedly logging that it is changing a services from ON to OFF. Funny, I > thought I had disabled that with: > > service { "ip6tables": > enable => false, > ensure => stopped, > } > > Which certainly works, but it doesn''t disable the service (ie: "chkconfig > servicename off") -- it seems like there should be a provider that > correctly integrates with the system "chkconfig" -- I realize that not all > init scripts honor that, and for that folks can do whatever. This is a > basic functionality of RH Linux that enables, adds, deletes and otherwise > alters the levels of basic services. Seems reasonable that Puppet could > properly interact with it? > > We are up to Puppet 3.4.x now. I''m simply asking here as I didn''t seem > to find a definitive answer - a lot of code snippets and suggestions, I > just wonder if this is on-tap for improvement or if someone has another, > perhaps clever approach to working with this? > > > 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+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.
The redhat provider for the service type does indeed use chkconfig to disable the service when enable is false. If that''s not happening for you, there''s something wrong. Some possibilities: * facter is misidentifying the OS, causing puppet to pick a different default provider. Does ''facter osfamily'' return ''RedHat'' or something else? * Someone''s set an explicit default for the service type at top or node scope which is overriding the default use of the redhat provider * chkconfig, for whatever reason, isn''t actually disabling the service when puppet calls it * Something else is re-enabling the service behind puppet''s back -Mike On Wed, Sep 11, 2013 at 3:24 PM, Forrie <forrie@gmail.com> wrote:> I''ve been trying to follow several threads around Google about Puppet and > it''s use (or non-use) of chkconfig on RH Linux. > > What prompted me to do this is I noticed that Puppet is, correctly, > repeatedly logging that it is changing a services from ON to OFF. Funny, I > thought I had disabled that with: > > service { "ip6tables": > enable => false, > ensure => stopped, > } > > Which certainly works, but it doesn''t disable the service (ie: "chkconfig > servicename off") -- it seems like there should be a provider that > correctly integrates with the system "chkconfig" -- I realize that not all > init scripts honor that, and for that folks can do whatever. This is a > basic functionality of RH Linux that enables, adds, deletes and otherwise > alters the levels of basic services. Seems reasonable that Puppet could > properly interact with it? > > We are up to Puppet 3.4.x now. I''m simply asking here as I didn''t seem > to find a definitive answer - a lot of code snippets and suggestions, I > just wonder if this is on-tap for improvement or if someone has another, > perhaps clever approach to working with this? > > > 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+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.
Puppet did not like that: Sep 12 01:08:18 my-server puppet-agent[10063]: Failed to apply catalog: Parameter ensure failed on Service[pcscd]: Invalid value "disabled". Valid values are stopped, running. at /etc/puppet/manifests/classes/disabled-services.pp:10 I changed it back to "ensure => stopped" and it''s happy. On 9/11/13 8:13 PM, Len Rugen wrote:> > Try ensure disabled, > >-- 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.
Hi Forrie, Puppet service resource *enable* property internally executes the chkconfig command for red hat, This property behaves quite differently depending on the platform; wherever possible, it relies on local tools to enable or disable a given service.You can confirm the facter *osfamily *returns *redhat *or not. Use provider => redhat along with enable property. Thanks and Regards, Rahul Khengare, NTT DATA OSS Center, Pune, India. On Thursday, September 12, 2013 3:54:51 AM UTC+5:30, Forrie wrote:> > I''ve been trying to follow several threads around Google about Puppet and > it''s use (or non-use) of chkconfig on RH Linux. > > What prompted me to do this is I noticed that Puppet is, correctly, > repeatedly logging that it is changing a services from ON to OFF. Funny, I > thought I had disabled that with: > > service { "ip6tables": > enable => false, > ensure => stopped, > } > > Which certainly works, but it doesn''t disable the service (ie: "chkconfig > servicename off") -- it seems like there should be a provider that > correctly integrates with the system "chkconfig" -- I realize that not all > init scripts honor that, and for that folks can do whatever. This is a > basic functionality of RH Linux that enables, adds, deletes and otherwise > alters the levels of basic services. Seems reasonable that Puppet could > properly interact with it? > > We are up to Puppet 3.4.x now. I''m simply asking here as I didn''t seem > to find a definitive answer - a lot of code snippets and suggestions, I > just wonder if this is on-tap for improvement or if someone has another, > perhaps clever approach to working with this? > > > 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+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.
On Wednesday, September 11, 2013 5:24:51 PM UTC-5, Forrie wrote:> > I''ve been trying to follow several threads around Google about Puppet and > it''s use (or non-use) of chkconfig on RH Linux. > > What prompted me to do this is I noticed that Puppet is, correctly, > repeatedly logging that it is changing a services from ON to OFF. Funny, I > thought I had disabled that with: > > service { "ip6tables": > enable => false, > ensure => stopped, > } > > Which certainly works, but it doesn''t disable the service (ie: "chkconfig > servicename off") -- it seems like there should be a provider that > correctly integrates with the system "chkconfig" -- I realize that not all > init scripts honor that, and for that folks can do whatever. This is a > basic functionality of RH Linux that enables, adds, deletes and otherwise > alters the levels of basic services. Seems reasonable that Puppet could > properly interact with it? > > We are up to Puppet 3.4.x now. I''m simply asking here as I didn''t seem > to find a definitive answer - a lot of code snippets and suggestions, I > just wonder if this is on-tap for improvement or if someone has another, > perhaps clever approach to working with this? > >The default Service provider for RH-family systems certainly does use ''chkconfig'' to disable services, and has done for as long as I have been involved with Puppet. It is limited in that it will only enable/disable for the current runlevel, but that is not usually a problem in practice. You can check whether Puppet has done this by looking at the output of ''/sbin/chkconfig --list <servicename>''. Note that "disabling" a service does not mean that it cannot run -- neither in Puppet DSL nor in chkconfig -- it merely means that the service will not be automatically started when the system boots. That Puppet repeatedly logs service shutdowns on the same node means one of two things: 1. Something else keeps starting the service back up, or 2. Puppet is being fooled about the service running. Since you say that Puppet is *correctly* logging service shutdowns, I infer that you must be running into (1). 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.