I'm not familiar with the format of this file, so I'm not sure why
custom provider is preferable over a native file type in puppet or
concat file using templates.
self.exists? is correct. In this case you are just checking if the
file exists to determine whether to invoke create/destroy method. If
you ensure=>present and the file does not exist it will invoke create,
and if you ensure=>absent, and the file exist it will invoke destroy.
The reason the content of the file is not managed is because dbnames
is a parameter and not a property. If you want to manage the content
of the file you need specify dbnames as a property and implement def
dbnames in the provider to retrieve the file content for comparison
and def dbnames=(value) to update the content of the file if it no
longer matches your desired content value.
See Brice blog for more in depth explanation:
http://www.masterzen.fr/2011/11/02/puppet-extension-point-part-2/
Thanks,
Nan