Issue #4111 has been updated by Stefan Schulte.

The reason is that we treat the ensure property very special: We always sync 
ensure first and if ensure is outofsync, we'll only sync ensure and expect that 
everything is ok afterwards. This is wrong for every type with properties that 
do not depend on the ensure property. Another example is the mounttype. If we 
change ensure from `unmounted` to `mounted` we wont report any other change 
(added #5991 as duplicate).

Currently the only reason why `enable` is synced at all in the above example is 
that within the ensure block of the service type puppet tests if the `enable` 
property is out of sync.

Possible solution:

* keep the current "hack" (sync enable within ensure) but add reporting 
functionality
* treat ensure as any other property. This will definitly break most of the 
current types (user, group, host, etc.). We can fix these again if we introduce 
a new method/flag for properties that says "if you sync me, other properties 
are automatically in sync"
* treat ensure special but only stop syncing other properties if `ensure` was 
changed to `:absent` OR ensure was `:absent` before the change. (This may also 
break current types like `file` when ensure changes from `file` to `link` but 
I'm not entirely sure)

Personally, I believe that 2 is the cleanest solution, but I bet there are 
custom types out there that depend on the current behaviour.
----------------------------------------
Bug #4111: If "ensure" changes, then no other changes are reported for that 
resource.
https://projects.puppetlabs.com/issues/4111

Author: Dan Bode
Status: Accepted
Priority: High
Assignee: 
Category: service
Target version: Statler
Affected Puppet version: 
Keywords: 
Branch: 


code:
<pre>
service { 'httpd':
  ensure => running,
  enable => true,
}
</pre>

even though chkconfig is set to off in both cases, its only logged when the 
process isn't started.

<pre>
# /sbin/service httpd stop
Stopping httpd:                                            [  OK  ]
[root@dannyboy manifests]# chkconfig httpd off
[root@dannyboy manifests]# puppet myservice.pp 
notice: //Service[httpd]/ensure: ensure changed 'stopped' to 'running'
[root@dannyboy manifests]# chkconfig httpd off
[root@dannyboy manifests]# puppet myservice.pp 
notice: //Service[httpd]/enable: enable changed 'false' to 'true'
[root@dannyboy manifests]# 
</pre>


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en.

Reply via email to