File checksum

44 views
Skip to first unread message

Luke Baker

unread,
Mar 6, 2012, 12:17:40 PM3/6/12
to puppet...@googlegroups.com
I want to to ensure a file, and if the content changes a subscribed exec should fire.

    file { "/etc/opt/microsoft/scx/ssl/scx-host-$fqdn.pem":
        checksum => "md5",
    }

    exec { "/etc/init.d/scx-cimd restart":
        subscribe   => File["/etc/opt/microsoft/scx/ssl/scx-host-$fqdn.pem"],
        refreshonly => true
    }

The file is created by a package (scom) and the content isn't managed by puppet. I noticed that the exec never fired - I tried making a change to the file and running puppet, though it doesn't seem like puppet looking at the md5sum of the file at all. 

tl;dr - I want to watch the md5sum of a file and not manage the content, if md5sum changes, fire an exec.

Nan Liu

unread,
Mar 6, 2012, 12:37:42 PM3/6/12
to puppet...@googlegroups.com
On Tue, Mar 6, 2012 at 9:17 AM, Luke Baker <bak...@missouri.edu> wrote:
> I want to to ensure a file, and if the content changes a subscribed exec
> should fire.
>
>     file { "/etc/opt/microsoft/scx/ssl/scx-host-$fqdn.pem":
>         checksum => "md5",
>     }

Try adding audit => checksum to the file. Though I recall some issues
with noop and where it will change the state.yaml file on noop.

Nan

Reply all
Reply to author
Forward
0 new messages