Re: [Puppet Users] Specifying Yum Options
On Sat, Apr 3, 2010 at 3:46 AM, Eric Shamow wrote: > A not-so-elegant solution is to write your own yum provider that > allows you to do this. In my case I found one online -- if you google > yum_plus.rb you should be able to find it. If not let me know and > I'll post the work here. > > On Thu, Apr 1, 2010 at 10:19 PM, Isaac Christoffersen > wrote: > > We're using RHN Satellite server to manage our packages and we have a > custom > > package channel for third-party packages. Unfortunately, some of the > > packages in the channel are unsigned. > > > > Is there a way to get the Package Provider for yum to use the nogpgcheck > > option? Right now, I'm using an exec declaration instead of a package, > but > > it seems kludgy to do this. > > > > Of course, from a larger perspective, I'd like to be able to pass any > valid > > yum option via the package syntax in Puppet. (i.e. Download Only, Enable > > Repo, Group Install, etc.) > > > > thanks, > > > > Isaac > > > > > > -- > I just created a separate repository for those packages, and turned off gpgcheck. -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-us...@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: facter inconsistent results
On Thu, Nov 12, 2009 at 2:36 PM, Russ Allbery wrote: > > Nigel Kersten writes: > > > Ugh. This is particularly sucky, and I vote this fact needs to be fixed > > for this irrespective of the plugin loading issue. > > > The problem is: > > > if Facter.value(:lsbdistid) == "Ubuntu" > >"Ubuntu" > > elsif FileTest.exists?("/etc/debian_version") > > "Debian" > > > the first invocation doesn't fill lsbdistid, so it falls through to > > Debian when /etc/debian_version exists on Ubuntu. > > Inside Puppet, this works fine, since Puppet always loads all plugins. It > really only affects the command-line invocation (although I don't know > what happens if you use facter in a different Ruby program). > > This looks like more of a result of using grep. If you call facter with operatingsystem, you are asking for just the operating system. If you call facter without any arguments, it gives you everything, then you are grepping for anything that contains the continuous stream of letters "operatingsystem", whether or not it is a separate word or not. That would happen with any program, facter or not. --~--~-~--~~~---~--~~ 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] typo in source file
I tried to post this to puppet-dev but it doesn't look like I have permission, so here it is on puppet-users for anybody to do something with. There seems to be a typo in the following file: [riffr...@hobbes puppet-0.25.0]$ diff -u ext/nagios/check_puppet.rb.orig ext/nagios/check_puppet.rb --- ext/nagios/check_puppet.rb.orig 2009-09-06 20:12:28.0 -0400 +++ ext/nagios/check_puppet.rb 2009-09-06 20:12:35.0 -0400 @@ -102,7 +102,7 @@ exitcode = 2 when 3 status = "UNKNOWN" -exitcide = 3 +exitcode = 3 end puts "PUPPET " + status + ": " + process + ", " + state -lsd --~--~-~--~~~---~--~~ 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: template command
Try with something like: > > <%- if role == "fast" -%> ><%- line = "The line you want to print" -%> > <%- end -%> > <%= line -%> > > > > A bit to quick there. For this to work you have to feed the template with > the variable. You can just feed $role with a default value. eg default.. > > The thing is I have a lot of node definitions, and every node includes this class. I don't want to have to edit every node definition in order to get that line in just a couple of nodes. Maybe change the class so it concats another template/file onto the end of it if $role is set, although I'm not quite sure how to do that yet without experimentation. --~--~-~--~~~---~--~~ 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] template command
I need to be able to include a line in a template, based on presence and value of a variable, something like this: # file.erb blah blah blah <% if role == "fast" -%> this line is here now <% end -%> I only want the line to be included if $role exists and is equal to fast. If $role doesn't exist, or doesn't equal "fast", it shouldn't include the line: Jul 24 19:59:40 lonengbld01 puppetmasterd[3095]: Failed to parse template repo/R edHat-4/extras.repo: Could not find value for 'role' at /etc/puppet/modules/repo /manifests/init.pp:121 on node blah What would be the correct syntax? Thanks --~--~-~--~~~---~--~~ 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] class dependencies
How can I have a module/class that is dependent on another class? Say, /etc/puppet/modules: module1 module2 in module2/manifests/init.pp class module2 { file { # blah blah blah require => Class["module1"], } package { } } Usually this gives me an error (can't remember what; I'm writing this from home, and I use it at work). If this isn't enough information for a proper question, I can reply to this message tomorrow after testing to get the error message again. Right now to get around it I just have my main class including several other classes, but because of the dependencies, some of them fail the first time around, but succeed after running a second time and one of the other conditions had been met from the previous run (like an installed package or something). It is not the way I want to do it, of course, but I've still been experimenting with different things. /lsd --~--~-~--~~~---~--~~ 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: Is there a way to write to a file using puppet
On Fri, Jun 19, 2009 at 2:41 PM, RijilV wrote: > > 2009/6/19 Swati Tiwari : > > Hey Guys, > > > > I am sorry if this sounds silly but I am new to puppet. I am trying to > > append a particular line to the apt.conf file on all the clients that are > > running puppetd. Is there any way to do this using puppet. Any help would > be > > appreciated! > > > > Thank you! > > > > -- > > Regards, > > Swati > > > http://reductivelabs.com/trac/puppet/wiki/Recipes/SimpleText > > Or take a look at Augeas, provided there is already a lens for > apt.conf or you're comfortable writing one, would likely be a cleaner > way of handling this. > > .r' > Depending on the format of the file (I don't know what that one is), you may not need a custom lens. I modified /etc/sysconfig/sysstat (part of the sysstat package on rhel). These files are generally simple key=value files, and the basic lens is sufficient for 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 -~--~~~~--~~--~--~---
[Puppet Users] Re: Moving to new puppetmaster - certificates
On Wed, Jun 10, 2009 at 12:16 PM, Jason Antman wrote: > > Unfortunately I haven't been able to find anything in the docs... > > I just built a new puppetmaster to replace my testing install on an old > box. The hostname is different, and obviously the master certificates > are different. What needs to be done to the clients to get them to play > nice with the new box? > > Thanks, > Jason Antman > I ended up deleting /var/lib/puppet/ssl, and rerunning puppet. You have to sign new certs on the new machine, of course. --~--~-~--~~~---~--~~ 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: /etc/skel
On Wed, Jun 10, 2009 at 12:08 PM, paul matthews < paulsmatth...@googlemail.com> wrote: > An alternate, non Puppet method is to add a pam_mkhomedir module to > /etc/pam.d/system-auth (on a RedHat machine at least) by including the > following line:- > > session required /lib/security/$ISA/pam_mkhomedir.so > skel=/etc/skel umask=0022 > > This has the effect of creating a homedir if one does not exist and pulling > in the contents of /etc/skel > > Cheers > Paul > > That's what I did for our linux machines. They all authenticate with ldap, and when somebody logs into a machine for the first time, it will create the home dir. Very easy solution. -lsd --~--~-~--~~~---~--~~ 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: puppet+augeas modprobe.conf
On Wed, Jun 10, 2009 at 9:15 AM, Bryan Kearney wrote: > > lance dillon wrote: > > O > >> > >> That doesn't quite work either: > > > > ### print /files/etc/modprobe.conf > > ... > > /files/etc/modprobe.conf/alias[5] = "usb-storage" > > /files/etc/modprobe.conf/alias[5]/modulename = "off" > > augtool> match /files/etc/modprobe.conf/alias[='usb-storage'] > > (error matching /files/etc/modprobe.conf/alias[='usb-storage']) > > augtool> > > > I believe you need > > /files/etc/modprobe.conf/alias[.='usb-storage'] > That did it. Thanks for the help guys. That was exactly what I needed. -lsd --~--~-~--~~~---~--~~ 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: puppet+augeas modprobe.conf
On Tue, Jun 9, 2009 at 6:54 PM, David Lutterkort wrote: > > On Tue, 2009-06-09 at 11:57 -0400, Bryan Kearney wrote: > > Ok.. lets try this (lutter knows this voodoo better) > > It's not voodoo, it's XPath ;) > > > "match *[alias ='usb-storage'] size = 0 " > > That almost works, though shouldn't that second '=' be '==' ? (and maybe > we should make the augeas provider use '=' there, too, for consistency) > > I would write this as > >augeas { "usb-storage": >context => "/files/etc/modprobe.conf", >changes => [ "set alias[last()+1] usb-storage", > "set alias[last()]/modulename off", > ], > onlyif => "match alias[.='usb-storage'] size == 0' > } > > The fact that the modprobe.conf format is 'command args' with differing > meanings of the args for the various commands doesn't matter too much - > it just leads to different tree structures for those commands. For > example for the command 'alias NAME MODULE' the tree structure is > >alias = 'NAME' > modulename = 'MODULE' > > IOW, the name of the alias becomes the value of the 'alias' node, and > the name of the module is put as the value of a node labelled > 'modulename'. > > David > > > That doesn't quite work either: ### print /files/etc/modprobe.conf ... /files/etc/modprobe.conf/alias[5] = "usb-storage" /files/etc/modprobe.conf/alias[5]/modulename = "off" augtool> match /files/etc/modprobe.conf/alias[='usb-storage'] (error matching /files/etc/modprobe.conf/alias[='usb-storage']) augtool> --~--~-~--~~~---~--~~ 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: puppet+augeas modprobe.conf
> > The problem with modprobe.conf is that it is more like: > > > > command args > > > > than > > > > key value > > > > > > key value usually has unique keys, but command args doesn't. > > > > It's kind of weird A lot of those commands work on something else, say > > /etc/hosts, or /etc/fstab, something that is key value, but just not > working > > on /etc/modprobe.conf. > > > Can you please send me your target modprobe.conf file? > > -- bk > alias eth0 vmnics alias scsi_hostadapter mptbase alias scsi_hostadapter1 mptscsih install bond0 /sbin/modprobe bonding -o bond0 miimon=100 mode=1 # Added by VMware Tools install pcnet32 /sbin/modprobe -q --ignore-install vmxnet;/sbin/modprobe -q --ignore-install pcnet32 $CMDLINE_OPTS;/bin/true alias char-major-14 sb options sb io=0x220 irq=5 dma=1 dma16=5 mpu_io=0x330 #alias usb-storage off If alias usb-storage off isn't present, it should add it, otherwise do nothing. Like I said, I'm still experimenting with options, but nothing has worked right yet. --~--~-~--~~~---~--~~ 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: puppet+augeas modprobe.conf
On Tue, Jun 9, 2009 at 1:09 PM, Bryan Kearney wrote: > > Bryan Kearney wrote: > >> thanks > > > > > > ok.. I think this is it in augtool: > > > > match /files/etc/modprobe.conf/*[.="foo"] > > > > so.. in the plugin you can do > > > > 'match /files/etc/modprobe.conf/*[.="foo"] size = 0' > > > > more specific matching: > > match /files/etc/modprobe.conf/alias[.="foo"] > The problem with modprobe.conf is that it is more like: command args than key value key value usually has unique keys, but command args doesn't. It's kind of weird A lot of those commands work on something else, say /etc/hosts, or /etc/fstab, something that is key value, but just not working on /etc/modprobe.conf. --~--~-~--~~~---~--~~ 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: puppet+augeas modprobe.conf
On Tue, Jun 9, 2009 at 11:57 AM, Bryan Kearney wrote: > > lance dillon wrote: > > On Tue, Jun 9, 2009 at 11:16 AM, Bryan Kearney > wrote: > > > >> lance dillon wrote: > >>> I need to be able to add: > >>> > >>> alias usb-storage off > >>> > >>> to /etc/modprobe.conf > >>> > >>> I have this so far: > >>> > >>> augeas { "usb-storage": > >>> context => "/files/etc/modprobe.conf", > >>> changes => [ "set alias[last()+1] usb-storage", > >>> "set alias[last()]/modulename off", > >>>], > >>> onlyif => "get alias != usb-storage" > >>> } > >> > >> try onlyif => "match alias include usb-storage" > >> > >> it may be > >> > >> "match alias[*] include usb-storage" > >> > >> -- bk > >> > >> > >> Hmm, that didn't quite do it either. Now it doesn't run regardless. It > is > > supposed to add that line if usb-storage doesn't exist, and ignore if it > > does (I don't want to add it multiple times). The logic above seems to > be > > the opposite, but either way, nothing happened. > > > > Thanks for the info though. Now I have another command to check with > (using > > include). > > > > Ok.. lets try this (lutter knows this voodoo better) > > "match *[alias ='usb-storage'] size = 0 " > > -- bk > Seems closer, but not quite. augtool> match /files/etc/modprobe.conf/alias[*] /files/etc/modprobe.conf/alias[1] = eth0 /files/etc/modprobe.conf/alias[2] = scsi_hostadapter /files/etc/modprobe.conf/alias[3] = scsi_hostadapter1 /files/etc/modprobe.conf/alias[4] = char-major-14 /files/etc/modprobe.conf/alias[5] = usb-storage augtool> match /files/etc/modprobe.conf/alias[*='usb-storage'] (no matches) augtool> match /files/etc/modprobe.conf/alias[='usb-storage'] (error matching /files/etc/modprobe.conf/alias[='usb-storage']) augtool> match /files/etc/modprobe.conf/alias[*='usb-storage'] (no matches) augtool> match /files/etc/modprobe.conf/alias[*="usb-storage"] (no matches) This may give more information. thanks --~--~-~--~~~---~--~~ 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: puppet+augeas modprobe.conf
On Tue, Jun 9, 2009 at 11:16 AM, Bryan Kearney wrote: > > lance dillon wrote: > > I need to be able to add: > > > > alias usb-storage off > > > > to /etc/modprobe.conf > > > > I have this so far: > > > > augeas { "usb-storage": > > context => "/files/etc/modprobe.conf", > > changes => [ "set alias[last()+1] usb-storage", > > "set alias[last()]/modulename off", > >], > > onlyif => "get alias != usb-storage" > > } > > > try onlyif => "match alias include usb-storage" > > it may be > > "match alias[*] include usb-storage" > > -- bk > > > Hmm, that didn't quite do it either. Now it doesn't run regardless. It is supposed to add that line if usb-storage doesn't exist, and ignore if it does (I don't want to add it multiple times). The logic above seems to be the opposite, but either way, nothing happened. Thanks for the info though. Now I have another command to check with (using include). --~--~-~--~~~---~--~~ 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] puppet+augeas modprobe.conf
I need to be able to add: alias usb-storage off to /etc/modprobe.conf I have this so far: augeas { "usb-storage": context => "/files/etc/modprobe.conf", changes => [ "set alias[last()+1] usb-storage", "set alias[last()]/modulename off", ], onlyif => "get alias != usb-storage" } The change works, but the onlyif part does not. augtool> print /files/etc/modprobe.conf/alias[*] /files/etc/modprobe.conf/alias[1] = "eth0" /files/etc/modprobe.conf/alias[1]/modulename = "vmnics" /files/etc/modprobe.conf/alias[2] = "scsi_hostadapter" /files/etc/modprobe.conf/alias[2]/modulename = "mptbase" /files/etc/modprobe.conf/alias[3] = "scsi_hostadapter1" /files/etc/modprobe.conf/alias[3]/modulename = "mptscsih" /files/etc/modprobe.conf/alias[4] = "char-major-14" I need to be able to detect if usb-storage already exists as a module name, so I don't add the alias line multiple times. I've tried several things, but none of them seem to do what I want. Does anybody have any ideas? I'm still experimenting, and if I find an answer, I'll post it. Thanks /lsd --~--~-~--~~~---~--~~ 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: Environment variable access inside an exec
You could also use augeas to manage those options. On Thu, Jun 4, 2009 at 7:12 PM, Mike Renfro wrote: > > On 6/4/2009 5:59 PM, Brandon Whalen wrote: > > I've spent some time looking at the example recipes and reading the docs > on > > a problem, but I'm still stumped. I'm trying to add some options to my > fstab > > and am finding some problems. I'm using the environment option to create > an > > environment variable MNT_OPTS that I then reference as part of a sed > call. > > I'm finding that MNT_OPTS is empty when I reference it. My exact code is > > below. > > Unless you're specifically trying to add options to whatever /home entry > already exists, you might want to use the builtin mount type. I know > you can use it to specify all the mount options, but I'm not sure if you > can use the '+>' operator to add options to whatever exists. > > http://reductivelabs.com/trac/puppet/wiki/TypeReference#mount > > -- > Mike Renfro / R&D Engineer, Center for Manufacturing Research, > 931 372-3601 / Tennessee Technological University > > --~--~-~--~~~---~--~~ 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: Puppet watching puppet
On Mon, Apr 6, 2009 at 12:46 PM, Trevor Vaughan wrote: > > It's because 'service puppetd status' reports that puppetd is running > while puppetd is running in test mode. > > Trevor I had to replace the puppet init script to fix the status problem. I have it as a recipe to automatically replace so that it can maintain itself properly. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---