[Puppet Users] Re: how to do conditional check?

2011-06-13 Thread Sans
Any suggestion from anyone else? Is there a way to check "if a directory (or file) already exists, then do something" in Puppet? Cheers!! -- 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@googlegro

Re: [Puppet Users] Global scope variables and erb templates in puppet 2.7

2011-06-13 Thread Alessandro Franceschi
scope.lookupvar() works also on Puppet 2.6 and 0.25 and maybe earlier versions, and AFAIK will keep on working in future versions. Incidentally it has the benefit of not throwing an exception when the referred variables is not set (it just returns an empty field) I find it useful to refer to full

Re: [Puppet Users] Re: how to do conditional check?

2011-06-13 Thread Michael Knox
Yes, Create a custom fact that checks for the existence of the directory. I have one that is as simple as ... Facter.add("apde_available") do setcode do if File::directory?("/usr/local/APDE") "true" else "false" end end end then in my manif

Re: [Puppet Users] Global scope variables and erb templates in puppet 2.7

2011-06-13 Thread Matthias Saou
Hi, Then I'm guessing the only other solution, which also works with 0.25 and any higher version would be : $local_scope_fqdn = $::fqdn Then : <%= local_scope_fqdn %> In order to use a local scope variable from within templates. It's really too bad to not be able to use scoped variables from

Re: [Puppet Users] Re: Creating Users and Hashing it's password.

2011-06-13 Thread Nigel Kersten
On Sun, Jun 12, 2011 at 10:42 AM, Alexandre Martani wrote: > On Ubuntu/Debian, you can generate the hash using: > > mkpasswd -m sha-512 > > I don't know if it works on Mac, but the output of it looks like the same > as the examples posted on this topic, so I think it should work. > Mac OS X has a

Re: [Puppet Users] Re: how to do conditional check?

