Issue #7295 has been updated by Nigel Kersten.

ok, let me step through the process from a clean slate with this manifest:

<pre>
file { "/tmp/test":
    content  => "static content",
    audit    => content,
    checksum => md5,
}
</pre>

First run lays down the file:

<pre>
$ puppet apply /tmp/test.pp 
notice: /Stage[main]//File[/tmp/test]/ensure: defined content as 
'{md5}bda5c6a08aabcb2482de83f086ec5e57'
notice: /Stage[main]//File[/tmp/test]/content: audit change: newly-recorded 
value absent
</pre>

and records this value:
<pre>
puppet nbk (master)$ grep content ~/.puppet/var/state/state.yaml 
    !ruby/sym content: !ruby/sym absent
</pre>

This is because we audit before we apply. We are looking in the next major 
version of providing more of a three-way merge between:

  * existing state
  * previously defined Puppet state
  * current defined Puppet state

but this is how audit works in the current implementation.

I then modify the manifest so the content is different and re-apply it.
<pre>
$ puppet apply /tmp/test.pp 
notice: /Stage[main]//File[/tmp/test]/content: content changed 
'{md5}bda5c6a08aabcb2482de83f086ec5e57' to 
'{md5}ba717ae509fef09e4250dbcbec317b80' (previously recorded value was absent)
notice: Finished catalog run in 0.03 seconds
</pre>

and check the new checksum:

<pre>
    !ruby/sym content: "{md5}bda5c6a08aabcb2482de83f086ec5e57"
</pre>

and it contains the audited value, before changes are applied.
----------------------------------------
Bug #7295: File chsecksum is not being written to state.yaml
https://projects.puppetlabs.com/issues/7295

Author: Zach Leslie
Status: Accepted
Priority: High
Assignee: 
Category: 
Target version: 2.6.x
Affected Puppet version: 2.6.4
Keywords: 
Branch: 


When the following manifest is run, I expect that the md5sum gets written to 
state.yaml. 

<pre>
file {
  "/tmp/test":
    content => "bla",
    audit   => all,
    checksum => md5,
}
</pre>

But no such content is written to state.yaml. 

<pre>
$ sudo puppet -v /tmp/test.pp; sudo grep -A11 "/tmp/test" 
/var/lib/puppet/state/state.yaml

notice: /Stage[main]//File[/tmp/test]/content: content changed 
'{md5}128ecf542a35ac5270a87dc740918404' to 
'{md5}bc164a80b614c873a25ea8ea38471ced'

  "File[/tmp/test]": 
    !ruby/sym owner: 0
    !ruby/sym mode: 420
    !ruby/sym seluser: 
    !ruby/sym group: 0
    !ruby/sym selrole: 
    !ruby/sym target: !ruby/sym notlink
    !ruby/sym seltype: 
    !ruby/sym selrange: 
    !ruby/sym checked: 2011-04-29 18:11:26.128960 -07:00
    !ruby/sym synced: 2011-04-29 17:29:56.315849 -07:00
</pre>

The only thing missing from what I can tell is the md5sum.

Also, the mode here is 420, which looking at the file, is incorrect:

<pre>
$ ls -ld /tmp/test
-rw-r--r--  1 root  wheel  4 Apr 29 18:14 /tmp/test
</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