Hi,

This is the sort of thing I would use hiera for. 

It may not match your workflow but I would create a yaml file with details for 
the portals like so:
Portals:
  ID_Centro:
    path: /var/.....
    owner: ...

Then you could use create_resource to apply the resource.

$my_list = hiera('portals')
create_resource(file, $my_list)

See the puppet docs for exact details and syntax.

Den

On 15/03/2012, at 4:06, Antonio Xanxess <[email protected]> 
wrote:

> Hello everyone!
> I have a problem and would like to help me. I have to control the 
> configuration of an application that has special features. The application 
> itself is an educational portal. These sites are hosted on a single machine 
> and serve different schools. The file where you see that schools have a 
> website on the server is located in /etc/application/centros.conf. The 
> content is similar to this:
> ID_CENTRO1
> ID_CENTRO2 
> ....
> The application itself is hosted in /var/www/APP/ and hosts various portals 
> through the directories named ID_CENTRO1, ID_CENTRO2, etc ...
> 
> My goal is to make a single resource file to modify a file in the platform 
> for all schools, for example:
> 
> /var/www/APP/ID_CENTRO[X]/config/config.php
> 
> This was thinking of a facter extract the file contents and pass it through a 
> custom function, but the problem I am not really know how many centers can 
> have the server (there are several such servers and each has a different 
> number of platforms)
> 
> My question is, is there any possibility of a resource file (either within a 
> defined function or your own resource file) using regular expressions?
> For example:
> 
> {file "/var/www/APP/[0-9]?/config/config.php"
> ...
> }
> 
> You have any other ideas how I could do this?
> 
> Thank you very much for everything, a greeting!
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Puppet Users" group.
> To view this discussion on the web visit 
> https://groups.google.com/d/msg/puppet-users/-/3i4sWqirbYQJ.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit this group at 
> http://groups.google.com/group/puppet-users?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to