Re: [Puppet Users] Virtual resources ?

2016-03-31 Thread Jakov Sosic
On 03/31/2016 05:40 PM, Martin Alfke wrote: Generally it works: https://github.com/puppetlabs/puppet/blob/master/lib/puppet/parser/functions/create_resources.rb But no longer required since Puppet 4: https://docs.puppetlabs.com/puppet/latest/reference/lang_resources_advanced.html#implementing-th

Re: [Puppet Users] Virtual resources ?

2016-03-31 Thread Martin Alfke
On 31 Mar 2016, at 17:28, Jakov Sosic wrote: > On 03/31/2016 05:10 PM, Martin Alfke wrote: > >> You are passing a Hash as an parameter to a define. >> Inside the define you expect the parameter to be of type String - according >> to what you do in the define. >> >> You need to take care of sp

Re: [Puppet Users] Virtual resources ?

2016-03-31 Thread Jakov Sosic
On 03/31/2016 05:10 PM, Martin Alfke wrote: You are passing a Hash as an parameter to a define. Inside the define you expect the parameter to be of type String - according to what you do in the define. You need to take care of splitting data accordingly in your define: With Puppet 4 this is ve

Re: [Puppet Users] Virtual resources ?

2016-03-31 Thread Martin Alfke
Hi, On 31 Mar 2016, at 16:38, Jakov Sosic wrote: > Hi guys, > > I have a `test.pp` manifest that looks like: > > > ``` > define basket($arg) { > file { "/tmp/$name": >ensure => present, >content => $arg, > } > } > > foobar = { > 'fruit' => { arg => 'apple' }, > 'berry' => { arg

[Puppet Users] Virtual resources ?

2016-03-31 Thread Jakov Sosic
Hi guys, I have a `test.pp` manifest that looks like: ``` define basket($arg) { file { "/tmp/$name": ensure => present, content => $arg, } } foobar = { 'fruit' => { arg => 'apple' }, 'berry' => { arg => 'watermelon' } } @basket[$foobar] realize( Basket[fruit] ) realize( Bask

Re: [Puppet Users] Virtual resources not refreshing, how to clean out and re-do?

2015-08-06 Thread jcbollinger
On Wednesday, August 5, 2015 at 3:24:33 PM UTC-5, Steve Wray wrote: > > Oh thanks, that worked. > > I guess I was confused with the semantics of 'clean' and 'deactivate' and > thought 'deactivate' would... deactivate the node not just 'clean' out its > virtual resources :) > > It would be nice

Re: [Puppet Users] Virtual resources not refreshing, how to clean out and re-do?

2015-08-05 Thread Steve Wray
Oh thanks, that worked. I guess I was confused with the semantics of 'clean' and 'deactivate' and thought 'deactivate' would... deactivate the node not just 'clean' out its virtual resources :) It would be nice if there was a curl interface for puppetdb to delete specific virtual resources! S

Re: [Puppet Users] Virtual resources not refreshing, how to clean out and re-do?

2015-08-05 Thread Matthew Burgess
On 5 Aug 2015 19:10, "Steve Wray" wrote: > > I have a problem where a virtual resource has, in an early run, got the wrong value. I've fixed the manifest so that the virtual resource gets the correct values and I've rerun Puppet on the node that populates the virtual resource. However when it is i

[Puppet Users] Virtual resources not refreshing, how to clean out and re-do?

2015-08-05 Thread Steve Wray
I have a problem where a virtual resource has, in an early run, got the wrong value. I've fixed the manifest so that the virtual resource gets the correct values and I've rerun Puppet on the node that populates the virtual resource. However when it is instantiated it still gets the old value. I

Re: [Puppet Users] Virtual resources, collectors, and overrides.

