puppet service not stopping service
        Posted  
        
            by 
                Gregg Leventhal
            
        on Server Fault
        
        See other posts from Server Fault
        
            or by Gregg Leventhal
        
        
        
        Published on 2013-11-11T21:42:20Z
        Indexed on 
            2013/11/12
            15:54 UTC
        
        
        Read the original article
        Hit count: 389
        
notice ("This should be echoed")
service { "iptables":
    ensure => "stopped",
}
This does not stop iptables, I am not sure why.  service iptables stop works fine.  Puppet 2.6.17 on CentOS 6.3.
UPDATE:
/etc/puppet/manifests/nodes.pp
 node 'linux-dev' {
    include mycompany::install::apache::init
    include mycompany::config::services::init
}
/etc/puppet/modules/mycompany/manifests/config/services/init.pp
class mycompany::config::services::init {
    if ($::id == "root") {
        service { 'iptables':
        #name => '/sbin/iptables',
        #enable => false,
        #hasstatus => true,
        ensure => stopped
    } 
    notice ("IPTABLES is now being stopped...")
    file { '/tmp/puppet_still_works':
        ensure => 'present',
        owner => root
    } else {
    err("Error: this manifest must be run as the root user!")
    }
}
© Server Fault or respective owner