Closed jlambert121 closed 8 years ago
I understand this part is not very well documented. However, you should be able to specify additional scripts via
duplicity::profile_exec_before { "system/script1":
profile => 'system',
content => template('path/to/my/script/snippet'),
}
in your manifest. The profile_exec_before
resources relies on concat to form an extension point.
Would that work for you? Or otherwise could you please add a bit more context about this change. Thanks.
I saw I could import content directly as the define to make that work, but that separates the profile that uses it from some of the information used by it. Because of the way profile is written as well #!/bin/bash
will always be prepended before the pre script, even if it's perl or ruby. This allows the script used by the profile to be easily contained by the profile.
Right. If you want to replace the whole pre
script then you're right. And of course the shebang get's into your way.
The way I'm using it right now is by
/usr/local/bin
andduplicity::profile_exec_before
to invoke the script but don't replace the whole scriptThis allows my to add multiple scripts from various locations without having the merge them in a central place. And all of them get called before the duplicity backup.
Eg. this puppet manifest defines a resource to manage database backups. You pass it a database name and it includes it in the duplicity backup. Under the hood it just adds a call to the 'create-mysql-database-backup.sh' script to the pre
script for every database I manage with the resource.
Either way - I'm happy to add this bit of flexibility to the module given it doesn't break compatibility. Can you please update the documentation about the parameters in the profile.pp
file and for bonus points add a use case to the README file? Thanks heaps.
Thanks! Added some documentation.
I've released version 3.6.0 to the forge. Thanks for the contribution.
…ofile