Larry Ludwig
2008-Apr-25 14:39 UTC
[Puppet Users] selecting multiple files with File Type and a feature request
Is there a way to have the File Type select multiple files? In this
case I''m using it to ensure these files are not there.
ie.
file { "/var/www/html/phpMyAdmin/Documentation.*":
recurse => true,
ensure => absent,
force => true,
}
This doesn''t seem to work.
Feature request:
I thought feature that would be nice with the File type.
There are some situations where either custom content per server needs
to be inserted into a config file.
How about this functionality?
source => [
"/etc/httpd/conf/header-httpd.conf",
"/etc/httpd/conf/${fqdn}-httpd.conf,
"/etc/httpd/conf/footer-httpd.conf"
]
Where instead of picking the first option only, it takes all of the
files and then joins of the content (going in array order) and insert
into the config file you are wanting to replace?
That way you can have a standard header/footer and custom options (in
this case) per server. I know you can do this with erb template
files, but this could useful where erb is overkill.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---
Larry Ludwig
2008-Apr-25 14:41 UTC
[Puppet Users] Re: selecting multiple files with File Type and a feature request
I also tried:
file { "/var/www/html/phpMyAdmin/Documentation*":
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---
James Turnbull
2008-Apr-25 15:06 UTC
[Puppet Users] Re: selecting multiple files with File Type and a feature request
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Larry Ludwig wrote:> Is there a way to have the File Type select multiple files? In this > case I''m using it to ensure these files are not there.You can use an array or manage a whole directory (there is an entry in the FAQ about this from memory). Regards James Turnbull - -- James Turnbull (james@lovedthanlost.net) - -- Author of: - - Pulling Strings with Puppet (http://www.amazon.com/gp/product/1590599780/) - - Pro Nagios 2.0 (http://www.amazon.com/gp/product/1590596099/) - - Hardening Linux (http://www.amazon.com/gp/product/1590594444/) -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFIEfNg9hTGvAxC30ARAnh5AKCPpAjia62N81xNrS9cQj1XQnrIEgCfTzDc vCWg0l9EB9R+DW6yMb/sWkA=YyIP -----END PGP SIGNATURE----- --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Evan Hisey
2008-Apr-25 19:53 UTC
[Puppet Users] Re: selecting multiple files with File Type and a feature request
> I thought feature that would be nice with the File type. > > There are some situations where either custom content per server needs > to be inserted into a config file. > > How about this functionality? > > source => [ > "/etc/httpd/conf/header-httpd.conf", > "/etc/httpd/conf/${fqdn}-httpd.conf, > "/etc/httpd/conf/footer-httpd.conf" > ] > > Where instead of picking the first option only, it takes all of the > files and then joins of the content (going in array order) and insert > into the config file you are wanting to replace? > > That way you can have a standard header/footer and custom options (in > this case) per server. I know you can do this with erb template > files, but this could useful where erb is overkill.I use templates to handle this for several of my config files. The Template documentation is confusing for getting started. I really have no idea how to make it better. I use templates for almost all my text config files now. The docs make it look over kill fo rthis but it is really not. The basic file structure would like this: file { foo: content => template (foo.erb), } in the template: # created by Puppet ----- header-httpd.conf stuff----- <% case fqdn when host1 -%> ---host1 -stuff--- <% when host2 -%> ----host2 stuff-- <% end -%> ----footer stuff------ And when there is not match you just get the header and the footer. You still have the same number ( sometimes less) of files to handle and I found it makes backupsand moving a lot quicker you only have to move the one dir to a new server or location and everything is moved. If it is so much data to stick in a variable or directly in to the content attribute, then an erb is not going to be overkill. Evan --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
José González Gómez
2008-May-08 19:08 UTC
[Puppet Users] Re: selecting multiple files with File Type and a feature request
On 25 abr, 16:41, Larry Ludwig <larry...@gmail.com> wrote:> I also tried: > > file { "/var/www/html/phpMyAdmin/Documentation*":Sorry for the late reply, but I think such a feature would be handy for example to manage common configuration among users with home directories located in the same server... I''m thinking about something kind of globbing, so you could write something like this: file { "/home/*/.someapp/someconfig.cfg" : whatever... } I guess this would be tricky to implement so you don''t get the same file managed by a construct like this and explicitly with the whole path Best regards Jose --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Luke Kanies
2008-May-09 21:30 UTC
[Puppet Users] Re: selecting multiple files with File Type and a feature request
On May 8, 2008, at 2:08 PM, José González Gómez wrote:> > On 25 abr, 16:41, Larry Ludwig <larry...@gmail.com> wrote: >> I also tried: >> >> file { "/var/www/html/phpMyAdmin/Documentation*": > > Sorry for the late reply, but I think such a feature would be handy > for example to manage common configuration among users with home > directories located in the same server... I''m thinking about something > kind of globbing, so you could write something like this: > > file { "/home/*/.someapp/someconfig.cfg" : whatever... } > > I guess this would be tricky to implement so you don''t get the same > file managed by a construct like this and explicitly with the whole > pathThis feature request was filed, um, years ago. Within the last 8-12 months, it''s become relatively straightfoward to implement (using the ''generate'' hook), but I haven''t had time or motivation to do so. Andrew is looking at refactoring the file type to support the REST file serving, and he may tackle this at the same time, but if anyone wants to take a crack first, it might help. Conflicts are relatively easy, in that you''ll just get an exception if you have conflicts. -- I conclude that there are two ways of constructing a software design: One way is to make it so simple that there are ''obviously'' no deficiencies and the other way is to make it so complicated that there are no ''obvious'' deficiencies. -- C.A.R. Hoare, Turing Lecture "The Emperor''s Old Clothes" CACM February 1981, pp. 75-83. --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---