Re: [Puppet Users] Dependencies between defines

2012-08-22 Thread Martin Alfke

On 23.08.2012, at 07:59, Douglas Garstang wrote:

...

>> Normally this works:
>> 
>> define task_one ( $user = 'root' ) {
>>file { '/tmp/one':
>>  owner => $user,
>>  content => $user,
>>   }
>> }
>> define task_two ( $user = 'root' ) {
>>   file { '/tmp/two':
>>  owner => $user,
>>  content => $user,
>>   }
>> }
>> task_one { 'foo': }
>> task_two { 'foo': }
>> Task_one['foo'] -> Task_two['foo']
>> 
>> You can also place the order inside the define:
>> 
>> define task_two ( $user = 'root') {
>>   file { '/tmp/two':
>>  owner => $name,
>>  content => $name,
>>   }
>>   Task_one["$name"] -> Task_two["$name"]
>> }
> 
> This really irks me. Is this documented anywhere? How did Task_one get
> into scope inside Task_two? What is the scope for definitions? Are
> they global?

My testcase run in a single manifest. So all defines are within the same scope.
In case that you use modules you need to give the full scope on ordering.

e.g.

Modue_one::Task_one['foo'] -> Module_two::Task_two['foo']


-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Re: how to connect agent to the master through a different user to execute a command through puppet module

2012-08-22 Thread Prosenjit Ghosh
Thanks so much for your time.
WIll try that.
Actually we have written a module on puppet-master which will run one
command (Installer command) on agent node when any agent connects to
the master.
This command wont work if this has root permission.
So we install and configure puppet master and agent using some other
user except "root". This worked successfully.
Now we are not able to connect the agent to the puppet master using
this different user except "root". This is the problem.
Anyway we will give this a try as per your suggestion.

And also thanks very much for our help.

Thanks

On Wed, Aug 22, 2012 at 10:55 PM, Nick Fagerlund
 wrote:
> I don't understand what you're doing. But it sounds like you might need the
> "user" attribute of the exec type?
>
> exec {'some command':
>   user => 'admin',
> }
>
> See http://docs.puppetlabs.com/references/latest/type.html#exec and scroll
> down a bit.
>
> On Wednesday, August 22, 2012 2:50:28 AM UTC-7, Prosenjit Ghosh wrote:
>>
>> Created a puppet master in one Linux.X64/rh50 machine.
>> Created a puppet agent in another Linux.X64/rh50 machine.
>>
>> Need to run any command from puppet master and that will execute in puppet
>> agent when puppet agent will connect to puppet master.
>>
>> This is happening correctly for me when created master and agent through
>> root user.
>>
>> But I need to execute a command that wont allow root user. I need any user
>> except root. I tried successfully to create puppet master through a
>> different user. But not able to execute the command when connecting the
>> agent through that different user.
>>
>> Any suggestion on this how to connect agent to the master through a
>> different user to execute a command through puppet module
>
> --
> 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/-/Y2EWm3dKGIUJ.
>
> To post to this group, send email to puppet-users@googlegroups.com.
> To unsubscribe from this group, send email to
> puppet-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/puppet-users?hl=en.

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Dependencies between defines

2012-08-22 Thread Douglas Garstang
On Wed, Aug 22, 2012 at 6:06 AM, Martin Alfke  wrote:
>
> On 22.08.2012, at 14:27, Axel Bock wrote:
>
> Hi readers
>
> another question for my little puppet project: Can I (and if yes, how)
> define dependendies between puppet "defines"? (define like in define
> mymodule::mydefine() {...})
>
> Example: I have a define "prepare_cool_thing" and another define
> "cool_thing". Both can be on a machine several times (quite, actually, like
> vhosts :). So this is entirely valid:
>
> prepare_cool_thing{ "name1" : }
> cool_thing{ "name1" : }
>
> prepare_cool_thing{ "name2" : }
> cool_thing{ "name2" : }
>
> I'm sure you get it. BUT. I'd like to state within the cool_thing define
> that the prepare_cool_thing was executed. Can I do that? The following does
> not seem to do what I want:
>
> Prepare_cool_thing[ "name1" ] -> Cool_thing[ "name1" ]  # naah, does not
> work.
>
>
> Where did you put the dependency?
> What puppet version are you using.
>
> Normally this works:
>
> define task_one ( $user = 'root' ) {
> file { '/tmp/one':
>   owner => $user,
>   content => $user,
>}
> }
> define task_two ( $user = 'root' ) {
>file { '/tmp/two':
>   owner => $user,
>   content => $user,
>}
> }
> task_one { 'foo': }
> task_two { 'foo': }
> Task_one['foo'] -> Task_two['foo']
>
> You can also place the order inside the define:
>
> define task_two ( $user = 'root') {
>file { '/tmp/two':
>   owner => $name,
>   content => $name,
>}
>Task_one["$name"] -> Task_two["$name"]
> }

This really irks me. Is this documented anywhere? How did Task_one get
into scope inside Task_two? What is the scope for definitions? Are
they global?

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 group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] Re: Dependencies between defines

2012-08-22 Thread Axel Bock
Hm, my last answer didn't get posted. So let's go again. 

First, thanks for your help, it seems to work now - maybe I fixed another 
bug or did something wrong. But now I have another at which I'm stuck. 
Basically I configure our web servers with puppet. For that I have a 
"webserver" class which basically sets up only the environment for web 
service, and a preparevhost define which, well, prepares a vhost on the 
machine. 

What puppet does now is to execute some of the preparevhost definitions 
_before_ the webserver class is applied, which fails miserably. EVEN though 
I defined a require => to a directory managed by the ws class from within 
the define - puppet simply seems to ignore that. 

So how can I make sure that the webserver class gets applied fully before 
the prepvhost define is started? The node configuration looks like this now:

node 'server' { include webserver }
node 'host1' inherits 'server' { preparevhost {"url" : } }

I'd appreciate any help :) . Oh, and yes, my puppet version is 2.6.12 from 
SLES 11 SP2.


Thanks in advance & greetings!
Axel.


Am Mittwoch, 22. August 2012 14:27:03 UTC+2 schrieb Axel Bock:
>
> Hi readers 
>
> another question for my little puppet project: Can I (and if yes, how) 
> define dependendies between puppet "defines"? (define like in define 
> mymodule::mydefine() {...})
>
> Example: I have a define "prepare_cool_thing" and another define 
> "cool_thing". Both can be on a machine several times (quite, actually, like 
> vhosts :). So this is entirely valid: 
>
> prepare_cool_thing{ "name1" : }
> cool_thing{ "name1" : }
>
> prepare_cool_thing{ "name2" : }
> cool_thing{ "name2" : }
>
> I'm sure you get it. BUT. I'd like to state within the cool_thing define 
> that the prepare_cool_thing was executed. Can I do that? The following does 
> not seem to do what I want: 
>
> Prepare_cool_thing[ "name1" ] -> Cool_thing[ "name1" ]  # naah, does not 
> work.
>
>
> Thanks & greetings!
> Axel.
>
>

-- 
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/-/3Y9pO2Vb4dYJ.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] Refreshing Definitions

2012-08-22 Thread Douglas Garstang
I'm very confused about something. The definition below is used to set
up swap. The three definitions, lvm::swapvol_make, lvm::swapvol_on and
lvm::swapvol_fstab, where previously inside this definition, but I
broke them into separate defines as I realised that the more I use the
$ensure parameter on a resource, the more likely it was that I'd have
to perform certain functions multiple times.

Previously I could chain those three resources together with subscribe
and refreshonly. However, refreshonly only works with Exec {}
resources. So, now that they are in their own definitions, how do I do
this? I can't put the refreshonly in the definition, because a) I
don't think it will be in scope, and b) it makes the definition no
longer general in nature.

Doug.

define lvm::swapvol ( $ensure, $volume_group, $size, $pvdisk_count ) {

case $ensure {

'mounted': {
#
# Logical volumes.
#
lvm::logical_volume {
#
# Create a logical volume for swap.
#
"$name":
ensure   => present,
volume_group => "$volume_group",
size => "$size",
pvdisk_count => "$pvdisk_count";
#require  => Lvm::Volume_group["$volume_group"];
}

lvm::swapvol_make {
"$name":
volume_group => "$volume_group",
subscribe => Lvm::Logical_volume["$name"],
refreshonly => true;
}

lvm::swapvol_on {
"$name":
volume_group => "$volume_group",
subscribe => Lvm::Swapvol_make["$name"],
refreshonly => true;
}

lvm::swapvol_fstab {
"$name":
volume_group => "$volume_group",
subscribe => Lvm::Swapvol_on["$name"],
refreshonly => true;
}

}

'umounted': {
}

'absent': {
}

}

}

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] nagios service check_https

2012-08-22 Thread Marc Lucke
I inherited the module so I'm not sure.  I did see some check_commands with ! 
and was wondering; I didn't connect the dots.

Thank you!! :)

On 23/08/2012, at 2:18 PM, Peter Brown  wrote:

> Hi,
> 
> $ARG1 in a nagios check is what comes after the first ! in the check.
> Which module are you using to generate your nagios setup?
> 
> On 23 August 2012 13:44, Marc Lucke  wrote:
>> I note that the check_https command that the puppet module generates is 
>> check_http -H $HOSTNAME -S $ARG1
>> 
>> I'd like to specify $ARG1 so that so that I can check return strings, check 
>> SSL certificates et al. but I couldn't find any way to do it other than 
>> nagios_command which seems pretty wasteful
>> 
>> Is it possible to set $ARG1 ?
>> 
>> 
>> Marc
>> 
>> --
>> 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+unsubscr...@googlegroups.com.
>> For more options, visit this group at 
>> http://groups.google.com/group/puppet-users?hl=en.
>> 
> 
> -- 
> 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+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/puppet-users?hl=en.
> 

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] nagios service check_https

2012-08-22 Thread Peter Brown
Hi,

$ARG1 in a nagios check is what comes after the first ! in the check.
Which module are you using to generate your nagios setup?

On 23 August 2012 13:44, Marc Lucke  wrote:
> I note that the check_https command that the puppet module generates is 
> check_http -H $HOSTNAME -S $ARG1
>
> I'd like to specify $ARG1 so that so that I can check return strings, check 
> SSL certificates et al. but I couldn't find any way to do it other than 
> nagios_command which seems pretty wasteful
>
> Is it possible to set $ARG1 ?
>
>
> Marc
>
> --
> 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+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/puppet-users?hl=en.
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] nagios service check_https

2012-08-22 Thread Marc Lucke
I note that the check_https command that the puppet module generates is 
check_http -H $HOSTNAME -S $ARG1

I'd like to specify $ARG1 so that so that I can check return strings, check SSL 
certificates et al. but I couldn't find any way to do it other than 
nagios_command which seems pretty wasteful

Is it possible to set $ARG1 ?


Marc

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] Re: Hiera Hash

2012-08-22 Thread Jarod Watkins
Sorry, I should explained my issue:

class apache (
  $apache = hiera_hash('apache'),
  $mpm= $apache['mpm'],
)

This code will produce the following error:

Could not retrieve catalog from remote server: Error 400 on SERVER: apache 
is not an hash or array when accessing it with mpm

If I do not try to set mpm inside the class definition but inside the 
manifest it will work:

class apache (
  $apache = hiera_hash('apache'),
) {

  $mpm = $apache['mpm']
  notify { "Hiera is: ${mpm}": }

Again am I seeing a bug or is this not how I should be doing things?

Jarod

On Wednesday, August 22, 2012 9:39:46 PM UTC-4, Jarod Watkins wrote:
>
> Hello,
> I have the following in common.yaml:
>
> apache:
>   mpm: worker
>
> If I do a "manual" lookup with the hiera command I get the proper result:
>
> hiera --config /etc/puppet/hiera.yaml apache
> {"mpm"=>"worker"}
>
> However, when trying to get the apache hash in a manifest, it appears to 
> be returned as a flattened string. I am using this notify statement in the 
> manifest:
>
> $apache = hiera('apache')
> notify { "Hiera is: ${apache}": }
>
> And I get this returned:
>
> Notify[Hiera is: mpmworker]
>
> The same thing is returned when I used hiera_hash. Interestingly enough, 
> when I used hiera_array I get this error message:
>
> Hiera type mismatch: expected Array and got Hash
>
> Am I seeing some sort of bug or am I doing something wrong?
>
> Puppet version: 2.7.18
> Hiera version: 1.0.0-0.1rc4
> Puppet-Hiera version: 1.0.0-0.1rc3
>
> Thanks,
> Jarod
>

-- 
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/-/ZTOWuA1Q69sJ.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] Hiera Hash

2012-08-22 Thread Jarod Watkins
Hello,
I have the following in common.yaml:

apache:
  mpm: worker

If I do a "manual" lookup with the hiera command I get the proper result:

hiera --config /etc/puppet/hiera.yaml apache
{"mpm"=>"worker"}

However, when trying to get the apache hash in a manifest, it appears to be 
returned as a flattened string. I am using this notify statement in the 
manifest:

$apache = hiera('apache')
notify { "Hiera is: ${apache}": }

And I get this returned:

Notify[Hiera is: mpmworker]

The same thing is returned when I used hiera_hash. Interestingly enough, 
when I used hiera_array I get this error message:

Hiera type mismatch: expected Array and got Hash

Am I seeing some sort of bug or am I doing something wrong?

Puppet version: 2.7.18
Hiera version: 1.0.0-0.1rc4
Puppet-Hiera version: 1.0.0-0.1rc3