2011-06-13 Thread Darren Chamberlain
* Sans [2011/06/13 02:21]: > Any suggestion from anyone else? Is there a way to check "if a > directory (or file) already exists, then do something" in Puppet? > Cheers!! I use this pattern: $_exists = inline_template("<%= File.exists?('$f') %>") case $_exists { "true": { ... } "

Re: [Puppet Users] Re: how to do conditional check?

2011-06-13 Thread Daniel Pittman
On Mon, Jun 13, 2011 at 09:49, Darren Chamberlain wrote: > * Sans [2011/06/13 02:21]: > >> Any suggestion from anyone else? Is there a way to check "if a >> directory (or file) already exists, then do something" in Puppet? >> Cheers!! This isn't a suggestion you will like, but: if it hurts when

[Puppet Users] two possibilities for declaring resources with hashes [was: Virtual resources and hashes]

2011-06-13 Thread Randall Hansen
I think Aaron lays out the options pretty well. This issue has been hanging fire for quite a while, and it would be nice to come to a decision about what our path forward is. Who else cares about this? What do you think? r On Wed, Jun 8, 2011 at 1:36 PM, Aaron Grewell wrote: > We've looked at

Re: [Puppet Users] two possibilities for declaring resources with hashes [was: Virtual resources and hashes]

2011-06-13 Thread Daniel Pittman
So, I care some about this: pretty much every place we want to do this feels very, very much like a work-around to the inability to interact with meaningful information through either recursion, or iteration, in the Puppet DSL. People end up contorting around like snakes to try and figure out some

Re: [Puppet Users] two possibilities for declaring resources with hashes [was: Virtual resources and hashes]

2011-06-13 Thread Dan Bode
On Mon, Jun 13, 2011 at 10:18 AM, Randall Hansen wrote: > I think Aaron lays out the options pretty well. This issue has been > hanging fire for quite a while, and it would be nice to come to a > decision about what our path forward is. > > Who else cares about this? What do you think? > > r > >

RE: [Puppet Users] Re: how to do conditional check?

2011-06-13 Thread Matthew Black
After reading the other responses my question to you is what exactly are you attempting to do? -Original Message- From: puppet-users@googlegroups.com [mailto:puppet-users@googlegroups.com] On Behalf Of Sans Sent: Monday, June 13, 2011 5:22 AM To: Puppet Users Subject: [Puppet Users] Re: h

[Puppet Users] Re: cannot manage home directories

2011-06-13 Thread vella1tj
Unfortunately it is still not creating the Home folder but it is at least creating the User and assigning it the proper values!!:D I'm going to try doing a mdir to create the home folder. Let me know what you think about that, here is what I have right now. user {'user': uid=> 501,

[Puppet Users] Re: cannot manage home directories

2011-06-13 Thread vella1tj
the exec has been changed to this. exec {"cp -R English.lproj/* /Users/sysop": path =>"/System/Library/User Template/", #require =>User[sysop], #subscribe =>User[sysop], #refreshonly => true, } Have also tried using exec {"cp -R English.lproj/* /Users/sysop": path =>"/Sys

[Puppet Users] Re: Creating Users and Hashing it's password.

2011-06-13 Thread vella1tj
Yep, I figured it out thanks to you guys. Now it's just getting that darn home folder to get created:) Again thanks for the replies you guys are awesome. On Jun 13, 9:56 am, Nigel Kersten wrote: > On Sun, Jun 12, 2011 at 10:42 AM, Alexandre Martani wrote: > > > On Ubuntu/Debian, you can generate

Re: [Puppet Users] Re: cannot manage home directories

2011-06-13 Thread Nigel Kersten
On Mon, Jun 13, 2011 at 11:05 AM, vella1tj wrote: > Unfortunately it is still not creating the Home folder but it is at > least creating the User and assigning it the proper values!!:D > > I'm going to try doing a mdir to create the home folder. Let me know > what you think about that, here is wh

[Puppet Users] Re: cannot manage home directories

2011-06-13 Thread vella1tj
so the copying way of the user template is prolly not the best way? On Jun 13, 3:24 pm, Nigel Kersten wrote: > On Mon, Jun 13, 2011 at 11:05 AM, vella1tj wrote: > > Unfortunately it is still not creating the Home folder but it is at > > least creating the User and assigning it the proper values

Re: [Puppet Users] Re: cannot manage home directories

2011-06-13 Thread Nigel Kersten
On Mon, Jun 13, 2011 at 12:48 PM, vella1tj wrote: > so the copying way of the user template is prolly not the best way? > That's basically one of the underlying things createhomedir does, but you're not going to actually be setting up directories with the correct permissions/ACLs, which could be

[Puppet Users] Re: cannot manage home directories

2011-06-13 Thread vella1tj
Well I haven't got on top of debugging the createhomdir but I just wanted to let you know how we got the command to work. this is the exec as follows exec {'username': command=>"cp -R /System/Library/templateuser/English.lproj/ / Users/username/", path=>"/bin/", #ever

Re: [Puppet Users] early cert blues

2011-06-13 Thread Craig White
Turned out that I cloned a VMWare install of ubuntu server that sets the host name in /etc/hosts under 127.0.0.1 which of course was refusing connections on port 8140. I'm more used to RHEL and learned some differences in default setup/behaviors w/ Ubuntu. Thanks - working now Craig On Jun 10

[Puppet Users] puppet clients

2011-06-13 Thread Craig White
I've gone over the documentation several times now and I can't figure out how to 'apply' a manifest to a client. The client does have a signed certificate but the only thing in the /etc/puppet folder on the client is an ssl directory. I have a manifest that works fine on the puppet 'master' I

[Puppet Users] unmanaging config data

2011-06-13 Thread Chris Phillips
Hi, I'm happily aware of the way that there is no concept of unmanaging something and when this is in the context of a file ownership or whatever, then that makes sense. But when this is applied to things like nagios configuration data the principle seems to come unstuck. Or at least, it seems so

Re: [Puppet Users] Re: cannot manage home directories

2011-06-13 Thread Nigel Kersten
On Mon, Jun 13, 2011 at 1:30 PM, vella1tj wrote: > Well I haven't got on top of debugging the createhomdir but I just > wanted to let you know how we got the command to work. this is the > exec as follows > > exec {'username': > command=>"cp -R /System/Library/templateuser/English.lproj/

Re: [Puppet Users] puppet clients

2011-06-13 Thread Nan Liu
On Mon, Jun 13, 2011 at 1:57 PM, Craig White wrote: > I've gone over the documentation several times now and I can't figure out how > to 'apply' a manifest to a client. > > The client does have a signed certificate but the only thing in the > /etc/puppet folder on the client is an ssl directory.

Re: [Puppet Users] puppet clients

2011-06-13 Thread Denmat
>From a cursory glance at the new doco, I couldn't find it either (forgive me >if it is there though). I could find a 'puppet apply' but not 'agent' in the >'getting started' sections. There is of course the puppet commands page but >that does provide examples. Anyhoo.. puppet agent --test --ve

[Puppet Users] Open Source team road map

2011-06-13 Thread Nick Lewis
For our first few weeks, the open source team has been working on a fairly disparate selection of highly-voted and otherwise high-priority tickets. While these are no doubt important, we'd like to shift our focus to more cohesive, high-level goals (which will encompass many of the same highly-voted

Re: [Puppet Users] puppet clients

2011-06-13 Thread Craig White
I can run that command no problem but it never does 'apply' the manifest that is stated in $PUPPET_ROOT/manifests/nodes.pp which is a fairly simple ntp install. (see below for nodes.pp & modules/manifests/ntp.pp) # puppet agent --test --verbose --noop --server ubuntu.ttinet info: Caching catalog

Re: [Puppet Users] puppet clients

2011-06-13 Thread Craig White
On Jun 13, 2011, at 3:10 PM, Nan Liu wrote: > On Mon, Jun 13, 2011 at 1:57 PM, Craig White wrote: >> I've gone over the documentation several times now and I can't figure out >> how to 'apply' a manifest to a client. >> >> The client does have a signed certificate but the only thing in the >>

[Puppet Users] Re: how to do conditional check?

2011-06-13 Thread Sans
Well, the file I mention is actually one of the Torque (formerly PBS batch system) "config" file (location: /var/torque/mom_priv/config), which is auto generated by "yaim" but the thing is: if the file is already there "yaim" won't touch it. Let's just say that I don't want yaim to create this file

Re: [Puppet Users] puppet clients

2011-06-13 Thread Nan Liu
On Mon, Jun 13, 2011 at 4:19 PM, Craig White wrote: > > On Jun 13, 2011, at 3:10 PM, Nan Liu wrote: > >> On Mon, Jun 13, 2011 at 1:57 PM, Craig White wrote: >>> I've gone over the documentation several times now and I can't figure out >>> how to 'apply' a manifest to a client. >>> >>> The client

[Puppet Users] Re: puppet clients

2011-06-13 Thread Nick Fagerlund
What Nan said. Personally, I would recommend just renaming nodes.pp to site.pp -- there's not much of a reason to maintain your nodes in a separate file when you're just getting started. And yeah, always have a node default { ... } , even if all it does is fire a notify resource saying "Hey, I'

[Puppet Users] RHEL 6 Optional channel

2011-06-13 Thread Len Rugen
It looks like all of our RHEL 6 systems now need to connect to the RHN Optional Channel. (puppet, ruby vs. selinux deps) Is there a way to do that with a script without having to enter RHN userid and password? Is there a way to add a channel during kickstart? Thanks -- You received this mess

Re: [Puppet Users] Re: how to do conditional check?

2011-06-13 Thread Matthew Black
Sounds like what you want to do is to create a fact to find out that status of whether torque is installed or not. As for the configuration file, without better understanding the contents of the file, I would in conjunction with the fact do a file resource surrounded by an if statement that utiliz

Re: [Puppet Users] RHEL 6 Optional channel

2011-06-13 Thread Steven Acres
On Mon, Jun 13, 2011 at 10:31 PM, Len Rugen wrote: > It looks like all of our RHEL 6 systems now need to connect to the RHN > Optional Channel. (puppet, ruby vs. selinux deps) > > Is there a way to do that with a script without having to enter RHN userid > and password? Is there a way to add a