Re: [Puppet Users] Can I create virtual resources with create_resources function

418 views
Skip to first unread message

Nan Liu

unread,
Nov 15, 2012, 5:53:34 PM11/15/12
to puppet...@googlegroups.com
On Thu, Nov 15, 2012 at 2:04 PM, Rajul Vora <raju...@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?



Nan 

Jakov Sosic

unread,
Nov 21, 2012, 8:24:15 AM11/21/12
to puppet...@googlegroups.com
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 :)

Till then I'm manually patching create_resources.rb :-/

Jeff McCune

unread,
Nov 26, 2012, 8:37:41 PM11/26/12
to Puppet User Discussion
On Wed, Nov 21, 2012 at 5:24 AM, Jakov Sosic <jso...@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
Reply all
Reply to author
Forward
0 new messages