Adam Jacob wrote:

> If what you are trying to do is eval some puppet code, literally, I'm
> totally unclear as to what the purpose of that would be.

Yes, I'm trying to eval puppet code.

In fact this eval function is only part of another function I'm trying
to hack.

The goal is to generate ressources in Puppet from a REST webservice
returning CSV data.

For example, imagine you have a webservice like that listing all your users:

uid;gecos;password
francois;Francois Deppierraz;1234
john;John Doe;5678

Based on that, I want to generate the following ressource *dynamically*.

user {"francois":
  ensure   => present,
  gecos    => "Francois Deppierraz",
  password => "1234",
}

user {"john":
  ensure   => present,
  gecos    => "John Doe",
  password => "5678",
}

The current usage of this function is:

class blah {
  csv_template "http://mydb/users"; "my-user-template.erb"
}

>From there, a ressource is created for each line (except the header)
using the ERB template.

The only piece I'm missing is how to feed those ressources back into
Puppet. I hope this makes my use case a bit clearer.

François

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" 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-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to