Rajul Vora
2012-Nov-15 22:04 UTC
[Puppet Users] Can I create virtual resources with create_resources function
I am trying to add ability to add virtual users to the git://github.com/erwbgy/puppet-system.git module as I really want the ability to use virtual users and then combine that with "User <| group == ''x'' and group == ''y'' |>" way of realizing the users. This is much more flexible than what I can do with this module out of the box. Using the pattern in that module, I tried to do this: class system::virt_users ( $config = undef ) { if $config { $defaults = { ensure => ''present'', managehome => true, shell => ''/bin/bash'' } create_resources(@user, $config, $defaults) } } But that gives me syntax error: Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Syntax error at ''@''; expected '')'' at /etc/puppet/modules/system/manifests/virt_users.pp:10 on node ...... So I tried putting @user in quotes but that also generated syntax error (could not create resource of unknown type @user). So is there a create_virtual_resource function or some other trick to do this? Thanks, Rajul -- 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/-/-ILmxaJxEBcJ. 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.
Nan Liu
2012-Nov-15 22:53 UTC
Re: [Puppet Users] Can I create virtual resources with create_resources function
On Thu, Nov 15, 2012 at 2:04 PM, Rajul Vora <rajulvora@gmail.com> wrote:> > I am trying to add ability to add virtual users to the git:// > github.com/erwbgy/puppet-system.git module as I really want the ability > to use virtual users and then combine that with "User <| group == ''x'' and > group == ''y'' |>" way of realizing the users. This is much more flexible > than what I can do with this module out of the box. > > Using the pattern in that module, I tried to do this: > > class system::virt_users ( > $config = undef > ) { > if $config { > $defaults = { > ensure => ''present'', > managehome => true, > shell => ''/bin/bash'' > } > create_resources(@user, $config, $defaults) > } > } > > > But that gives me syntax error: > Error: Could not retrieve catalog from remote server: Error 400 on SERVER: > Syntax error at ''@''; expected '')'' at > /etc/puppet/modules/system/manifests/virt_users.pp:10 on node ...... > > So I tried putting @user in quotes but that also generated syntax error > (could not create resource of unknown type @user). > > So is there a create_virtual_resource function or some other trick to do > this? > >See: http://projects.puppetlabs.com/issues/15081 Nan -- 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.
Rajul Vora
2012-Nov-15 23:20 UTC
Re: [Puppet Users] Can I create virtual resources with create_resources function
Excellent, thanks. Rajul On Thursday, November 15, 2012 2:54:08 PM UTC-8, Nan Liu wrote:> > On Thu, Nov 15, 2012 at 2:04 PM, Rajul Vora <raju...@gmail.com<javascript:> > > wrote: > >> >> I am trying to add ability to add virtual users to the git:// >> github.com/erwbgy/puppet-system.git module as I really want the ability >> to use virtual users and then combine that with "User <| group == ''x'' and >> group == ''y'' |>" way of realizing the users. This is much more flexible >> than what I can do with this module out of the box. >> >> Using the pattern in that module, I tried to do this: >> >> class system::virt_users ( >> $config = undef >> ) { >> if $config { >> $defaults = { >> ensure => ''present'', >> managehome => true, >> shell => ''/bin/bash'' >> } >> create_resources(@user, $config, $defaults) >> } >> } >> >> >> But that gives me syntax error: >> Error: Could not retrieve catalog from remote server: Error 400 on >> SERVER: Syntax error at ''@''; expected '')'' at >> /etc/puppet/modules/system/manifests/virt_users.pp:10 on node ...... >> >> So I tried putting @user in quotes but that also generated syntax error >> (could not create resource of unknown type @user). >> >> So is there a create_virtual_resource function or some other trick to do >> this? >> >> > See: http://projects.puppetlabs.com/issues/15081 > > Nan >-- 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/-/JGnnLE_AZfgJ. 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.
Jakov Sosic
2012-Nov-21 13:24 UTC
Re: [Puppet Users] Can I create virtual resources with create_resources function
On 11/15/2012 11:04 PM, Rajul Vora wrote:> > I am trying to add ability to add virtual users to > the git://github.com/erwbgy/puppet-system.git module as I really wantI''ve run into same exact problem yesterday, and found patch that Nan Liu mentions.. What I am interested in is when can we expect Puppet 3.1.0? If someone can answer me :) Till then I''m manually patching create_resources.rb :-/ -- 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.
Jeff McCune
2012-Nov-27 01:37 UTC
Re: [Puppet Users] Can I create virtual resources with create_resources function
On Wed, Nov 21, 2012 at 5:24 AM, Jakov Sosic <jsosic@srce.hr> wrote:> On 11/15/2012 11:04 PM, Rajul Vora wrote: >> >> I am trying to add ability to add virtual users to >> the git://github.com/erwbgy/puppet-system.git module as I really want > > I''ve run into same exact problem yesterday, and found patch that Nan Liu > mentions.. > > > What I am interested in is when can we expect Puppet 3.1.0? If someone > can answer me :)I don''t have an exact date, but before the end of 2012 in all likelyhood. -Jeff -- 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.
Possibly Parallel Threads
- Does create_resources support virtual resources?
- How to remove a node from Puppet CA, Puppet DB from a remote host
- How to pass puppet/hiera veriable to external script ? Do I need to ?
- Using single hiera hash for two create_resources, and mounting filesystems
- Failed to parse template, wrong number of arguments (create_resources)