Thanks,
Jarod

-- 
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/-/VmGS4fBuskgJ.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] The rewritten Puppet 2.7 language reference is live

2012-08-22 Thread wen1023 wu
it's very useful,i think it's better than puppet guide,

2012/8/22 Nick Fagerlund 

> Hi all,
>
> I've finished the all new Puppet 2.7 language reference. EXCITING! Well,
> exciting to me, at least. Table of contents:
>
> http://docs.puppetlabs.com/puppet/2.7/reference/
>
> Visual index (for when you know what you're looking for but you don't know
> what it's called):
>
> http://docs.puppetlabs.com/puppet/2.7/reference/lang_visual_index.html
>
> And of course, use the navigation in the left sidebar to jump between
> pages.
>
> Our goal here is to nail down every detail of how the Puppet language
> works, then cut new versions along with major Puppet releases. We'll
> eventually be expanding this versioned document with non-language details
> -- we've been referring to this plan as the "Puppet reference manual." Its
> purpose isn't to replace any of the guides or how-tos, but to lay down a
> "just the facts" baseline that lets you get in and out fast.
>
> Anyway, we hope you find it useful. Thanks for using Puppet.
>
>  --
> 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/-/bDBvT082CjQJ.
> To post to this group, send email to puppet-users@googlegroups.com.
> To unsubscribe from this group, send email to
> puppet-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/puppet-users?hl=en.
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Getting all variable occurrences from Hiera

2012-08-22 Thread Tim Mooney

In regard to: Re: [Puppet Users] Getting all variable occurrences from...:


Now I really think we're talking about different things, because this
data design seems quite reasonable and I agree that merging a various
intermediate keys from a nested data structure ought to work. Indeed
this seems like something that is back-end dependent, i.e. a different
yaml backend could behave exactly this way behind the scenes when you
request the 'ntp' hash for a node, without needing a different hiera_*
function at all.


Agreed.


So I guess I should ask, Alexander did I misunderstand what you were
asking about in #16003?


My impression is that you understood #16003 correctly, and that the
use-case I was asking about is in reality different.  I hope Alexander
chimes in to confirm or refute that, but I think we're asking about
things that seem related but aren't.

Keep in mind that I'm not saying I think hiera *must* work the way I've
described, I'm just asserting that I can see people potentially thinking
it would work that way and I can see some potential benefits to having
it work that way.  What I'm really asking for, more than anything, is
a stance from the designers and architects saying either "bad idea, don't
do it" or "yeah, should work and we're not opposed to it".

If I need to open a separate ticket to get that kind of directional
clarity, I would be happy to do so.

Tim
--
Tim Mooney tim.moo...@ndsu.edu
Enterprise Computing & Infrastructure  701-231-1076 (Voice)
Room 242-J6, IACC Building 701-231-8541 (Fax)
North Dakota State University, Fargo, ND 58105-5164

--
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Getting all variable occurrences from Hiera

2012-08-22 Thread Eric Sorenson
On Aug 22, 2012, at 3:38 PM, Tim Mooney wrote:

> What I'm asking for (or at least, about) is indeed somewhat different than
> what Alexander was asking for.
> 
> I'm a little surprised at the quick dismissal.

I do not disagree with what you've described below, but I do not think it's 
covered by the problem statement in #16003 -- perhaps I didn't understand the 
implications of Alexander's request or maybe these are two different things 
we're conflating. I read #16003 as wanting a way, from hiera, to enumerate all 
the nodes hiera considers itself authoritative for. 


>  It seems reasonable to me
> that since at least YAML supports data structures *and* puppet supports
> hashes and arrays and nesting of same, one might choose to design the
> configuration "namespace" for a particular class to use an actual data
> structure in hiera.  I've been watching the list very closely
> for several months for any official statement from Puppetlabs folks about
> best practices with hiera data, and your statement is really the first
> I've seen.
> 
> What you've said has a pretty clear implication: don't use nested data
> structures in hiera, because they're not going to work in the way that
> I think most people would expect them to work -- you can't merge different
> sub-keys from different parts of your hierarchy.

Now I really think we're talking about different things, because this data 
design seems quite reasonable and I agree that merging a various intermediate 
keys from a nested data structure ought to work. Indeed this seems like 
something that is back-end dependent, i.e. a different yaml backend could 
behave exactly this way behind the scenes when you request the 'ntp' hash for a 
node, without needing a different hiera_* function at all.

So I guess I should ask, Alexander did I misunderstand what you were asking 
about in #16003?

Eric Sorenson - eric.soren...@puppetlabs.com
PuppetConf'12 - 27-28 Sep in SF - http://bit.ly/pcsig12

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Reporting to Dashboard on XP node

2012-08-22 Thread Josh Cooper
Hi Josh,

On Thu, Aug 9, 2012 at 2:05 PM, Josh Shabtai  wrote:

> Hi,
>
> We set up Dashboard a month or two ago, running on our Puppet master (a
> Debian server). All of our machines are running puppet just fine, but one
> of them, an XP machine (the software we're running doesn't work on server
> 2003 for some reason), doesn't seem to be sending reports to Dashboard.
>
> I've checked the puppet.conf file and it's the same as the 2003/2008
> servers, though none of them are set to report, but all of them do (except
> the XP machine). All the Debian machines are running as expected.
>
> The puppet.conf on the Windows machines (XP, and servers) all contain the
> following:
>
>> [main]
>> pluginsync=true
>> server=
>> autoflush=true
>>
>
> I haven't found too much documentation on this stuff (just this:
> http://docs.puppetlabs.com/dashboard/manual/1.2/bootstrapping.html#configuring-puppet),
> and I have no idea how to proceed. Any help would be appreciated.
>
> Thanks,
> Josh Shabtai
>
> --
> 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/-/ypnJNtmbI88J.
> To post to this group, send email to puppet-users@googlegroups.com.
> To unsubscribe from this group, send email to
> puppet-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/puppet-users?hl=en.
>

Puppet by default is configured to send reports. You can check this using
the `--configprint` option:

> puppet agent --configprint report
true
> puppet agent --configprint reporturl
http://localhost:3000/reports/upload

Make sure you get the same values reported. Then run puppet from the
command line and verify that it sends the report:

> puppet agent --test --debug --trace
...

Josh

-- 
Josh Cooper
Developer, Puppet Labs

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Re: Getting all variable occurrences from Hiera

2012-08-22 Thread Tim Mooney

In regard to: Re: [Puppet Users] Re: Getting all variable occurrences from...:


I'll comment in the ticket as well,


I see you have, and you've closed it out.


In Tim Mooney's example, which I think is
the usual case for hiera data, hiera doesn't have an enumeration of all the
'type: client' nodes, nor should it.


What I'm asking for (or at least, about) is indeed somewhat different than
what Alexander was asking for.

I'm a little surprised at the quick dismissal.  It seems reasonable to me
that since at least YAML supports data structures *and* puppet supports
hashes and arrays and nesting of same, one might choose to design the
configuration "namespace" for a particular class to use an actual data
structure in hiera.  I've been watching the list very closely
for several months for any official statement from Puppetlabs folks about
best practices with hiera data, and your statement is really the first
I've seen.

What you've said has a pretty clear implication: don't use nested data
structures in hiera, because they're not going to work in the way that
I think most people would expect them to work -- you can't merge different
sub-keys from different parts of your hierarchy.

In other words, we shouldn't use something like this:

ntp:
  type: 'client'
  servers:
- 10.1.2.3
- 10.1.2.4
  allow_query:
- '10.1.0.0/255.255.0.0'
- '10.2.0.0/255.255.0.0'
- '10.3.0.0/255.255.0.0'
- '2001:4930::/:::'

We should instead use:

ntp_type: 'client'
ntp_servers:
  - 10.1.2.3
  - 10.1.2.4
ntp_allow_query:
  - '10.1.0.0/255.255.0.0'
  - '10.2.0.0/255.255.0.0'
  - '10.3.0.0/255.255.0.0'
  - '2001:4930::/:::'


You could pretty easily write a custom parser function to return the data
structures you want.


Perhaps if I was as adept in ruby as many of the Puppetlabs employees,
that would be pretty easy, but unfortunately I'm not.

I do appreciate the response!  It's really nice to know the thoughts of
the people that are the experts on this.  It helps me to plan the
direction for our environment.

Tim
--
Tim Mooney tim.moo...@ndsu.edu
Enterprise Computing & Infrastructure  701-231-1076 (Voice)
Room 242-J6, IACC Building 701-231-8541 (Fax)
North Dakota State University, Fargo, ND 58105-5164

--
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] Bad URL in repomd.xml file

2012-08-22 Thread puppetista
I'm attempting to install puppet using the recommended yum method described 
on the puppetlabs web page:

http://docs.puppetlabs.com/guides/installation.html

According to 
http://docs.puppetlabs.com/guides/puppetlabs_package_repositories.html#for-red-hat-enterprise-linux-and-derivatives

you should execute this:
sudo rpm -ivh 
http://yum.puppetlabs.com/el/5/products/i386/puppetlabs-release-5-5.noarch.rpm

which installs /etc/yum.repos.d/puppetlabs.repo

http:// yum.puppetlabs.com /el/5/dependencies/$basearch
 --> http:// yum.puppetlabs.com /el/5/dependencies/x86_64

When I execute yum install puppet, I end up with this error:

http://yum.puppetlabs.com/el/5/dependencies/x86_64/repodata/repomd.xml: 
[Errno 12] Timeout: 
http://yum.puppetlabs.com/el/5/dependencies/x86_64/repodata/repomd.xml
contains:
http://linux.duke.edu/metadata/repo

When I attempt to visit this last link in a browser it returns a file not 
found error.

Is there an updated path for this repository?

-- 
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/-/ysbez2iWjeIJ.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Hiera to hash

2012-08-22 Thread Douglas Garstang
This in insanity.

Now I have:
$ec2_config = hiera('ec2_config')

if $::ec2_instance_id {
$pvdisks = $ec2_config['instance'][$::ec2_instance_type]['pvdisks']
$pvdisk_count = inline_template('<%= @pvdisks.length %>')
$swapvol_enabled =
$ec2_config['instance'][$::ec2_instance_type]['volumes']['swap']['enabled']
$logvol_enabled =
$ec2_config['instance'][$::ec2_instance_type]['volumes']['log']['enabled']
notice ("HERE0 ($swapvol_enabled) ($logvol_enabled)")
if ($swapvol_enabled == 'true') {
$swapvol_size =
$ec2_config['instance'][$::ec2_instance_type]['volumes']['swap']['size']
notice ("HERE1")
}
if ($logvol_enabled == 'true') {
$logvol_size =
$ec2_config['instance'][$::ec2_instance_type]['volumes']['log']['size']
notice("HERE2")
}
notice ("HERE3 $swapvol_size $swapvol_size")
}

The first HERE0 correctly displays '(true) (true)' in the logs.
However, on the very next line, where the condition is if
$swapvol_enabled == 'true',it returns false. WTF???

Doug

On Wed, Aug 22, 2012 at 1:56 PM, Wolf Noble  wrote:
> I accomplished something similar awhile back.
>
> While I've not spent much time looking at your particular problem, I think 
> this'll help point you in the direction of what you need…
>
>
>
> class mymodule::params{
> $collector= hiera('mymodule_collector','')
> }
>
> class mymodule::config{
>  $collector   = $mymodule::params::collector
>  $ipstring= inline_template("<% collector.each_pair do |key, hash| 
> %><%=hash['ip']%>,<%end%>")
>  $ips = split ($ipstring,',')
> }
>
> define mymodule::add_hosts_allow () {
>   exec { "hosts_allow_$title":
> command => "/bin/echo \"myservice : $title : ALLOW\" >>/etc/hosts.allow",
> unless  => "/bin/grep -c \"myservice : $title : ALLOW\" /etc/hosts.allow",
>   } #end exec
> }
>
>
> On Aug 21, 2012, at 11:00 PM, Douglas Garstang  
> wrote:
>
>> I know I did this once before but can't find docs on how to do it again.
>>
>> I have this in a yaml file:
>>
>> pvdisks:
>>ec2_pvdisks_m1.small:
>>disks: /dev/xvdb1
>>enabled: yes
>>
>> Loading it with hiera.
>>
>> Manifest has:
>>
>>$testkey = hiera('pvdisks')
>>notice ("TESTKEY=$testkey[ec2_pvdisks_m1.small]")
>>
>> This is printing
>> TESTKEY=ec2_pvdisks_m1.smalldisks/dev/xvdb1enabledtrue['ec2_pvdisks_m1.small']
>>
>> which obviously is the data picked into a string.
>>
>> 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 group, send email to 
>> puppet-users+unsubscr...@googlegroups.com.
>> For more options, visit this group at 
>> http://groups.google.com/group/puppet-users?hl=en.
>>
>
>
> 
>
> This message may contain confidential or privileged information. If you are 
> not the intended recipient, please advise us immediately and delete this 
> message. See http://www.datapipe.com/legal/email_disclaimer/ for further 
> information on confidentiality and the risks of non-secure electronic 
> communication. If you cannot access these links, please notify us by reply 
> message and we will send the contents to you.
>
> --
> 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+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/puppet-users?hl=en.
>



-- 
Regards,

Douglas Garstang
http://www.linkedin.com/in/garstang
Email: doug.garst...@gmail.com
Cell: +1-805-340-5627

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] Sign up for a usability test by Puppet Labs: Publishing Puppet modules to the Forge with the command-line module tool.

