Héctor Rivas Gándara
2010-Dec-02 18:31 UTC
[Puppet Users] Access to resource attributes (or parameters) and complex queries in collections
Hello, I have been searching in the puppet documentation for the these functionalities (see below for examples): - Access to resource attributes or parameters to use in the recipes. I say attributtes because may the types and providers can be extended to get read-only resource attributes that can not be configured. - Generate collections based on complex queries, using regular expresions, boolean operations, set operations (include, excludes...), etc... I am not sure if they are implemented or if they are difficult to implement. Do you think that it worth it? Could you give me a clue to investigate further? To explain me better, I will explain some examples. Note that are just stupid examples to explain, I do not really want to do this and syntax is incorrect. 1. You want to reset the password of all users in group ''wheel'' that are blocked: Users < groups.include? ''wheel'' && blocked == true > { password = ''xx'' } 2. You want to set the selection to ''hold'' for all debian packages wich name start with ''krb5%'' define set_hold() { exec {... : cmd => "echo hold | dpkg --set-selections $name" } } set_hold(Package < name =~ /krb5.*/ >) 3. You need to use an resource attribute for something. $last_login = User["jhon"].last_login debug("Jhon visited us on $last_login" Actually, I was thinking in this functionality to use it with a "device" provider for AIX. AIX devices have a secuencial name like hdisk0, hdisk1, en1, en2... The number can change between hosts, or even in the same host due several reasons. So you can not known the device name in advance. Consenquenly, I think that these functionalities will be very useful in this case, for instance: 1. Create a "alias" device for a disk based on its unique_id: data_dist = AixDiskDevice< unique_id == 1234 > MkNod("/dev/data_disk", charather, data_disk.mayor, data_disk.minor). 2. Configure a network based on its VLAN id: AixNetDevice < vlan_id == 10 > { ip_addr = 192.168.1.1 } -- Atentamente Héctor Rivas -- 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.
Daniel Pittman
2010-Dec-03 02:55 UTC
Re: [Puppet Users] Access to resource attributes (or parameters) and complex queries in collections
Héctor Rivas Gándara <keymon@gmail.com> writes:> I have been searching in the puppet documentation for the these > functionalities (see below for examples): > > - Access to resource attributes or parameters to use in the recipes. > I say attributtes because may the types and providers can be extended > to get read-only resource attributes that can not be configured. > > - Generate collections based on complex queries, using regular > expresions, boolean operations, set operations (include, excludes...), > etc... > > I am not sure if they are implemented or if they are difficult to > implement. Do you think that it worth it? Could you give me a clue to > investigate further?They are not implemented, and while they are potentially interesting I don''t know how smoothly they fit with the concepts of puppet. (That said, I would like to see similar sorts of operations possible in future myself. :) Regards, Daniel -- ✣ Daniel Pittman ✉ daniel@rimspace.net ☎ +61 401 155 707 ♽ made with 100 percent post-consumer electrons -- 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.
Héctor Rivas Gándara
2010-Dec-03 12:23 UTC
Re: [Puppet Users] Access to resource attributes (or parameters) and complex queries in collections
On Fri, Dec 3, 2010 at 3:55 AM, Daniel Pittman <daniel@rimspace.net> wrote:> Héctor Rivas Gándara <keymon@gmail.com> writes: > >> I have been searching in the puppet documentation for the these >> functionalities (see below for examples): >> >> - Access to resource attributes or parameters to use in the recipes. >> I say attributtes because may the types and providers can be extended >> to get read-only resource attributes that can not be configured. >> >> - Generate collections based on complex queries, using regular >> expresions, boolean operations, set operations (include, excludes...), >> etc... >> >> I am not sure if they are implemented or if they are difficult to >> implement. Do you think that it worth it? Could you give me a clue to >> investigate further? > > They are not implemented, and while they are potentially interesting I don''t > know how smoothly they fit with the concepts of puppet. (That said, I would > like to see similar sorts of operations possible in future myself. :)Actually I also opened this thread to comment how such functionality can be requested as a feature. -- Atentamente Héctor Rivas -- 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.