Can I override files specified in a module on a per-client basis? Suppose I have a module that is to be installed on a large number of clients, and one of the files it provides is /x/y/z. One a very small number of clients, that file needs to be slightly modified. What I want to do in the module, ideally, is something like: file { "/x/y/z": if (file puppet:///mymodule/$fqdn/z exists: source => puppet:///mymodule/$fqdn/z else: source => puppet:///mymodule/z Is there a way to achieve that? Thanks, Keith --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
Peter Meier
2009-Feb-05 12:40 UTC
[Puppet Users] Re: Overriding files specified in modules
Hi> Can I override files specified in a module on a per-client basis? > > Suppose I have a module that is to be installed on a large number of > clients, and one of the files it provides is /x/y/z. One a very small > number of clients, that file needs to be slightly modified. What I want to > do in the module, ideally, is something like: > > file { "/x/y/z": > if (file puppet:///mymodule/$fqdn/z exists: > source => puppet:///mymodule/$fqdn/z > else: > source => puppet:///mymodule/z > > Is there a way to achieve that?from: http://reductivelabs.com/trac/puppet/wiki/TypeReference#file under source: "If you specify multiple file sources for a file, then the first source that exists will be used. This allows you to specify what amount to search paths for files:" file { "/path/to/my/file": source => [ "/nfs/files/file.$host", "/nfs/files/file.$operatingsystem", "/nfs/files/file" ] } this seems to be your solution. cheets pete ps: I couldn''t live without that nice feature! --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
Nicolas Szalay
2009-Feb-06 09:49 UTC
[Puppet Users] Re: Overriding files specified in modules
Le jeudi 05 février 2009 à 13:40 +0100, Peter Meier a écrit :> from: http://reductivelabs.com/trac/puppet/wiki/TypeReference#file > under source: > > "If you specify multiple file sources for a file, then the first > source that exists will be used. This allows you to specify what > amount to search paths for files:" > > file { "/path/to/my/file": > source => [ > "/nfs/files/file.$host", > "/nfs/files/file.$operatingsystem", > "/nfs/files/file" > ] > } > > > this seems to be your solution. > > cheets pete > > ps: I couldn''t live without that nice feature!YEAH ! This is the post of the week ! I was turning my head up & down to find a way to put user & host specific authorized keys. -- Nicolas Szalay Administrateur systèmes & réseaux -- _ ASCII ribbon campaign ( ) - against HTML email X & vCards / \