2012-08-22 Thread Ryan Coleman
Hello All,

We're conducting a usability test around publishing modules to the
Forge via the Puppet Module Tool. You'll be testing a prototype of the
functionality we'd like to ship as part of our tool. We're interested
in gathering your feedback and learning from how you work with the
tool and what your needs are. The test session will last an hour. For
your time, we'll compensate you with a $25 gift card to Amazon.com.

You must have written a Puppet module in order to participate but
experience using the Puppet Forge is not required. If you're
interested in helping us out, please follow the link for details and a
brief sign-up form.

Thank you for your time!

http://links.puppetlabs.com/pmt_user_test

-- 
Ryan Coleman | about.me/ryc
Modules & Forge @ Puppet Labs

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Re: Puppet manifests under version control issue

2012-08-22 Thread mikewootini
Had the same problem as Maxim, thanks for the posting your fix as this 
worked great for me. 
-mike

On Thursday, May 6, 2010 4:29:30 AM UTC-7, Maxim Ianoglo wrote:
>
> Hello, 
>
> I found my issue. 
>
> I should export the PATH variable - not just define it: 
> export PATH='/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/ 
> bin:/sbin:/ 
> and now it works 
>
> Thank you. 
> -- 
> Maxim Ianoglo 
>
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Puppet Users" group. 
> To post to this group, send email to puppet...@googlegroups.com. 
>
> To unsubscribe from this group, send email to 
> puppet-users...@googlegroups.com . 
> For more options, visit this group at 
> http://groups.google.com/group/puppet-users?hl=en. 
>
>

-- 
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/-/PhEkuSr9-W8J.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] package handling in puppet?

2012-08-22 Thread Ramin K

On 8/22/2012 9:55 AM, lamour wrote:


So, my basic issue with both the class method and the virtual resources
method is that they basically require me to maintain a SECOND list of
every package I want to maintain this way (either class or virtual
resource definitions).  This seems like a lot of syntactic and
logistical overhead, especially when you consider that if we ignore the
possibility of collisions, we can just do this:

package { ['perl', 'mysql', 'gcc', 'screen', 'foo', 'bar', 'baz']:
 ensure => installed
}

This is clean, concise, and trivial to understand.  This is kind of what
I was hoping for.  I understand that we'll probably have to use the
class method for any packages where ACTUAL conflicts exist (e.g., the
version example you gave above), but for virtually all of our packages,
we're not going to have that problem


	I'd argue that you're trying to bring your procedural shell scripting 
world into Puppet. :-) It's the difference between wanting to 
micromanage the control you have of a system vs giving Puppet the power 
to affect the control you want. Let's consider some of the packages 
you've listed above.


	My Mysql module and templates are 200 lines which install and configure 
mysql-server, supports three distros, sets various variables based on 
local facts, and uses Hiera to manage other settings based on the role 
of the server. Installing the package is actually the simplest thing it 
does.


	In the case of gcc it's part of a modules called general_devel which 
installs gcc, make, zlib, etc. I don't recall a situation where I would 
need to install gcc without support packages so again installing gcc is 
the simplest thing it does. Supports three distros, 30 lines.


	Screen is part of the base node and I use a vpackage module and realize 
it along with vim, htop, etc. Perl is installed by default so I don't 
have it anywhere, but I'd probably put it here or make a module for it 
so I could install any support tools and libs there.


So your example in my world ends up looking like the following code. On 
the surface it's more complicated, but in application to a node it's 
actually simpler in my opinion because I have easy entry points to the 
complexity I've delegated to the modules. This allows me to drop 
discrete packages of capabilities on to servers without having to 
revisit the internal logic every time. include mysql does this for me, 
package { 'mysql': ensure => present,} does not.


Ramin

node 'some.node.my.domain.com inherits basenode {
  include mysql
  include general_devel
  realize Package['mysql-client']
}

node basenode {
  include sudo
  include vpackage

  # realize all packages with this tag
  Package<| tag = 'utils' |>
}

class vpackage {

  # packages with tag => util get realized on all systems
  @package { 'curl':tag => 'utils',}
  @package { 'htop':tag => 'utils',}
  @package { 'lynx':tag => 'utils',}
  @package { 'screen':  tag => 'utils',}
  @package { 'strace':  tag => 'utils',}
  @package { 'tcpdump': tag => 'utils',}
  @package { 'wget':tag => 'utils',}
  @package { 'whois':   tag => 'utils', name => 
$vpackages::params::whois, }


  @package { 'mysql-client': name => $vpackages::params::mysqlclient, }
}

--
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] Re: pass values to puppet-lvm

2012-08-22 Thread Jesus
The problem is not in the OS. I had the same issue
and I have CentOS 6.2. 
 
It turned out that puppet-lvm is not a regular module but a puppet plugin.
So, after installing the module, it needs to be sync'ed to the client 
machines.
pluginsync and factsync are not enabled by default.
 
The command:
 
sudo puppet agent --test --verbose --pluginsync 
 
worked for me.
 
In case anybody is having the same issue as I couldn't find a solution 
anywhere.
 
Jesus.
 
 
 
 

El miércoles, 29 de febrero de 2012 03:41:22 UTC-5, Matt escribió:

> I get the same problem with CentOS. 
> No error but no LV created. 
>
> I've tried with Ubuntu client and same issue. 
>
> Something might be wrong within the module... 
>
> Matt 
>
> On Feb 4, 1:59 am, Luke  wrote: 
> > Oh well. Maybe thislvmmodule doesn't like centos or something :( 
> > 
> > Thanks for all your help Felix. If anyone else has any ideas or 
> betterlvmtype modules please drop a line. 
> > 
> > On Feb 3, 1:42 pm, Felix Frank  
> > wrote: 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > > On 02/03/2012 06:37 PM, Luke wrote: 
> > 
> > > >   if ! defined(Physical_volume[$pv]) { 
> > > > physical_volume { $pv: ensure => present } 
> > > >   } 
> > 
> > > Ah, dreadful ;-) 
> > 
> > > But there goes that theory - the PV and VG are implicitly created, so 
> > > the module really *should* do the right thing. 
> > 
> > > So the issue is probably with the provider(?) 
> > > I'm stumped. 
> > 
> > > Felix

-- 
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/-/hRL9Jia7TFwJ.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Hiera to hash

2012-08-22 Thread Douglas Garstang
On Wed, Aug 22, 2012 at 1:52 PM, Douglas Garstang
 wrote:
> On Wed, Aug 22, 2012 at 1:43 PM, Justin Stoller  wrote:
>> On Wed, Aug 22, 2012 at 1:34 PM, Douglas Garstang
>>  wrote:
>>> On Wed, Aug 22, 2012 at 11:08 AM, Douglas Garstang
>>>  wrote:
 On Tue, Aug 21, 2012 at 11:51 PM, Douglas Garstang
  wrote:
> On Tue, Aug 21, 2012 at 11:44 PM, Douglas Garstang
>  wrote:
>> On Tue, Aug 21, 2012 at 11:19 PM, Stephen Gran
>>  wrote:
>>> Hi,
>>>
>>> On Tue, 2012-08-21 at 21:00 -0700, Douglas Garstang wrote:
 I know I did this once before but can't find docs on how to do it 
 again.

 I have this in a yaml file:

 pvdisks:
 ec2_pvdisks_m1.small:
 disks: /dev/xvdb1
 enabled: yes

 Loading it with hiera.

 Manifest has:

 $testkey = hiera('pvdisks')
 notice ("TESTKEY=$testkey[ec2_pvdisks_m1.small]")

 This is printing
 TESTKEY=ec2_pvdisks_m1.smalldisks/dev/xvdb1enabledtrue['ec2_pvdisks_m1.small']