2015-07-17 Thread Hunter Haugen
Both of these methods seems to work on puppet 4, and you could try on puppet 3: @notify { 'one': before => Notify['two'], } @notify { 'two': } Notify <| title == 'one' |> { before => undef, } OR @notify { 'one': before => Notify['two'], } @notify { 'two': } Notify <| title == 'one' |> { befo

[Puppet Users] Virtual resources, collectors, and overrides.

2015-07-17 Thread Robert Davidson
When collecting virtual resources, is there a way to override them to *remove* specific attributes? For example, I have a set of service definitions with requires, and I want to collect them without those. (It's rather more complicated than that, but illustrates what I want to do.) Is this even

Re: [Puppet Users] Virtual Resources in PE3.7.0

2014-12-22 Thread Felix Frank
On 12/20/2014 05:35 AM, Varun Utagikar wrote: > Am sorry for the goof up Never mind. Please, as originally requested, add notice() calls and notify resources to *all* pertinent code paths, especially the body of define users::virtual. -- You received this message because you are subscribed to t

Re: [Puppet Users] Virtual Resources in PE3.7.0

2014-12-19 Thread Varun Utagikar
I am so sorry Felix I was experimenting with different methods My manifest is as below (ignore ::localuser) /etc/puppetlabs/puppet/modules/users/manifests/init.pp class users { notify { 'Adding User varun' : } @users::virtual { 'varun': uid => 1002,

Re: [Puppet Users] Virtual Resources in PE3.7.0

2014-12-19 Thread Felix Frank
On 12/19/2014 05:08 AM, Varun Utagikar wrote: > > Any idea to what mistake am I doing ? Well, kind of. The code you posted originally was not accurate, apparently, for you are actually declaring a virtual resource of type users::virtual::localuser - this cannot ever be realized by a users::virtu

Re: [Puppet Users] Virtual Resources in PE3.7.0

2014-12-18 Thread Varun Utagikar
Hey Felix I tried realizing the user via : Users::Virtual<| title == 'varun' |> and also with realize Users::Virtual['varun'] but to no avail. I put a notify in my manifest but it gives no significant o/p help just : /etc/puppetlabs/puppet/modules/users/manifests/init.pp class users {

Re: [Puppet Users] Virtual Resources in PE3.7.0

2014-12-18 Thread Felix Frank
On 12/18/2014 10:18 AM, Felix Frank wrote: >> realize (Users::Virtual ['varun']) Oh I just noticed - are you using parser=future now? I seem to recall a comment from Erik that the space in the resource reference is a problem now, i.e. Users::Virtual ['varun'] # wrong vs Users::Virtual[

Re: [Puppet Users] Virtual Resources in PE3.7.0

2014-12-18 Thread Felix Frank
On 12/18/2014 08:46 AM, Varun Utagikar wrote: > nodedefault { > } > ### > node'hdpnamenode1.xor.in' { > include users > realize (Users::Virtual ['varun']) > } Weird. Please sprinkle all the code that you pasted with notify resources

[Puppet Users] Virtual Resources in PE3.7.0

2014-12-17 Thread Varun Utagikar
Hello All I could successfully declare and realize virtual users in PE 3.2.3. I am now testing the same with PE 3.7.0. Unfortunately the user is not being realized and I am getting no warnings/errors. I am pasting a snippet of my module manifests : /etc/puppetlabs/puppet/modules/users/manifest

[Puppet Users] virtual resources: cannot change gid before delete group

2013-02-14 Thread Vlados Vlados
Please help. I using virtual resource @user and @group. If i using next construction i get error with cycles class users { Group <| ENABLED_GROUPS |> ->User <| ENABLED_USERS' |> -> User <| DISABLED_USERS' |> ->Group <| DISABLED_GROUPS |> } This construction good, but puppet d

Re: [Puppet Users] Virtual Resources and create_resources

2012-09-11 Thread Jeff McCune
On Tuesday, September 11, 2012, Douglas Garstang wrote: > So, it seems that create_resources doesn't support virtual resources. > What problem are you trying to solve? -Jeff -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this grou

[Puppet Users] Virtual Resources and create_resources

2012-09-11 Thread Douglas Garstang
So, it seems that create_resources doesn't support virtual resources. Suggestions? Workarounds? Doug. -- 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

Re: [Puppet Users] Virtual Resources with variables

2012-08-21 Thread Douglas Brancaglion
Tks! Work fine now. Hugs, 2012/8/21 Walter Heck > Realize add_user instead of user.. > > Sent from my galaxy tab > On Aug 22, 2012 3:01 AM, "Douglas Brancaglion" > wrote: > > > realize > } > On Aug 22, 2012 3:01 AM, "Douglas Brancaglion" > wrote: > >> Hi! >> >> I am facing difficulties in u

Re: [Puppet Users] Virtual Resources with variables

2012-08-21 Thread Walter Heck
Realize add_user instead of user.. Sent from my galaxy tab On Aug 22, 2012 3:01 AM, "Douglas Brancaglion" wrote: > realize > } On Aug 22, 2012 3:01 AM, "Douglas Brancaglion" wrote: > Hi! > > I am facing difficulties in using the virtual resource types in resorce > custom, I have a definition

[Puppet Users] Virtual Resources with variables

2012-08-21 Thread Douglas Brancaglion
Hi! I am facing difficulties in using the virtual resource types in resorce custom, I have a definition of user creation as shown below: define add_user ( $email, $uid, $key, $groups ) { $username = $title user { $username: comment=> "$email",

Re: [Puppet Users] virtual resources & spaceship syntax

2012-06-29 Thread Brett Maton
:D I knew it would be something simple, thanks Kristof that's working now. Brett On 29 Jun 2012, at 16:54, Kristof Willaert wrote: > Hi, > > [snip] > > > node 'puppet-slave.test.net' { > > include users::accounts > > User <| title="account" |> > > } > > Your virtual resource is not

Re: [Puppet Users] virtual resources & spaceship syntax

2012-06-29 Thread Kristof Willaert
Hi, [snip] > node 'puppet-slave.test.net' { >> > include users::accounts >> > User <| title="account" |> >> > } > > Your virtual resource is not a "user", but a define called "users::virtual::account". So you need to realize it using: Users::Virtual::Account <| title == "account" |> Kind re

Re: [Puppet Users] virtual resources & spaceship syntax

2012-06-29 Thread matonb
Thanks for looking Henk, I think my email client replaced == with =, it is using the comparison op in the actual code On Friday, 29 June 2012 16:07:55 UTC+1, (unknown) wrote: > > Hi, > > On Fri, 29 Jun 2012 15:36:35 +0100 > Brett Maton wrote: > > > I'm probably missing something really

Re: [Puppet Users] virtual resources & spaceship syntax

2012-06-29 Thread puppet-users
Hi, On Fri, 29 Jun 2012 15:36:35 +0100 Brett Maton wrote: > I'm probably missing something really simple here, but I can't get > the following to work: > > node 'puppet-slave.test.net' { > include users::accounts > User <| title="account" |> > } It’s supposed to be a comparison, not an ass

[Puppet Users] virtual resources & spaceship syntax

2012-06-29 Thread Brett Maton
I'm probably missing something really simple here, but I can't get the following to work: node 'puppet-slave.test.net' { include users::accounts User <| title="account" |> } Any suggestions welcomed :) Modules: modules/users/manifests/virtual.pp class users::virtual { define account (

[Puppet Users] Virtual resources for a list of server ip addresses in Apache config

2012-04-18 Thread Robert Rothenberg
I have an internal web site that can only be accessed from other servers. It seems to me that I should pass an array of the addresses to the class that instantiates the template for the Apache configuration. That seems easy. The hard part is getting every node to "register" itself so that it's

[Puppet Users] virtual resources vs fqdn_rand

2012-03-22 Thread Adam Heinz
Running puppet-2.6.13-2.el6.noarch on CentOS 6. define backup($apphost, $appfqdn) { cron { "backup-${apphost}-daily": command => "/usr/bin/rsync -a $appfqdn:backups/ $backdir/daily --delete", hour=> "2", minute => fqdn_rand(60), } } then elsewhere @@backu

Re: [Puppet Users] Virtual resources and hashes

2011-06-08 Thread Aaron Grewell
The request in the ticket is related but might not solve the same problem. What I think I'm looking for is the generic ability to specify an array of hashes as a resource title and have Puppet handle it intelligently (that is, produce a locally scoped hash split from the array and easily accessible

Re: [Puppet Users] Virtual resources and hashes

2011-06-08 Thread Randall Hansen
On Tue, Jun 7, 2011 at 4:15 PM, Aaron Grewell wrote: > $users = [{ username => "bill", uid => "12345" }, > { username => "ted",  uid => "12346" }] Aaron, I think this is a completely sane request. We've talked about it before, but I can't find an existing ticket. This one seems close,

[Puppet Users] Virtual resources and hashes

2011-06-07 Thread Aaron Grewell
Hmmm, either I'm doing something wrong or virtual resources are incompatible with hashes. When I do this: $users = [{ username => "bill", uid => "12345" }, { username => "ted", uid => "12346" }] define usertest ($alias = $name[username]) { user {$name[username]: ensure => pr

Re: [Puppet Users] Virtual resources stopped working...

2011-02-18 Thread Felix Frank
> Why would this be? Does anyone know any reliable way to list every > class a node is including? Is there a reason the users::sys class > cannot realise resources defined in users? There is /var/lib/puppet/state/classes.txt. > We originally tried to use tags to achieve this, but they are > com

[Puppet Users] Virtual resources stopped working...

2011-02-17 Thread Steve Shipway
Since I moved our pre-prod puppet master to RHEL6, things have broken. This is how: We have two classes, 'users' (which defines all our users as virtual) and 'users::sys' which realises the systems-admin users. I then have (this is simplified to show the problem): node basenode { include use

Re: [Puppet Users] Virtual Resources realization problems

2011-02-17 Thread Felix Frank
Hi, On 02/17/2011 12:12 AM, Forrie wrote: > I'm somewhat new to Puppet. I'm trying to establish some Virtual > Resources so I can realize them based on a TAG. > > The error I continue to get is: > > Feb 16 18:02:38 test-fms puppet-agent[8590]: Could not retrieve > catalog from remote server: E

[Puppet Users] Virtual Resources realization problems

2011-02-16 Thread Forrie
I'm somewhat new to Puppet. I'm trying to establish some Virtual Resources so I can realize them based on a TAG. The error I continue to get is: Feb 16 18:02:38 test-fms puppet-agent[8590]: Could not retrieve catalog from remote server: Error 400 on SERVER: Syntax error at '201001'; expected '}

[Puppet Users] Virtual resources, account module help.

2011-01-13 Thread Adam Crews
Hello, I'm trying to rebuild my accounts module so that will completely manage users via puppet. In my env, as much as I would like to, I cannot use nis or ldap for authentication, so I'm trying to do it the puppet way, but I seem to be a little stuck. I would like to maintain a list of users (c

Re: [Puppet Users] Virtual Resources

2010-09-10 Thread Douglas Garstang
Woo! Tanx! On Thu, Sep 9, 2010 at 11:41 PM, Frederik Wagner wrote: > Hi Doug, > > On Thu, Sep 9, 2010 at 7:06 PM, Douglas Garstang > wrote: >> Would it be safe to say that virtual resources, once defined, sort of >> become like a globally scoped object within the node? Ie, in one >> module I can

Re: [Puppet Users] Virtual Resources

2010-09-09 Thread Frederik Wagner
Hi Doug, On Thu, Sep 9, 2010 at 7:06 PM, Douglas Garstang wrote: > Would it be safe to say that virtual resources, once defined, sort of > become like a globally scoped object within the node? Ie, in one > module I can require=> an object defined as a virtual resource in > another module, as long

[Puppet Users] Virtual Resources

2010-09-09 Thread Douglas Garstang
Would it be safe to say that virtual resources, once defined, sort of become like a globally scoped object within the node? Ie, in one module I can require=> an object defined as a virtual resource in another module, as long as they are both being run on the node? The docs really don't make a lot o

[Puppet Users] Virtual Resources

2010-09-07 Thread Douglas Garstang
Would it be safe to say that virtual resources, once defined, sort of become like a globally scoped object within the node? Ie, in one module I can require=> an object defined as a virtual resource in another module, as long as they are both being run on the node? The docs really don't make a lot o

[Puppet Users] Virtual Resources with Variables

2010-06-15 Thread Doug Warner
I've seen the workarounds to use the concatenated file resource to fake this, but is it possible to use something like virtual resources to realize an array? My pseudo-classes would be like this: class foo { @$arr = ['a', 'b'] realize($arr) } class foo::c inherits foo { $arr += ['c'] } c

[Puppet Users] virtual resources

2010-04-13 Thread Roy Nielsen
Hello, I want to vitualize a resources - but want to realize an array of resources... somthing like: @file { $myarray : ensure => directory, ... } Can I realize the resources with: File <| title == $myarray |> ? Thanks, -Roy -- You received this message because you are subscribed t

[Puppet Users] Virtual Resources: Nagios_host - only getting one entry each run

2009-10-22 Thread Joel Heenan
OK So I'm doing something silly here, but this is the behaviour I'm seeing. I am instatiating a large number of virtual @nagios_host objects and @nagios_service objects. Then at run time I see the Nagios_service objects get propagated but it appears like it selects one of the Nagios_host objects. O

[Puppet Users] virtual resources: multiple exports and one collect

2008-10-01 Thread udo waechter
Hello everybody, I have a question regarding virtual resources and the exporting/ collection thereof. I have several hosts that should export one and the same file resource. This should be collected exactly once by one host. The resources are exported within a define: ## this define is used