ignoring changes to a file

279 views
Skip to first unread message

kaustubh chaudhari

unread,
Mar 5, 2014, 9:41:45 AM3/5/14
to puppet...@googlegroups.com
Hi All,

One of my application requires me to copy a config file after installation the application. This needs to be done only once after installation

However this config file is managed by a central server and keeps on getting updated every day, which means puppet will overwrite the updated file every day.
Which is a problem.

How can i configure puppet to ignore changes to this file. Is there a way to do this ?

Any help is appreciated!

-Kaustubh

Alexander Fortin

unread,
Mar 5, 2014, 9:47:58 AM3/5/14
to puppet...@googlegroups.com

"Whether to replace a file or symlink that already exists on the local system but whose content doesn’t match what the source or content attribute specifies. Setting this to false allows file resources to initialize files without overwriting future changes. Note that this only affects content; Puppet will still manage ownership and permissions. Defaults to true.

Valid values are true, false, yes, no"

Thomas Müller

unread,
Mar 5, 2014, 10:02:59 AM3/5/14
to puppet...@googlegroups.com
On Wed, 05 Mar 2014 06:41:45 -0800 wrote kaustubh chaudhari:


> One of my application requires me to copy a config file after
> installation the application. This needs to be done only once after
> installation
>
> However this config file is managed by a central server and keeps on
> getting updated every day, which means puppet will overwrite the updated
> file every day.
> Which is a problem.

if the config file does not exist, you can use the "replace" parameter of
the file type.

http://docs.puppetlabs.com/references/latest/type.html#file-attribute-
replace


- Thomas

kaustubh chaudhari

unread,
Mar 5, 2014, 10:32:59 AM3/5/14
to puppet...@googlegroups.com, tho...@chaschperli.ch
Thanks Alexzender and Thomas for the reply.

This is partially useful.

The requirement is i need to copy it first basically overwrite it once and then ignore all the changes.

Any clue how this can be achieved!

Thomas Müller

unread,
Mar 5, 2014, 10:46:04 AM3/5/14
to puppet...@googlegroups.com
On Wed, 05 Mar 2014 07:32:59 -0800 wrote kaustubh chaudhari:

> Thanks Alexzender and Thomas for the reply.
>
> This is partially useful.
>
> The requirement is i need to copy it first basically overwrite it once
> and then ignore all the changes.
>
> Any clue how this can be achieved!

create the config file before the application installation creates it. if
its an rpm installation, the file will not be overwritten.



kaustubh chaudhari

unread,
Mar 5, 2014, 10:57:18 AM3/5/14
to puppet...@googlegroups.com, tho...@chaschperli.ch
Hey Thomas,


Thats the tricky part! The location where i want to copy this file is created by setup. Its a windows application.

So i will have to copy the file(overwrite) it after the package installation and than ignore any changes to that file.
Thats where i am stuck!

-Kaustubh

Thomas Müller

unread,
Mar 5, 2014, 11:12:59 AM3/5/14
to puppet...@googlegroups.com
On Wed, 05 Mar 2014 07:57:18 -0800 wrote kaustubh chaudhari:

> Hey Thomas,
>
>
> Thats the tricky part! The location where i want to copy this file is
> created by setup. Its a windows application.
>
> So i will have to copy the file(overwrite) it after the package
> installation and than ignore any changes to that file.
> Thats where i am stuck!

ugly workaround:

- copy the config-file with a added ".puppet" suffix.
- create an Exec with "refreshonly => true" which copies this file to the
correct location
- create another empty file which notifies the Exec




- Thomas

Reply all
Reply to author
Forward
0 new messages