>>>
>>> Try inspecting it some other way than printf debugging - notice always
>>> flattens variables by calling .to_s on them, so it is not a very useful
>>> tool.  I am assuming that things are indeed fine, but this is confusing
>>> matters.
>>
>> I've since learned that I have to use hiera_array and hiera_hash,
>> which aren't documented anywhere.
>>
>> Now I've got:
>>
>> ec2_config:
>>   instance:
>>   m1.small:
>> pvdisks:
>> - /dev/xvdb1
>> swapvol_size: 2G
>> logvol_size: 64G
>>   m1.medium:
>> pvdisks:
>> - /dev/xvdb1
>> swapvol_size: 2G
>> logvol_size: 64G
>>   m1.large:
>> pvdisks:
>> - /dev/xvdb1
>> - /dev/xvdc1
>> swapvol_size: 4G
>> logvol_size: 64G
>>
>> and I've tried to access the data every witch way.
>>
>> This gives me a syntax error...
>> $pvdisks = 
>> hiera_array(ec2_config['instance'][$::ec2_instance_type]['pvdisks'])
>>
>> and this:
>> $pvdisks = 
>> hiera_array($ec2_config['instance'][$::ec2_instance_type]['pvdisks'])
>>
>> gives me:
>> err: Could not retrieve catalog from remote server: Error 400 on
>> SERVER: ec2_config is not an hash or array when accessing it with
>> instance at 
>> /truth/sauce/env/prod/modules/role/manifests/base_server.pp:27
>> on node gfs01.us1.xxx.com
>>
>> Ugh.
>>
>> Doug.
>
> Actually, apparently, no, that's not what these functions are for. :(
>
> Doug.

 :(
>>>
>>> Apparently this is difficult and/or not supported...
>>
>> Is this what you're trying to do?
>>
>> $ec2_config = hiera('ec2_config')
>> $pvdisks = $ec2_config['instance'][$::ec2_instance_type]['pvdisks']
>>
>>
>> http://docs.puppetlabs.com/puppet/2.7/reference/lang_datatypes.html#hashes
>
> No luck.
>
> With:
>
> ec2_config:
>   instance:
>   m1.small:
> pvdisks:
> - /dev/xvdb1
> swapvol_size: 2G
> logvol_size: 64G
>   m1.medium:
> pvdisks:
> - /dev/xvdb1
> swapvol_size: 2G
> logvol_size: 64G
>
> etc...
>
> and in the manifest:
>
> $foo = hiera_hash('ec2_config')
> $pvdisks = $foo['instance'][$::ec2_instance_type]['pvdisks']  #
> Line 17 from error below.
> notice ("PVDISKS = $pvdisks")
>
> puppet bails with:
>
> err: Could not retrieve catalog from remote server: Error 400 on
> SERVER: $foo["instance"] is not an hash or array when accessing it
> with m1.large at
> /truth/sauce/env/prod/modules/role/manifests/base_server.pp:17 on node
> gfs01.us1.xxx.co,
>
> G.
>
> Doug.

I think I got it... yaml file was bad...

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 group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Hiera to hash

2012-08-22 Thread Wolf Noble
I accomplished something similar awhile back.

While I've not spent much time looking at your particular problem, I think 
this'll help point you in the direction of what you need…



class mymodule::params{
$collector= hiera('mymodule_collector','')
}

class mymodule::config{
 $collector   = $mymodule::params::collector
 $ipstring= inline_template("<% collector.each_pair do |key, hash| 
%><%=hash['ip']%>,<%end%>")
 $ips = split ($ipstring,',')
}

define mymodule::add_hosts_allow () {
  exec { "hosts_allow_$title":
command => "/bin/echo \"myservice : $title : ALLOW\" >>/etc/hosts.allow",
unless  => "/bin/grep -c \"myservice : $title : ALLOW\" /etc/hosts.allow",
  } #end exec
}


On Aug 21, 2012, at 11:00 PM, Douglas Garstang  wrote:

> I know I did this once before but can't find docs on how to do it again.
>
> I have this in a yaml file:
>
> pvdisks:
>ec2_pvdisks_m1.small:
>disks: /dev/xvdb1
>enabled: yes
>
> Loading it with hiera.
>
> Manifest has:
>
>$testkey = hiera('pvdisks')
>notice ("TESTKEY=$testkey[ec2_pvdisks_m1.small]")
>
> This is printing
> TESTKEY=ec2_pvdisks_m1.smalldisks/dev/xvdb1enabledtrue['ec2_pvdisks_m1.small']
>
> which obviously is the data picked into a string.
>
> 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 group, send email to 
> puppet-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/puppet-users?hl=en.
>




This message may contain confidential or privileged information. If you are not 
the intended recipient, please advise us immediately and delete this message. 
See http://www.datapipe.com/legal/email_disclaimer/ for further information on 
confidentiality and the risks of non-secure electronic communication. If you 
cannot access these links, please notify us by reply message and we will send 
the contents to you.

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Hiera to hash

2012-08-22 Thread Douglas Garstang
On Wed, Aug 22, 2012 at 1:43 PM, Justin Stoller  wrote:
> On Wed, Aug 22, 2012 at 1:34 PM, Douglas Garstang
>  wrote:
>> On Wed, Aug 22, 2012 at 11:08 AM, Douglas Garstang
>>  wrote:
>>> On Tue, Aug 21, 2012 at 11:51 PM, Douglas Garstang
>>>  wrote:
 On Tue, Aug 21, 2012 at 11:44 PM, Douglas Garstang
  wrote:
> On Tue, Aug 21, 2012 at 11:19 PM, Stephen Gran
>  wrote:
>> Hi,
>>
>> On Tue, 2012-08-21 at 21:00 -0700, Douglas Garstang wrote:
>>> I know I did this once before but can't find docs on how to do it again.
>>>
>>> I have this in a yaml file:
>>>
>>> pvdisks:
>>> ec2_pvdisks_m1.small:
>>> disks: /dev/xvdb1
>>> enabled: yes
>>>
>>> Loading it with hiera.
>>>
>>> Manifest has:
>>>
>>> $testkey = hiera('pvdisks')
>>> notice ("TESTKEY=$testkey[ec2_pvdisks_m1.small]")
>>>
>>> This is printing
>>> TESTKEY=ec2_pvdisks_m1.smalldisks/dev/xvdb1enabledtrue['ec2_pvdisks_m1.small']
>>
>> Try inspecting it some other way than printf debugging - notice always
>> flattens variables by calling .to_s on them, so it is not a very useful
>> tool.  I am assuming that things are indeed fine, but this is confusing
>> matters.
>
> I've since learned that I have to use hiera_array and hiera_hash,
> which aren't documented anywhere.
>
> Now I've got:
>
> ec2_config:
>   instance:
>   m1.small:
> pvdisks:
> - /dev/xvdb1
> swapvol_size: 2G
> logvol_size: 64G
>   m1.medium:
> pvdisks:
> - /dev/xvdb1
> swapvol_size: 2G
> logvol_size: 64G
>   m1.large:
> pvdisks:
> - /dev/xvdb1
> - /dev/xvdc1
> swapvol_size: 4G
> logvol_size: 64G
>
> and I've tried to access the data every witch way.
>
> This gives me a syntax error...
> $pvdisks = 
> hiera_array(ec2_config['instance'][$::ec2_instance_type]['pvdisks'])
>
> and this:
> $pvdisks = 
> hiera_array($ec2_config['instance'][$::ec2_instance_type]['pvdisks'])
>
> gives me:
> err: Could not retrieve catalog from remote server: Error 400 on
> SERVER: ec2_config is not an hash or array when accessing it with
> instance at /truth/sauce/env/prod/modules/role/manifests/base_server.pp:27
> on node gfs01.us1.xxx.com
>
> Ugh.
>
> Doug.

 Actually, apparently, no, that's not what these functions are for. :(

 Doug.
>>>
>>> :(
>>
>> Apparently this is difficult and/or not supported...
>
> Is this what you're trying to do?
>
> $ec2_config = hiera('ec2_config')
> $pvdisks = $ec2_config['instance'][$::ec2_instance_type]['pvdisks']
>
>
> http://docs.puppetlabs.com/puppet/2.7/reference/lang_datatypes.html#hashes

No luck.

With:

ec2_config:
  instance:
  m1.small:
pvdisks:
- /dev/xvdb1
swapvol_size: 2G
logvol_size: 64G
  m1.medium:
pvdisks:
- /dev/xvdb1
swapvol_size: 2G
logvol_size: 64G

etc...

and in the manifest:

$foo = hiera_hash('ec2_config')
$pvdisks = $foo['instance'][$::ec2_instance_type]['pvdisks']  #
Line 17 from error below.
notice ("PVDISKS = $pvdisks")

puppet bails with:

err: Could not retrieve catalog from remote server: Error 400 on
SERVER: $foo["instance"] is not an hash or array when accessing it
with m1.large at
/truth/sauce/env/prod/modules/role/manifests/base_server.pp:17 on node
gfs01.us1.xxx.co,

G.

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 group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Hiera to hash

2012-08-22 Thread Justin Stoller
On Wed, Aug 22, 2012 at 1:34 PM, Douglas Garstang
 wrote:
> On Wed, Aug 22, 2012 at 11:08 AM, Douglas Garstang
>  wrote:
>> On Tue, Aug 21, 2012 at 11:51 PM, Douglas Garstang
>>  wrote:
>>> On Tue, Aug 21, 2012 at 11:44 PM, Douglas Garstang
>>>  wrote:
 On Tue, Aug 21, 2012 at 11:19 PM, Stephen Gran
  wrote:
> Hi,
>
> On Tue, 2012-08-21 at 21:00 -0700, Douglas Garstang wrote:
>> I know I did this once before but can't find docs on how to do it again.
>>
>> I have this in a yaml file:
>>
>> pvdisks:
>> ec2_pvdisks_m1.small:
>> disks: /dev/xvdb1
>> enabled: yes
>>
>> Loading it with hiera.
>>
>> Manifest has:
>>
>> $testkey = hiera('pvdisks')
>> notice ("TESTKEY=$testkey[ec2_pvdisks_m1.small]")
>>
>> This is printing
>> TESTKEY=ec2_pvdisks_m1.smalldisks/dev/xvdb1enabledtrue['ec2_pvdisks_m1.small']
>
> Try inspecting it some other way than printf debugging - notice always
> flattens variables by calling .to_s on them, so it is not a very useful
> tool.  I am assuming that things are indeed fine, but this is confusing
> matters.

 I've since learned that I have to use hiera_array and hiera_hash,
 which aren't documented anywhere.

 Now I've got:

 ec2_config:
   instance:
   m1.small:
 pvdisks:
 - /dev/xvdb1
 swapvol_size: 2G
 logvol_size: 64G
   m1.medium:
 pvdisks:
 - /dev/xvdb1
 swapvol_size: 2G
 logvol_size: 64G
   m1.large:
 pvdisks:
 - /dev/xvdb1
 - /dev/xvdc1
 swapvol_size: 4G
 logvol_size: 64G

 and I've tried to access the data every witch way.

 This gives me a syntax error...
 $pvdisks = 
 hiera_array(ec2_config['instance'][$::ec2_instance_type]['pvdisks'])

 and this:
 $pvdisks = 
 hiera_array($ec2_config['instance'][$::ec2_instance_type]['pvdisks'])

 gives me:
 err: Could not retrieve catalog from remote server: Error 400 on
 SERVER: ec2_config is not an hash or array when accessing it with
 instance at /truth/sauce/env/prod/modules/role/manifests/base_server.pp:27
 on node gfs01.us1.xxx.com

 Ugh.

 Doug.
>>>
>>> Actually, apparently, no, that's not what these functions are for. :(
>>>
>>> Doug.
>>
>> :(
>
> Apparently this is difficult and/or not supported...

Is this what you're trying to do?

$ec2_config = hiera('ec2_config')
$pvdisks = $ec2_config['instance'][$::ec2_instance_type]['pvdisks']


http://docs.puppetlabs.com/puppet/2.7/reference/lang_datatypes.html#hashes

HTH,
Justin

>
> --
> 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+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/puppet-users?hl=en.
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Hiera to hash

2012-08-22 Thread Douglas Garstang
On Wed, Aug 22, 2012 at 11:08 AM, Douglas Garstang
 wrote:
> On Tue, Aug 21, 2012 at 11:51 PM, Douglas Garstang
>  wrote:
>> On Tue, Aug 21, 2012 at 11:44 PM, Douglas Garstang
>>  wrote:
>>> On Tue, Aug 21, 2012 at 11:19 PM, Stephen Gran
>>>  wrote:
 Hi,

 On Tue, 2012-08-21 at 21:00 -0700, Douglas Garstang wrote:
> I know I did this once before but can't find docs on how to do it again.
>
> I have this in a yaml file:
>
> pvdisks:
> ec2_pvdisks_m1.small:
> disks: /dev/xvdb1
> enabled: yes
>
> Loading it with hiera.
>
> Manifest has:
>
> $testkey = hiera('pvdisks')
> notice ("TESTKEY=$testkey[ec2_pvdisks_m1.small]")
>
> This is printing
> TESTKEY=ec2_pvdisks_m1.smalldisks/dev/xvdb1enabledtrue['ec2_pvdisks_m1.small']

 Try inspecting it some other way than printf debugging - notice always
 flattens variables by calling .to_s on them, so it is not a very useful
 tool.  I am assuming that things are indeed fine, but this is confusing
 matters.
>>>
>>> I've since learned that I have to use hiera_array and hiera_hash,
>>> which aren't documented anywhere.
>>>
>>> Now I've got:
>>>
>>> ec2_config:
>>>   instance:
>>>   m1.small:
>>> pvdisks:
>>> - /dev/xvdb1
>>> swapvol_size: 2G
>>> logvol_size: 64G
>>>   m1.medium:
>>> pvdisks:
>>> - /dev/xvdb1
>>> swapvol_size: 2G
>>> logvol_size: 64G
>>>   m1.large:
>>> pvdisks:
>>> - /dev/xvdb1
>>> - /dev/xvdc1
>>> swapvol_size: 4G
>>> logvol_size: 64G
>>>
>>> and I've tried to access the data every witch way.
>>>
>>> This gives me a syntax error...
>>> $pvdisks = 
>>> hiera_array(ec2_config['instance'][$::ec2_instance_type]['pvdisks'])
>>>
>>> and this:
>>> $pvdisks = 
>>> hiera_array($ec2_config['instance'][$::ec2_instance_type]['pvdisks'])
>>>
>>> gives me:
>>> err: Could not retrieve catalog from remote server: Error 400 on
>>> SERVER: ec2_config is not an hash or array when accessing it with
>>> instance at /truth/sauce/env/prod/modules/role/manifests/base_server.pp:27
>>> on node gfs01.us1.xxx.com
>>>
>>> Ugh.
>>>
>>> Doug.
>>
>> Actually, apparently, no, that's not what these functions are for. :(
>>
>> Doug.
>
> :(

Apparently this is difficult and/or not supported...

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] puppet kick not working against windows service

2012-08-22 Thread Josh Cooper
Hi Matt,

I'm not sure what the issue is. I recommend posting to the
mcollective-users list.

On Wed, Aug 22, 2012 at 10:56 AM, Matt F  wrote:
> Here's the mcollective.log from the client:
> D, [2012-08-22T13:54:28.907044 #3224] DEBUG -- : runnerstats.rb Incrementing
> total stat
> D, [2012-08-22T13:54:28.907044 #3224] DEBUG -- : pluginmanager.rb Returning
> cached plugin security_plugin with class MCollective::Security::Psk
> D, [2012-08-22T13:54:28.907044 #3224] DEBUG -- : runnerstats.rb Incrementing
> validated stat
> D, [2012-08-22T13:54:28.907044 #3224] DEBUG -- : pluginmanager.rb Returning
> cached plugin security_plugin with class MCollective::Security::Psk
> D, [2012-08-22T13:54:28.907044 #3224] DEBUG -- : pluginmanager.rb Returning
> cached plugin security_plugin with class MCollective::Security::Psk
> D, [2012-08-22T13:54:28.907044 #3224] DEBUG -- : base.rb Passing based on
> agent puppetd
> D, [2012-08-22T13:54:28.907044 #3224] DEBUG -- : base.rb Passing based on
> identity
> D, [2012-08-22T13:54:28.907044 #3224] DEBUG -- : base.rb Message passed the
> filter checks
> D, [2012-08-22T13:54:28.907044 #3224] DEBUG -- : runnerstats.rb Incrementing
> passed stat
> D, [2012-08-22T13:54:28.907044 #3224] DEBUG -- : runner.rb Handling message
> for agent 'puppetd' on collective 'mcollective'
> D, [2012-08-22T13:54:28.907044 #3224] DEBUG -- : agents.rb Dispatching a
> message to agent puppetd
> D, [2012-08-22T13:54:28.907044 #3224] DEBUG -- : stomp.rb Waiting for a
> message from Stomp
> D, [2012-08-22T13:54:28.907044 #3224] DEBUG -- : pluginmanager.rb Returning
> new plugin puppetd_agent with class MCollective::Agent::Puppetd
> D, [2012-08-22T13:54:28.907044 #3224] DEBUG -- : ddl.rb Found puppetd ddl at
> C:\mcollective\plugins/mcollective/agent/puppetd.ddl
> D, [2012-08-22T13:54:28.953920 #3224] DEBUG -- : pluginmanager.rb Returning
> cached plugin security_plugin with class MCollective::Security::Psk
> D, [2012-08-22T13:54:28.953920 #3224] DEBUG -- : pluginmanager.rb Returning
> cached plugin security_plugin with class MCollective::Security::Psk
> D, [2012-08-22T13:54:28.953920 #3224] DEBUG -- : base.rb Encoded a message
> for request 7edf85764752fbda37ea8b8efbfedf70
> D, [2012-08-22T13:54:28.953920 #3224] DEBUG -- : pluginmanager.rb Returning
> cached plugin connector_plugin with class MCollective::Connector::Stomp
> D, [2012-08-22T13:54:28.953920 #3224] DEBUG -- : stomp.rb Sending a
> broadcast message to STOMP target '/topic/mcollective.puppetd.reply'
> D, [2012-08-22T13:54:28.953920 #3224] DEBUG -- : runnerstats.rb Incrementing
> replies stat
>
>
>
> --
> 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/-/OPzKMQxoWr4J.
>
> To post to this group, send email to puppet-users@googlegroups.com.
> To unsubscribe from this group, send email to
> puppet-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/puppet-users?hl=en.

Josh

-- 
Josh Cooper
Developer, Puppet Labs

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] package handling in puppet?

2012-08-22 Thread Tim Mooney

In regard to: Re: [Puppet Users] package handling in puppet?, lamour said...:


Another, less gross, way to do it is to do something like this:




  if !defined(Package['perl']) {
 package { 'perl':
ensure => installed,
 }
  }


I would instead do something more like

   file { 'your-unpackaged-perl-script-here.pl':
 ensure  => file,
 owner   => 'whomever',
 group   => 'ditto',
 mode=> '0whatever-whatever-whatever',
 require => Package['perl'],
 source  => 'puppet:///module_name/script-source-here.pl',
   }



So, I guess I don't understand this.  Does this require not cause a
collision?


The answer is, "it depends".  I didn't include everything I should have
in that example, because you *still* need to have a

package { 'perl': }

somewhere *and* that needs to be either included from some other class
or it needs to be established in the same manifest.


 Does this require cause the resource to become defined?


No it does not, that still has to happen elsewhere.


 Can
you require more than one package?


Yes, and you can have multiple different resources that require the
same resource, e.g.

  package { 'cricket':
ensure  => installed,
require => [
  Yumrepo['ndsu'],
  Package['httpd', 'pmacct'],
  User['cricket'],
],
  }

  package { 'flow-utils':
ensure  => installed,
require => [
  User['cricket'],
  Mount['/var/netflow'],
],
  }


 I'll have to go read the documentation
to learn more about what this does, even though I don't think this helps
me, because I can't see how I could realistically tie all of my package
definitions to files.


My example was really meant for the case where you have one-off scripts
that are *not* installed via the OS package management system.  As I said
before, you generally want to let the OS package management system handle
the dependencies as much as possible.

One more thing: if you search the archives, I think you'll find that
although "defined()" has its uses, it seems like the general feeling is
that it's somewhat overused, and used in cases where it really was not
intended.  Your use of defined() might be perfect, but I just tend to shy
away from defined(), probably because my knowledge of puppet doesn't make
me certain that I would use it in the appropriate cases.


Thanks for all of your advice.  It's nice to get a bit of perspective from
people who are already using puppet in the wild.


I'm hoping that other more experienced puppet users will weigh in on this
too, as I certainly am not expert enough yet to have all the answers for
this particular area.

Tim
--
Tim Mooney tim.moo...@ndsu.edu
Enterprise Computing & Infrastructure  701-231-1076 (Voice)
Room 242-J6, IACC Building 701-231-8541 (Fax)
North Dakota State University, Fargo, ND 58105-5164

--
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] Hiera, OSSEC and per-node stuff?

2012-08-22 Thread Jakov Sosic

Hi.

I have an interesting use case.

OSSEC is security tool based on server-client architecture. Server 
generates keys for agents, and every agent has different key.


Now I want to distribute these keys via puppet. I've come accross hiera 
and installed it, and it works superbly, but how to store per-node key 
in hiera?


This is my idea:

hiera,yaml:
---
:hierarchy:
- ossec/%{hostname}
- %{operatingsystem}
- common
:backends:
- yaml
:yaml:
:datadir: '/etc/puppet/hieradata'


And now in /etc/puppet/hieradata/ossec I have a bunch of hostname.yaml 
files, and all of them has something like this:


---
ossec_client_key: 'blablabla'
ossec_id: '2031'



Is this the right approach? It sure works :)



--
Jakov Sosic
www.srce.unizg.hr

--
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] facter issues

2012-08-22 Thread llowder
I've got facter 1.6.4 + puppet 2.7.14 on an Ubuntu 10.04 (LTS, 64bit) 
machine.

This is my puppet master.

When I run puppet agent on this machine, I am getting some weird behavior.  
Namely, fact based variables are all showing up as empty strings.

When I run facter -p I see all the facts I expect to see, but when I have 
the following code in a class:

notify{"Testing the os is: '${::operatingsystem}'":} 

during a run I get:
notice: Testing the os is: ''

On other nodes (and what I expect to see on my master) I get:
notice: Testing the os is: 'Ubuntu'

Any ideas?

-- 
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/-/H9_GQyvK0XgJ.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Re: Hiera unable to retrieve the value

2012-08-22 Thread Evan Stachowiak
I'm running into the same issue on Ubuntu 10.04, hiera 0.3.0, puppet 
2.7.18, ruby187.

Hiera can lookup values, but only if there is no variable interpolation in 
/etc/puppet/hiera.yaml.

:hierarchy:
- '%{operatingsystem}'
- common

will give this error:
err: Could not retrieve catalog from remote server: Error 400 on SERVER: 
can't convert nil into String

while

:hierarchy:
- common

works without any errors.

I also ran into this trying to setup hiera to use different hieradata 
directories based on environment.

:yaml:
- '/etc/puppet/environments/production/hieradata'

works properly.

:yaml:
- 'etc/puppet/environments/%{environment}/hieradata'

will give the same error:
err: Could not retrieve catalog from remote server: Error 400 on SERVER: 
can't convert nil into String

Thanks,
Evan


On Friday, August 17, 2012 6:52:38 AM UTC-4, linuxbsdfreak wrote:
>
> Hi,
>
> I figured that out and did the changes to verify. However it doesn't parse 
> the hierarchy to override the values. I did a quick test to only use the 
> operatingsystem fact in hierarchy.  It doesnt pickup the value from it 
> also. Even though the machine is CentOS.  I dont know if  hiera 0.3.0 works 
> with ruby1.9.3
>
> Regards,
> Kevin
>
>
> On Friday, August 17, 2012 12:13:37 PM UTC+2, denmat wrote:
>>
>> Sorry, your hiera config points to:
>>-'%{operatingsystem}'
>>   - '%{platform}/%{location}/%{role}
>>   - common role
>>
>> But the facts you have are:
>> company_role
>> company_platform
>> company_location
>>
>> So unless you have facts platform, location, and role defined they aren't 
>> going to match up. It's like the facts you've used below:
>>
>> hiera -c /etc/puppet/hiera.yaml hsflowd_port platform=production  
>> location=frankfurt role=dev_tst
>>
>> So role = dev_tst does not equal custom_role = dev_tst 
>>
>> -- you get what I mean?
>>
>> Something like this might work:
>>   -'%{operatingsystem}'
>>   - %{custom_platform}/%{custom_location}/%{custom_role}
>>   - '%{platform}/%{location}/%{role}'
>>
>> See if that works,
>> Den
>> On 17 Aug 2012 19:31, "linuxbsdfreak"  wrote:
>>
>>> Just for info i am running ruby-1.9.3p194.
>>>
>>>
>>> On Friday, August 17, 2012 9:28:13 AM UTC+2, linuxbsdfreak wrote:

 Hi,

 The default value works when i set the value in common.yaml. Strange 
 part is why isnt hiera find the value in the hierarchy, since i want to 
 override the default value according to a facter fact.

 Regards,
 Kevin

 On Friday, August 17, 2012 2:57:03 AM UTC+2, denmat wrote:
>
> Hi, 
>
> Can't see anything that stands out in the quick glance, but here's how 
> you can dig further:
>
> Use --debug on your puppet run and you'll get an output of what hiera 
> is going through. Second, use notify to print out the variables you are 
> trying to access, making sure they match with what hiera is looking for 
> and 
> what you expect. You can also try setting the default for the 
> hsflowd_port 
> and see if that solves your problems or there are others (not saying you 
> should only use the default, just to further your own investigations).
>
>   $hsflowd_port  = hiera('hsflowd_port', '8080'),
>
>   
>
> HTH,
> Den
>
> On 17/08/2012, at 1:38, linuxbsdfreak  wrote:
>
> Typo error location=frankfurt is actually location=london.
>
> On Thursday, August 16, 2012 5:25:17 PM UTC+2, linuxbsdfreak wrote:
>>
>> Hi All,
>>
>> I am using hiera for storing configuration values. I have setup 
>> puppet to use facter following the article from 
>>
>> http://nuknad.com/2011/02/11/**s**elf-classifying-puppet-nodes/
>>
>> I have custom facts 
>>
>> company_role
>> company_platform
>> company_location
>>
>> I have defined the following in hiera.yaml
>>
>> ---
>> :backends: 
>>  - yaml
>>
>> :logger: console
>>
>> :hierarchy:
>>   - '%{operatingsystem}'
>>   - '%{platform}/%{location}/%{**rol**e}'
>>   - common
>>
>> :yaml:
>> :datadir: '/etc/puppet/hieradata'
>>
>>
>> and i create the directories /etc/puppet/hieradata/**producti**
>> on/london/dev_tst.yaml
>>
>> I have something like this in the above file
>>
>> ---
>>
>> hsflowd_port: 8080
>>
>> company_role: dev_tst
>> company_platform: production
>> company_location: london
>>
>> Given a system with the above facts connecting to puppetmaster. When 
>> i run the client i get the following error
>>
>> Err: Could not retrieve catalog from remote server: Error 400 on 
>> SERVER: Could not find data item hsflowd_port in any Hiera data file and 
>> no 
>> default supplied at /etc/puppet/modules/hs

Re: [Puppet Users] package handling in puppet?

2012-08-22 Thread lamour


On Tuesday, August 21, 2012 6:25:53 PM UTC-4, Tim Mooney wrote:
>
> In regard to: [Puppet Users] package handling in puppet?, lamour said 
> (at...: 
>
> > so, I've got most of the pieces worked out, but I've hit a major 
> roadblock 
> > with the way packages are handled in puppet.  (according to my limited 
> > understanding of puppet, that is)  The problem starts with the fact that 
> > including the following in two different classes: 
> > 
> >   package { 'perl': ensure => installed } 
>
> There are several ways to deal with this. 
>
> I know perl is probably a general example of the problem, but at least 
> in that case, it's fairly rare that you need to specify the interpreter 
> directly.  If you're making good use of packages, what you probably 
> instead want is something like 
>
>package { 'perl-Net-SMTP-SSL': 
>  ensure  => installed, 
>  require => Yumrepo['your-local-repo-name-or-maybe-epel'], 
>} 
>
>
Yeah, that's what we're planning on doing, but that only gets you so far. 
 The real issue with all of this is that I don't want the act of someone 
adding a package into a class somewhere to cause puppet to fail due to an 
unexpected collision.  If I want to avoid that, I need to use some syntax 
that doesn't flag conflicts where they don't actually exist.  For instance, 
I might require perl-DBI in, say, the samba class and the apache class (for 
whatever reason).  There's not really a problem with that unless I need 
both of those classes on the same server.  This leaves me with two choices, 
allow the errors to happen and fix them as they pop up or just pre-wrap 
every package in a class to avoid the problem altogether.  Both choices 
make me sad.  lol

 

> > This is pretty unfortunate, but we can try to work around it by doing 
> this: 
> > 
> >   package { 'test-perl': ensure => installed, alias => 'perl' } 
>
> *Definitely* do not do this.  There might be other places where this 
> kind of chicanery is appropriate, but it's not a good idea here. 
>
>  
Ok.  lol.  I probably wouldn't have implemented it this way anyway, but it 
was the first work-around that I thought of when we ran into the problem.

 

> > Another, less gross, way to do it is to do something like this: 
>
> 
> >   if !defined(Package['perl']) { 
> >  package { 'perl': 
> > ensure => installed, 
> >  } 
> >   } 
>
> I would instead do something more like 
>
>file { 'your-unpackaged-perl-script-here.pl': 
>  ensure  => file, 
>  owner   => 'whomever', 
>  group   => 'ditto', 
>  mode=> '0whatever-whatever-whatever', 
>  require => Package['perl'], 
>  source  => 'puppet:///module_name/script-source-here.pl', 
>} 
>
>
So, I guess I don't understand this.  Does this require not cause a 
collision?  Does this require cause the resource to become defined?  Can 
you require more than one package?  I'll have to go read the documentation 
to learn more about what this does, even though I don't think this helps 
me, because I can't see how I could realistically tie all of my package 
definitions to files.

 

> > We also stumbled across the Singleton puppet module, which does almost 
> kind 
> > of exactly what we want, except it has a dependency on hiera. We haven't 
> > really decided whether to use hiera or not.  Efforts to rip the hiera 
> > dependencies out of Singleton and also getting it to run even with hiera 
> > installed have both failed.  I'll probably keep looking into modifying 
> the 
> > ruby code to behave in some useful manner for us, but for now, I'm 
> running 
> > out of good options. 
>
> Don't rip out hiera, it will be part of puppet 3.x.  I'm not familiar with 
> the Singleton module, but I wouldn't think you would need to resort to 
> external modules for something that's pretty fundamental to the problem 
> domain. 
>
>
Yeah, looking at the documentation again, it seems like I misunderstood how 
Singleton works.  It seems like the configuration for the Singleton package 
is even more involved than the other options we've discussed here, which 
kinda defeats the purpose.  I think I could probably figure out a way to 
make a function to do what I want, but I'm going to save it for when I get 
a little more comfortable with ruby.  lol


Thanks for all of your advice.  It's nice to get a bit of perspective from 
people who are already using puppet in the wild.


thanks,
Michael

-- 
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/-/XzuE9r4bn_oJ.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Best way to bail from facter script without using confine in Facter.add ?

2012-08-22 Thread Nigel Kersten
On Wed, Aug 22, 2012 at 11:13 AM, ZJE  wrote:
> The slowdown comes from the command that I run before any Facter.add
> statements. It takes roughly 1.5 seconds to run and I would need to run it
> roughly 64 times if I had it in each Facter.add. Many facts are generated by
> a loop that contains a Facter.add, so I feel like some sort of exception
> would make things easier.  I'd like to avoid using a "giant if statement" if
> possible (there are roughly 100 lines of code that would be encapsulated).
> One of the main issues I have is that there are two different checks that
> happen in different parts of the code. I recognize that some may consider
> adding more if-statements as increased readability, but I feel like the
> added indentation for large chunks of code causes confusion for readers
> (especially when looking at loops).
>
> Thanks so much for your reply!

You should be able to do something like this, which worked for the
quick test I did, but I haven't extensively tested it.

arr = ["one", "two", "three", "four"]

if true then
  # exit due to conditions for not running on this host
  exit
else
  # run the command you'd run and store in an instance variable
end

arr.each do |e|
  Facter.add("tester_#{e}") do
setcode do
  "bleah"
end
  end
end






>
> On Wednesday, August 22, 2012 11:36:13 AM UTC-5, Nigel Kersten wrote:
>>
>> On Wed, Aug 22, 2012 at 8:49 AM, ZJE  wrote:
>> > I have a script in $FACTERLIB that queries proprietary vendor tools for
>> > RAID
>> > configuration. These tools are quite slow, so the top of my .rb file
>> > calls
>> > the program once and stores the output in a variable. Multiple
>> > Facter.add
>> > statements then populate the facts. I would like to bail on this custom
>> > fact
>> > script if it's being run on a VM or unsupported host. I don't think
>> > "confine" would work here since I have multiple Facter.add and I would
>> > ideally like to bail before it gets to any of them. If I try "exit,"
>> > facter
>> > just exists and no other facts are collected. Looking at the code in
>> > facter/util/loader.rb, I could throw a ScriptError exception - but that
>> > seems hackish.
>> >
>> > Anyone have experience or suggestions for doing something similar? I've
>> > tried searching existing code with no luck.
>>
>> You can surround the Facter.add calls with explicit checks like:
>>
>> if Facter.value(:kernel) == "Darwin"
>>   Facter::Util::Macosx.hardware_overview.each do |fact, value|
>> Facter.add("sp_#{fact}") do
>>   confine :kernel => :darwin
>>   setcode do
>> value.to_s
>>   end
>> end
>>   end
>> end
>>
>> (Yes, that confine there is somewhat redundant...)
>>
>> Are you really seeing a significant slowdown though if you don't do
>> this and simply have the confine call within each Facter.add ? If so,
>> we should work on that.
>
> --
> 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/-/K5Mm3du3mkQJ.
>
> To post to this group, send email to puppet-users@googlegroups.com.
> To unsubscribe from this group, send email to
> puppet-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/puppet-users?hl=en.



-- 
Nigel Kersten | http://puppetlabs.com | @nigelkersten
Schedule Meetings at: http://tungle.me/nigelkersten

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Best way to bail from facter script without using confine in Facter.add ?

2012-08-22 Thread ZJE
The slowdown comes from the command that I run before any Facter.add 
statements. It takes roughly 1.5 seconds to run and I would need to run it 
roughly 64 times if I had it in each Facter.add. Many facts are generated 
by a loop that contains a Facter.add, so I feel like some sort of exception 
would make things easier.  I'd like to avoid using a "giant if statement" 
if possible (there are roughly 100 lines of code that would be 
encapsulated). One of the main issues I have is that there are two 
different checks that happen in different parts of the code. I recognize 
that some may consider adding more if-statements as increased readability, 
but I feel like the added indentation for large chunks of code causes 
confusion for readers (especially when looking at loops).

Thanks so much for your reply!

On Wednesday, August 22, 2012 11:36:13 AM UTC-5, Nigel Kersten wrote:
>
> On Wed, Aug 22, 2012 at 8:49 AM, ZJE > 
> wrote: 
> > I have a script in $FACTERLIB that queries proprietary vendor tools for 
> RAID 
> > configuration. These tools are quite slow, so the top of my .rb file 
> calls 
> > the program once and stores the output in a variable. Multiple 
> Facter.add 
> > statements then populate the facts. I would like to bail on this custom 
> fact 
> > script if it's being run on a VM or unsupported host. I don't think 
> > "confine" would work here since I have multiple Facter.add and I would 
> > ideally like to bail before it gets to any of them. If I try "exit," 
> facter 
> > just exists and no other facts are collected. Looking at the code in 
> > facter/util/loader.rb, I could throw a ScriptError exception - but that 
> > seems hackish. 
> > 
> > Anyone have experience or suggestions for doing something similar? I've 
> > tried searching existing code with no luck. 
>
> You can surround the Facter.add calls with explicit checks like: 
>
> if Facter.value(:kernel) == "Darwin" 
>   Facter::Util::Macosx.hardware_overview.each do |fact, value| 
> Facter.add("sp_#{fact}") do 
>   confine :kernel => :darwin 
>   setcode do 
> value.to_s 
>   end 
> end 
>   end 
> end 
>
> (Yes, that confine there is somewhat redundant...) 
>
> Are you really seeing a significant slowdown though if you don't do 
> this and simply have the confine call within each Facter.add ? If so, 
> we should work on that. 
>

-- 
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/-/K5Mm3du3mkQJ.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Hiera to hash

2012-08-22 Thread Douglas Garstang
On Tue, Aug 21, 2012 at 11:51 PM, Douglas Garstang
 wrote:
> On Tue, Aug 21, 2012 at 11:44 PM, Douglas Garstang
>  wrote:
>> On Tue, Aug 21, 2012 at 11:19 PM, Stephen Gran
>>  wrote:
>>> Hi,
>>>
>>> On Tue, 2012-08-21 at 21:00 -0700, Douglas Garstang wrote:
 I know I did this once before but can't find docs on how to do it again.

 I have this in a yaml file:

 pvdisks:
 ec2_pvdisks_m1.small:
 disks: /dev/xvdb1
 enabled: yes

 Loading it with hiera.

 Manifest has:

 $testkey = hiera('pvdisks')
 notice ("TESTKEY=$testkey[ec2_pvdisks_m1.small]")

 This is printing
 TESTKEY=ec2_pvdisks_m1.smalldisks/dev/xvdb1enabledtrue['ec2_pvdisks_m1.small']
>>>
>>> Try inspecting it some other way than printf debugging - notice always
>>> flattens variables by calling .to_s on them, so it is not a very useful
>>> tool.  I am assuming that things are indeed fine, but this is confusing
>>> matters.
>>
>> I've since learned that I have to use hiera_array and hiera_hash,
>> which aren't documented anywhere.
>>
>> Now I've got:
>>
>> ec2_config:
>>   instance:
>>   m1.small:
>> pvdisks:
>> - /dev/xvdb1
>> swapvol_size: 2G
>> logvol_size: 64G
>>   m1.medium:
>> pvdisks:
>> - /dev/xvdb1
>> swapvol_size: 2G
>> logvol_size: 64G
>>   m1.large:
>> pvdisks:
>> - /dev/xvdb1
>> - /dev/xvdc1
>> swapvol_size: 4G
>> logvol_size: 64G
>>
>> and I've tried to access the data every witch way.
>>
>> This gives me a syntax error...
>> $pvdisks = 
>> hiera_array(ec2_config['instance'][$::ec2_instance_type]['pvdisks'])
>>
>> and this:
>> $pvdisks = 
>> hiera_array($ec2_config['instance'][$::ec2_instance_type]['pvdisks'])
>>
>> gives me:
>> err: Could not retrieve catalog from remote server: Error 400 on
>> SERVER: ec2_config is not an hash or array when accessing it with
>> instance at /truth/sauce/env/prod/modules/role/manifests/base_server.pp:27
>> on node gfs01.us1.xxx.com
>>
>> Ugh.
>>
>> Doug.
>
> Actually, apparently, no, that's not what these functions are for. :(
>
> 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 group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] puppet kick not working against windows service

2012-08-22 Thread Matt F
Here's the mcollective.log from the client:
D, [2012-08-22T13:54:28.907044 #3224] DEBUG -- : runnerstats.rb 
Incrementing total stat
D, [2012-08-22T13:54:28.907044 #3224] DEBUG -- : pluginmanager.rb Returning 
cached plugin security_plugin with class MCollective::Security::Psk
D, [2012-08-22T13:54:28.907044 #3224] DEBUG -- : runnerstats.rb 
Incrementing validated stat
D, [2012-08-22T13:54:28.907044 #3224] DEBUG -- : pluginmanager.rb Returning 
cached plugin security_plugin with class MCollective::Security::Psk
D, [2012-08-22T13:54:28.907044 #3224] DEBUG -- : pluginmanager.rb Returning 
cached plugin security_plugin with class MCollective::Security::Psk
D, [2012-08-22T13:54:28.907044 #3224] DEBUG -- : base.rb Passing based on 
agent puppetd
D, [2012-08-22T13:54:28.907044 #3224] DEBUG -- : base.rb Passing based on 
identity
D, [2012-08-22T13:54:28.907044 #3224] DEBUG -- : base.rb Message passed the 
filter checks
D, [2012-08-22T13:54:28.907044 #3224] DEBUG -- : runnerstats.rb 
Incrementing passed stat
D, [2012-08-22T13:54:28.907044 #3224] DEBUG -- : runner.rb Handling message 
for agent 'puppetd' on collective 'mcollective'
D, [2012-08-22T13:54:28.907044 #3224] DEBUG -- : agents.rb Dispatching a 
message to agent puppetd
D, [2012-08-22T13:54:28.907044 #3224] DEBUG -- : stomp.rb Waiting for a 
message from Stomp
D, [2012-08-22T13:54:28.907044 #3224] DEBUG -- : pluginmanager.rb Returning 
new plugin puppetd_agent with class MCollective::Agent::Puppetd
D, [2012-08-22T13:54:28.907044 #3224] DEBUG -- : ddl.rb Found puppetd ddl 
at C:\mcollective\plugins/mcollective/agent/puppetd.ddl
D, [2012-08-22T13:54:28.953920 #3224] DEBUG -- : pluginmanager.rb Returning 
cached plugin security_plugin with class MCollective::Security::Psk
D, [2012-08-22T13:54:28.953920 #3224] DEBUG -- : pluginmanager.rb Returning 
cached plugin security_plugin with class MCollective::Security::Psk
D, [2012-08-22T13:54:28.953920 #3224] DEBUG -- : base.rb Encoded a message 
for request 7edf85764752fbda37ea8b8efbfedf70
D, [2012-08-22T13:54:28.953920 #3224] DEBUG -- : pluginmanager.rb Returning 
cached plugin connector_plugin with class MCollective::Connector::Stomp
D, [2012-08-22T13:54:28.953920 #3224] DEBUG -- : stomp.rb Sending a 
broadcast message to STOMP target '/topic/mcollective.puppetd.reply'
D, [2012-08-22T13:54:28.953920 #3224] DEBUG -- : runnerstats.rb 
Incrementing replies stat



-- 
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/-/OPzKMQxoWr4J.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Duplicate definition : Merging arrays

2012-08-22 Thread iamauser
Thanks very much to both of you. Very helpful.

-Tapas


On Wednesday, August 22, 2012 7:44:25 PM UTC+2, Nick Fagerlund wrote:
>
> Whoops, collision! Reassuring that we both did the same thing though. :)
>

-- 
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/-/uSLj0nc2fREJ.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Duplicate definition : Merging arrays

2012-08-22 Thread Nick Fagerlund
Whoops, collision! Reassuring that we both did the same thing though. :)

-- 
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/-/IsnRDusKXDoJ.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Duplicate definition : Merging arrays

2012-08-22 Thread Nick Fagerlund
You can see inline docs for every stdlib function by reading the code: 

https://github.com/puppetlabs/puppetlabs-stdlib/tree/master/lib/puppet/parser/functions

Install the module with:

$ sudo puppet module install puppetlabs-stdlib

And probably use unique and flatten to do what you're trying to do. Like 
this.

$server = unique( flatten( [$sys_server, $usr_server] ) )

On Wednesday, August 22, 2012 10:29:27 AM UTC-7, iamauser wrote:
>
> Any example, for this case ? I didn't find any on the web...
>
> thanks
>
>
> Use the unique and join function from stdlib. 
>>
>> 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/-/8wnGyx85eiIJ.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Duplicate definition : Merging arrays

2012-08-22 Thread Nan Liu
On Wed, Aug 22, 2012 at 10:29 AM, iamauser  wrote:
> Any example, for this case ? I didn't find any on the web...
>
> thanks

Bleh, join is string only. unique will remove any duplicates:

$sys_server = [ ginger , test0 ]
$usr_server = [ test0, test1, test2 ]

$all = [$sys_server, $usr_server]

$server = unique(flatten($all))

notify { $server: }

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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] Re: newish puppet on RHEL4 and/or SLES9?

2012-08-22 Thread Nick Fagerlund
The advice above is generally pretty good -- for best results build your 
own Ruby packages, etc. etc. 

One thing I can add: Given that even RHEL 5 has a pretty ancient Ruby, you 
might want to run puppet agent via cron jobs (with --splay) instead of as a 
daemon. The daemon is generally okay on Ruby 1.8.7 with a modern patch 
number, but 1.8.5 leaks memory like a sieve with long-running processes. 

('Puppet resource' code for creating the cron jobs is the second example in 
this section: http://docs.puppetlabs.com/guides/installation.html#with-cron)

-- 
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/-/Q0h1Oq5ZcowJ.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Duplicate definition : Merging arrays

2012-08-22 Thread iamauser
Any example, for this case ? I didn't find any on the web...

thanks


Use the unique and join function from stdlib. 
>
> 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/-/104tOgE4b9wJ.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] Re: how to connect agent to the master through a different user to execute a command through puppet module

2012-08-22 Thread Nick Fagerlund
I don't understand what you're doing. But it sounds like you might need the 
"user" attribute of the exec type? 

exec {'some command':
  user => 'admin',
}

See http://docs.puppetlabs.com/references/latest/type.html#exec and scroll 
down a bit. 

On Wednesday, August 22, 2012 2:50:28 AM UTC-7, Prosenjit Ghosh wrote:
>
> Created a puppet master in one Linux.X64/rh50 machine.
> Created a puppet agent in another Linux.X64/rh50 machine.
>
> Need to run any command from puppet master and that will execute in puppet 
> agent when puppet agent will connect to puppet master.
>
> This is happening correctly for me when created master and agent through 
> root user.
>
> But I need to execute a command that wont allow root user. I need any user 
> except root. I tried successfully to create puppet master through a 
> different user. But not able to execute the command when connecting the 
> agent through that different user.
>
> Any suggestion on this how to connect agent to the master through a 
> different user to execute a command through puppet module
>
>

-- 
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/-/Y2EWm3dKGIUJ.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] package handling in puppet?

2012-08-22 Thread lamour


On Tuesday, August 21, 2012 3:57:43 PM UTC-4, Ramin K wrote:
>
>
> What happens when you have two or more statements about the same 
> resource in conflict? 
>
>   package { 'mysql': ensure => installed, } 
>   package { 'mysql': ensure => 5.0.92, } 
>   package { 'mysql': ensure => latest, } 
>
 
Ok, I think this is my issue.  To me, "installed" doesn't sound like it 
should conflict with the other two at all.  It sounds like "hey, I don't 
care which version of mysql you have, as long as you have one. If 
not...let's fix that now."  But that's not what it means.  If it did, then 
puppet wouldn't need to flag it as a collision if I wrote this:

  package { 'mysql': ensure => installed, } 
  package { 'mysql': ensure => installed, } 
  package { 'mysql': ensure => installed, } 

Puppet would be able to say "check if it's installed.  yep, we're checking 
if it's installed.  yep, we're checking if it's installed."

And, if you think about it, this wouldn't even be a problem (logically 
speaking):

  package { 'mysql': ensure => installed, } 
  package { 'mysql': ensure => 5.0.92, } 
  package { 'mysql': ensure => installed, } 

But I just need to let that go, since puppet doesn't work that way.  lol


Anyway, we've decided to go with the !Defined syntax I suggested in my 
original post for now until we find a better solution, since that syntax 
actual means what we mean, and doesn't require external logistics.  We'll 
revisit this decision after we've gotten more classes implemented and 
evaluate the relative benefits of the other available solutions at the 
time.  This will at least allow us to move forward and get other things 
working.


Therefore you need to specify it once. You can do this a few different 
> ways. 
>
>  
[examples for virtual resources and classes deleted]

So, my basic issue with both the class method and the virtual resources 
method is that they basically require me to maintain a SECOND list of every 
package I want to maintain this way (either class or virtual resource 
definitions).  This seems like a lot of syntactic and logistical overhead, 
especially when you consider that if we ignore the possibility of 
collisions, we can just do this:

package { ['perl', 'mysql', 'gcc', 'screen', 'foo', 'bar', 'baz']:
ensure => installed
}

This is clean, concise, and trivial to understand.  This is kind of what I 
was hoping for.  I understand that we'll probably have to use the class 
method for any packages where ACTUAL conflicts exist (e.g., the version 
example you gave above), but for virtually all of our packages, we're not 
going to have that problem.


Thanks a lot for your feedback.  It was good to have simple examples of all 
the options in one place.


thanks,
Michael

-- 
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/-/s22Y28jjDlsJ.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Duplicate definition : Merging arrays

2012-08-22 Thread Nan Liu
On Wed, Aug 22, 2012 at 6:56 AM, iamauser  wrote:
> Hello,
>
> I am trying to create a new array by combining two other arrays. I get the
> following error while running :
>
> Duplicate definition: Print[test0] is already defined in file
> /etc/puppet/manifests/test.pp at line 47; cannot redefine at
> /etc/puppet/manifests/test.pp:47
>
> My code is similar to this :
> 
> .
> .
> $sys_server =   [ ginger , test0 ]
> $usr_server  =  [ test0, test1, test2 ]
>
> $server = split(inline_template("<%= (sys_server+usr_server).join(',')
> %>"),',')
> .
> .
> 
>
> This way clearly not working. Is there a tweak somewhere to remove the
> duplicates while joining the arrays ? or is there any other way to join two
> arrays to create another one ?

Use the unique and join function from stdlib.

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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Best way to bail from facter script without using confine in Facter.add ?

2012-08-22 Thread Nigel Kersten
On Wed, Aug 22, 2012 at 8:49 AM, ZJE  wrote:
> I have a script in $FACTERLIB that queries proprietary vendor tools for RAID
> configuration. These tools are quite slow, so the top of my .rb file calls
> the program once and stores the output in a variable. Multiple Facter.add
> statements then populate the facts. I would like to bail on this custom fact
> script if it's being run on a VM or unsupported host. I don't think
> "confine" would work here since I have multiple Facter.add and I would
> ideally like to bail before it gets to any of them. If I try "exit," facter
> just exists and no other facts are collected. Looking at the code in
> facter/util/loader.rb, I could throw a ScriptError exception - but that
> seems hackish.
>
> Anyone have experience or suggestions for doing something similar? I've
> tried searching existing code with no luck.

You can surround the Facter.add calls with explicit checks like:

if Facter.value(:kernel) == "Darwin"
  Facter::Util::Macosx.hardware_overview.each do |fact, value|
Facter.add("sp_#{fact}") do
  confine :kernel => :darwin
  setcode do
value.to_s
  end
end
  end
end

(Yes, that confine there is somewhat redundant...)

Are you really seeing a significant slowdown though if you don't do
this and simply have the confine call within each Facter.add ? If so,
we should work on that.

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] puppet kick not working against windows service

2012-08-22 Thread Matt F
BTW: I'm seeing the following on the client, in the mcollective log - not 
sure if this is an issue:

D, [2012-08-22T12:15:14.761477 #3224] DEBUG -- : runnerstats.rb 
Incrementing total stat
D, [2012-08-22T12:15:14.761477 #3224] DEBUG -- : pluginmanager.rb Returning 
cached plugin security_plugin with class MCollective::Security::Psk
D, [2012-08-22T12:15:14.761477 #3224] DEBUG -- : runnerstats.rb 
Incrementing validated stat
D, [2012-08-22T12:15:14.761477 #3224] DEBUG -- : pluginmanager.rb Returning 
cached plugin security_plugin with class MCollective::Security::Psk
D, [2012-08-22T12:15:14.761477 #3224] DEBUG -- : pluginmanager.rb Returning 
cached plugin security_plugin with class MCollective::Security::Psk
D, [2012-08-22T12:15:14.761477 #3224] DEBUG -- : base.rb Failed based on 
identity
D, [2012-08-22T12:15:14.761477 #3224] DEBUG -- : base.rb Passing based on 
agent puppetd
D, [2012-08-22T12:15:14.761477 #3224] DEBUG -- : base.rb Message failed the 
filter checks
D, [2012-08-22T12:15:14.761477 #3224] DEBUG -- : runnerstats.rb 
Incrementing filtered stat
D, [2012-08-22T12:15:14.761477 #3224] DEBUG -- : runner.rb Message does not 
pass filters, ignoring
D, [2012-08-22T12:15:14.761477 #3224] DEBUG -- : stomp.rb Waiting for a 
message from Stomp

-- 
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/-/KQ9YbEBDx6kJ.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Scheduled_task + ad user

2012-08-22 Thread Jeff Sussna
The patch is working on XP but failing on Server 2003. Same domain/user on 
both. Can manually set the task to the user in question so I know it's a 
valid user/pw known to the 2003 machine.


On Tuesday, August 21, 2012 7:31:01 PM UTC-5, Josh Cooper wrote:
>
> Hi Jeff,
>
> It should be lib/puppet/util/adsi.rb
>
> Also please add yourself as a watcher to the ticket.
>
> Josh
>
> On Aug 21, 2012, at 3:18 PM, Jeff Sussna > 
> wrote:
>
> Stupid question: where is the source file for this hack?
>
> On Monday, July 2, 2012 11:19:46 PM UTC-5, fpommier wrote:
>>
>> Hi Josh,
>> Thank for your quick and good reply.
>> I remove "and LocalAccount = True' at line 56 and 58.
>> It now work perfectly.
>> Thanks again.
>> Fred
>>
>> Le lundi 2 juillet 2012 07:27:33 UTC-10, Josh Cooper a écrit :
>>>
>>> Hi,
>>>
>>> On Sat, Jun 30, 2012 at 4:30 PM, fpommier  wrote:
>>>
 Hi,
 When a want to  use scheduled_task for create a windows task and when i 
 give a AD user, i have this message :
 err: /Stage[main]/Mirnas/Scheduled_task[test]/ensure: change from 
 absent to present failed: Invalid user: DOMAIN\oper

 My user domain and the password are correct.
 I have the same error if i change DOMAIN\oper by op...@domain.comor 
 DOMAIN/oper
 With a local user,  is working, but i need a AD user for my batch to 
 work.
 Is it a bug , a limitation or i miss something ? 

>>> Thank for any help

scheduled_task { 'test':
ensure=> present,
enabled   => true,
command   => 'C:\test\test.bat',
  working_dir=> 'C:\test',
  user   => 'DOMAIN\oper',
  password   => 'x',
trigger => {
  schedule => daily,
  start_date   => '2012-06-26', # Defaults to 'today'
  start_time   => '09:05',  # Must be specified
}
 }

  -- 
 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/-/P1hXwgGE2CoJ.
 To post to this group, send email to puppet...@googlegroups.com.
 To unsubscribe from this group, send email to 
 puppet-users...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/puppet-users?hl=en.

>>>
>>> It is definitely a bug. I've filed this as 
>>> http://projects.puppetlabs.com/issues/15326. You can probably just 
>>> remove the `LocalAccount = True` condition from the WMI queries in 
>>> `Puppet::Util::ADSI#sid_for_account` at lines 56-58.
>>>
>>> Josh
>>>
>>> -- 
>>> Josh Cooper
>>> Developer, Puppet Labs
>>>
>>>   -- 
> 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/-/ily02pJOJqsJ.
> To post to this group, send email to puppet...@googlegroups.com
> .
> To unsubscribe from this group, send email to 
> puppet-users...@googlegroups.com .
> For more options, visit this group at 
> http://groups.google.com/group/puppet-users?hl=en.
>
>

-- 
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/-/JUCBZJUnzUQJ.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] puppet kick not working against windows service

2012-08-22 Thread Matt F
I've installed mcollective, and I can get data from the client (IE: "mco 
inventory mywindowsclient"). I've configured the puppetd agent plugin, and 
that shows up in the "mco inventory" output as well. However, I still 
cannot trigger puppet to update on the client. Any idea of what the cause 
might be, or what next steps I can take to debug this? thx.

-- 
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/-/-zWdW_J6mvQJ.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] Best way to bail from facter script without using confine in Facter.add ?

2012-08-22 Thread ZJE
I have a script in $FACTERLIB that queries proprietary vendor tools for 
RAID configuration. These tools are quite slow, so the top of my .rb file 
calls the program once and stores the output in a variable. Multiple 
Facter.add statements then populate the facts. I would like to bail on this 
custom fact script if it's being run on a VM or unsupported host. I don't 
think "confine" would work here since I have multiple Facter.add and I 
would ideally like to bail before it gets to any of them. If I try "exit," 
facter just exists and no other facts are collected. Looking at the code in 
facter/util/loader.rb, I could throw a ScriptError exception - but that 
seems hackish. 

Anyone have experience or suggestions for doing something similar? I've 
tried searching existing code with no luck.

-- 
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/-/oMqhWhsk0zYJ.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] Open Source Engineer with Puppet experience needed in Chicago, IL

2012-08-22 Thread J.D Jackson
 

Do you have a strong interest in Linux development and systems 
administration? Can you make the system run, but also have solid 
development skills you want to be able to use? Do you want to work on a 
team that is doing more than the average group of developers? Do you want 
to change the landscape of the Internet? There is only one place you’ll be 
able to achieve what you’re looking for, comScore.

comScore is seeking a seasoned, progressive thinking Systems Engineer to be 
a part of the team that is changing the way companies and individuals 
utilize the Internet. If you’ve developed software and want to use those 
skills for developing server based applications and automating systems 
administration, then you’ll understand what we’re looking for.

In this key position, you will be responsible for the design and 
development of server based Linux software systems for administrative and 
processing needs. The systems developed will be used to enhance the product 
offerings of comScore and will include new development.

*APPLY DIRECTLY AT: * 
https://performancemanager4.successfactors.com/sfcareer/jobreqcareer?jobId=6243&company=comScore&username=

 *Title:   Open Source Engineer*

* Location:  Chicago, IL 60606*

* Reports to:   VP, Open Source Engineering*

* Job ID:   6243*


*ESSENTIAL DUTIES AND RESPONSIBILITIES:*

   - Participate in the design and development of new systems to be 
   incorporated into the existing collection and processing environment
   - Develop enhancements to current solutions
   - Guide group strategy and create action plans and goals
   - Participate in ongoing research and evaluation of new related 
   technologies
   - Develop programs and systems to automate systems management
   - Participate in 24x7 on call schedule of production systems

*QUALIFICATIONS:*

   - Bachelor’s degree in Computer Science or related field
   - 2-3 years of experience in developing and supporting Linux server 
   based applications
   - 2-3 years of Linux systems administration experience
   - Ability to design and develop advanced solutions that process logged 
   data
   - Familiarity with different layers of OSI model
   - Knowledge of TCP/IP networks and IP routing
   - Experience with the development of Linux applications using C, C++, 
   Perl, Python, Ruby or Shell scripting
   - *Familiarity with Puppet Labs configuration management software a plus*
   - Experience with the Redhat Linux platform and creating RPMs a plus
   - Excellent oral, written and computer communication skills with strong 
   analytical and troubleshooting skills
   - The nature of the team’s dynamics will require an individual that is 
   able to work closely in a collaborative role with other team members
   - Able to manage day to day tasks while fielding interruptions
   - Self starter type of individual, willing to take on tasks and ask for 
   help only when needed

comScore, Inc. (NASDAQ: SCOR) is a global leader in measuring the digital 
world and preferred source of digital business analytics. comScore helps 
its clients better understand, leverage and profit from the rapidly 
evolving digital marketing landscape by providing data, analytics and 
on-demand software solutions for the measurement of online ads and 
audiences, media planning, website analytics, advertising effectiveness, 
copy-testing, social media, search, video, mobile, cross-media, e-commerce, 
and a broad variety of emerging forms of digital consumer behavior. 
comScore services, which now include the product suites of recent 
acquisitions AdXpose, Nedstat, Nexius XPlore, ARSGroup and Certifica, are 
used by more than 1,800 clients around the world, including global leaders 
such as AOL, Baidu, BBC, Best Buy, Carat, Deutsche Bank, ESPN, France 
Telecom, Financial Times, Fox, Microsoft, MediaCorp, Nestle, Starcom, Terra 
Networks, Universal McCann, Verizon Services Group, ViaMichelin and Yahoo!.

-- 
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/-/Fc_C7xv1kK4J.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] Duplicate definition : Merging arrays

2012-08-22 Thread iamauser
Hello,

I am trying to create a new array by combining two other arrays. I get the 
following error while running :

Duplicate definition: Print[test0] is already defined in file 
/etc/puppet/manifests/test.pp at line 47; cannot redefine at 
/etc/puppet/manifests/test.pp:47

My code is similar to this :

.
.
$sys_server =   [ ginger , test0 ]
$usr_server  =  [ test0, test1, test2 ]

$server = split(inline_template("<%= (sys_server+usr_server).join(',') 
%>"),',')
.
.


This way clearly not working. Is there a tweak somewhere to remove the 
duplicates while joining the arrays ? or is there any other way to join two 
arrays to create another one ?

Thanks very much.

-- 
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/-/RpAo82K-QiMJ.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Install rubygem package in order to use with library

2012-08-22 Thread Sergey V. Arlashin
> Where is rubix declared?


modules/zabbix/lib/puppet/type/zabbix_host.rb:

$LOAD_PATH.unshift File.join(File.dirname(__FILE__), 'rubix/lib')
require 'rubix'

require 'facter'

Puppet::Type.newtype(:zabbix_host) do
  @doc = "Manages zabbix hosts"

  self.debug "// Blah"

  ensurable

  newparam(:name) do
desc ""

isnamevar
  end

  newparam(:api_host) do
desc "Zabbix server API"

validate do |value|
  raise ArgumentError, "Void api_host parameter" if value.empty?
end

  end
...
...

> What's on line  83 of your init.pp? 

  zabbix_host { "${::fqdn}":
ensure   => present,
template => $zabbix_template,
group=> 'Linux servers',
api_host => $api_host,
require  => Package['librubix-puppet-ruby1.8']
  }




On Aug 22, 2012, at 1:07 AM, Denmat wrote:

> Hi 
> 
> See inline:
> 
> On 21/08/2012, at 23:14, "Sergey V. Arlashin"  wrote:
> 
>> Hello!
>> I have a custom function which requires a ruby gem which I have in my 
>> deb-repository.
>> If the package is installed beforehand manually the function works well. But 
>> if I want to install the package with puppet I get the following error:
>> 
>>  out: Could not autoload zabbix_host: no such file to load -- rubix at 
>> /etc/puppet/modules/zabbix/manifests/init.pp:83 on node
>> 
> Where is rubix declared? What's on line  83 of your init.pp? 
> 
>> the code looks like
>> 
>>   package { 'librubix-puppet-ruby1.8':
>> ensure=> installed
>>   }
>>   zabbix_host { "${::fqdn}":
>> ensure   => present,
>> require  => Package['librubix-puppet-ruby1.8']
>>   }
>> 
>> So it seems Puppet tries to execute zabbix_host before having the package 
>> librubix-puppet-ruby1.8 installed. 
>> Is it possible to get the package librubix-puppet-ruby1.8 installed before 
>> executing zabbix_host ?
>> 
>> Thank you.
>> 
>> 
>> 
>> -- 
>> 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/-/8b6QBCyfQuUJ.
>> To post to this group, send email to puppet-users@googlegroups.com.
>> To unsubscribe from this group, send email to 
>> puppet-users+unsubscr...@googlegroups.com.
>> For more options, visit this group at 
>> http://groups.google.com/group/puppet-users?hl=en.
> 
> 
> -- 
> 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+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/puppet-users?hl=en.

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Dependencies between defines

2012-08-22 Thread Martin Alfke

On 22.08.2012, at 14:27, Axel Bock wrote:

> Hi readers 
> 
> another question for my little puppet project: Can I (and if yes, how) define 
> dependendies between puppet "defines"? (define like in define 
> mymodule::mydefine() {...})
> 
> Example: I have a define "prepare_cool_thing" and another define 
> "cool_thing". Both can be on a machine several times (quite, actually, like 
> vhosts :). So this is entirely valid: 
> 
> prepare_cool_thing{ "name1" : }
> cool_thing{ "name1" : }
> 
> prepare_cool_thing{ "name2" : }
> cool_thing{ "name2" : }
> 
> I'm sure you get it. BUT. I'd like to state within the cool_thing define that 
> the prepare_cool_thing was executed. Can I do that? The following does not 
> seem to do what I want: 
> 
> Prepare_cool_thing[ "name1" ] -> Cool_thing[ "name1" ]  # naah, does not work.

Where did you put the dependency?
What puppet version are you using.

Normally this works:

define task_one ( $user = 'root' ) {
file { '/tmp/one':
  owner => $user,
  content => $user,
   }
}
define task_two ( $user = 'root' ) {
   file { '/tmp/two':
  owner => $user,
  content => $user,
   }
}
task_one { 'foo': }
task_two { 'foo': }
Task_one['foo'] -> Task_two['foo']

You can also place the order inside the define:

define task_two ( $user = 'root') {
   file { '/tmp/two':
  owner => $name,
  content => $name,
   }
   Task_one["$name"] -> Task_two["$name"]
}



> 
> 
> Thanks & greetings!
> Axel.
> 
> 
> -- 
> 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/-/zUkjN-osHugJ.
> To post to this group, send email to puppet-users@googlegroups.com.
> To unsubscribe from this group, send email to 
> puppet-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/puppet-users?hl=en.

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] Dependencies between defines

2012-08-22 Thread Axel Bock
Hi readers 

another question for my little puppet project: Can I (and if yes, how) 
define dependendies between puppet "defines"? (define like in define 
mymodule::mydefine() {...})

Example: I have a define "prepare_cool_thing" and another define 
"cool_thing". Both can be on a machine several times (quite, actually, like 
vhosts :). So this is entirely valid: 

prepare_cool_thing{ "name1" : }
cool_thing{ "name1" : }

prepare_cool_thing{ "name2" : }
cool_thing{ "name2" : }

I'm sure you get it. BUT. I'd like to state within the cool_thing define 
that the prepare_cool_thing was executed. Can I do that? The following does 
not seem to do what I want: 

Prepare_cool_thing[ "name1" ] -> Cool_thing[ "name1" ]  # naah, does not 
work.


Thanks & greetings!
Axel.

-- 
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/-/zUkjN-osHugJ.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] Re: newish puppet on RHEL4 and/or SLES9?

2012-08-22 Thread Keiran Sweet
I've had quite a bit of success with Puppet 2.7 on 32-bit RHEL 
4, specifically:
- Puppet 2.7.3
- Facter 1.6.2
- Ruby Enterprise 1.8.7
- Older EPEL packages for Augeas, and other dependencies , active mirrors 
with signed packages are still floating about.

As ruby enterprise is now discontinued, i'm looking to move off next major 
upgrade, however you should be able to build the standard Ruby 1.8.7 + ruby 
gems from source to have quite a feature rich RHEL4 Puppet 2.7 install that 
is stable, i'm managing (nursing) about 30 servers with it now along side 
my newer RHEL 5/6 estate, and the only issue I've hit is the odd stale 
client which an agent restart fixes, initital testing of mcollective 2 also 
is promising so far.

I've also found that building a dedicated ruby install for Puppet, and not 
messing with the ruby versions that ship with the OS have helped keep 
things clean and be less off a pain when it comes to gem dependencies in my 
environment, of course YMMV.

Cheers,

K





On Thursday, August 16, 2012 5:53:39 AM UTC+1, Jemmorey wrote:
>
> Jason, 
>
> I was able to compile puppet via the spec file included in the source up 
> to version 2.7.5 on RHEL4 (32 and 64-bit).  I can't remember the issues I 
> had with 2.7.6-9 right now, but it had to do with the ancient ruby (1.8.1). 
>  I did grab the requisite dependencies (augeas-libs, ruby-augeas, facter) 
> from the EPEL.  I haven't had any major issues with that version using the 
> default system ruby.  Makes me feel better that someone else has to support 
> EOL relics as well.  Hope this helps.
>
> Jordan
>

-- 
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/-/pXVMrU5zhm8J.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] mcollective getaddrinfo: Name or service not known

2012-08-22 Thread R.I.Pienaar


- Original Message -
> From: "James Trier" 
> To: puppet-users@googlegroups.com
> Sent: Wednesday, August 22, 2012 12:46:52 AM
> Subject: [Puppet Users] mcollective getaddrinfo: Name or service not known
> 
> I'm getting these errors when running 'puppet agent --test' after
> doing a new installation of an agent:
> 
> err:
> /Stage[main]/Pe_mcollective::Plugins/File[/opt/puppet/libexec/mcollective/mcollective/security/sshkey.rb]/content:
> change from {md5}512f42272699eaa085c83d2cc67c27ea to
> {md5}8fa3e9125fd917948445e3d2621d40e5 failed: Could not back up
> /opt/puppet/libexec/mcollective/mcollective/security/sshkey.rb:
> getaddrinfo: Name or service not known
> 
> err:
> /Stage[main]/Pe_mcollective::Posix/File[/etc/puppetlabs/mcollective/server.cfg]/content:
> change from {md5}a9c7335a83c5ac9f6a19bb195ea0c63e to
> {md5}db6aa935c128b6d7bd12b41dfbe33b91 failed: Could not back up
> /etc/puppetlabs/mcollective/server.cfg: getaddrinfo: Name or service
> not known
> 
> I know the above error is commonly related to DNS but I'm not sure
> where the disconnect it. These are brand new agent installations.
> server field in the agent puppet.conf is the server hostname which
> is also the listed certname shown when 'puppet master --configprint
> certname,certdnsnames' is typed from the server (certdnsname is
> blank).
> 
> Any help or direction?

This is probably related to the puppet remote filebucket configuration 
rather than mcollective, do you have any remote filebucket config anywhere?

maybe somewhere something like:

filebucket { "main":
  server => "a.host.that.does.not.exist",
}

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] mcollective getaddrinfo: Name or service not known

2012-08-22 Thread James Trier
I'm getting these errors when running 'puppet agent --test' after doing a 
new installation of an agent:

err: 
/Stage[main]/Pe_mcollective::Plugins/File[/opt/puppet/libexec/mcollective/mcollective/security/sshkey.rb]/content:
 
change from {md5}512f42272699eaa085c83d2cc67c27ea to 
{md5}8fa3e9125fd917948445e3d2621d40e5 failed: Could not back up 
/opt/puppet/libexec/mcollective/mcollective/security/sshkey.rb: 
getaddrinfo: Name or service not known

err: 
/Stage[main]/Pe_mcollective::Posix/File[/etc/puppetlabs/mcollective/server.cfg]/content:
 
change from {md5}a9c7335a83c5ac9f6a19bb195ea0c63e to 
{md5}db6aa935c128b6d7bd12b41dfbe33b91 failed: Could not back up 
/etc/puppetlabs/mcollective/server.cfg: getaddrinfo: Name or service not 
known

I know the above error is commonly related to DNS but I'm not sure where 
the disconnect it. These are brand new agent installations. server field in 
the agent puppet.conf is the server hostname which is also the listed 
certname shown when 'puppet master --configprint certname,certdnsnames' is 
typed from the server (certdnsname is blank).

Any help or direction?

Thanks -- James


-- 
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/-/yS5tw0DO9AUJ.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] how to connect agent to the master through a different user to execute a command through puppet module

2012-08-22 Thread Prosenjit Ghosh
Created a puppet master in one Linux.X64/rh50 machine.
Created a puppet agent in another Linux.X64/rh50 machine.

Need to run any command from puppet master and that will execute in puppet 
agent when puppet agent will connect to puppet master.

This is happening correctly for me when created master and agent through root 
user.

But I need to execute a command that wont allow root user. I need any user 
except root. I tried successfully to create puppet master through a different 
user. But not able to execute the command when connecting the agent through 
that different user.

Any suggestion on this how to connect agent to the master through a different 
user to execute a command through puppet module

-- 
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/-/Koetw54t2mAJ.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.