[Puppet Users] mutiple ranges in the schedule
Has anyone been able to setup a schedule for say 7 pm to 4 am next day ? By default the range can not extgend beyond the day, but wondering anyone had a workaround similar to 01:00 - 04:00, 19:00 - 23:39 ? Thanks Kanishka -- 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] How does an ENC find the client's enviromement?
Hello, I started writing an ENC and run into what seems like a chicken and egg problem... I was starting off by getting the client's facts from the inventory service by getting: https://puppetmaster:8140/production/facts/$client_hostname and then was getting the "environment" from the fact named "environment" then I realized that "production" in the previous URL is the environment I am querying! Is there another way of finding the environment that the client is providing to the master? Thanks a lot, Mohamed. -- 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] Fwd: How does an ENC find the client's enviromement?
I tried to work around the problem by having a copy of the ENC per environment, which would work for me too... but then that does not work either: external_nodes = /etc/puppet/environments/$environment/gu-enc/gu-enc.py In the above, $environment evaluates to "production" even though my "puppet agent" call specified a different environment. I guess the above is evaluated on master's start up, only once, not per client invocation. Thanks a lot, Mohamed. On Sun, Oct 16, 2011 at 1:26 PM, Mohamed Lrhazi wrote: > Hello, > > I started writing an ENC and run into what seems like a chicken and > egg problem... > > I was starting off by getting the client's facts from the inventory > service by getting: > > https://puppetmaster:8140/production/facts/$client_hostname > > and then was getting the "environment" from the fact named "environment" > > then I realized that "production" in the previous URL is the > environment I am querying! > > Is there another way of finding the environment that the client is > providing to the master? > > Thanks a lot, > Mohamed. > -- 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: Setting savedefult options with augeas/puppet
- Original Message - | Cheers, I'll walk you through how I came up with the augeas commands. | | Opening augtool and printing /files/boot/grup/menu.lst shows how the | lense has constructed the augeas tree (edited for brevity): | | augtool> print /files/boot/grub/menu.lst/ | /files/boot/grub/menu.lst | /files/boot/grub/menu.lst/#comment[1] = "grub.conf generated by | anaconda" | ... | /files/boot/grub/menu.lst/default = "0" | /files/boot/grub/menu.lst/timeout = "0" | /files/boot/grub/menu.lst/splashimage = "(hd0,0)/grub/splash.xpm.gz" | ... | /files/boot/grub/menu.lst/title[2] = "Fedora (2.6.40.4-5.fc15.x86_64)" | /files/boot/grub/menu.lst/title[2]/root = "(hd0,0)" | /files/boot/grub/menu.lst/title[2]/kernel = "/ | vmlinuz-2.6.40.4-5.fc15.x86_64" | /files/boot/grub/menu.lst/title[2]/kernel/ro | ... | /files/boot/grub/menu.lst/title[4] = "Windows" | /files/boot/grub/menu.lst/title[4]/rootnoverify = "(hd0,0)" | /files/boot/grub/menu.lst/title[4]/chainloader = "+1" | | Looks like each boot option is created as in array format in the title | branch of the tree, with a value of the actual title of the boot | option. That makes finding just the Windows one very easy, however it | depends on you knowing the title of the kernel option, which I'm going | to assume you do. | | augtool> print /files/boot/grub/menu.lst/title[.="Windows"] | /files/boot/grub/menu.lst/title[4] = "Windows" | /files/boot/grub/menu.lst/title[4]/rootnoverify = "(hd0,0)" | /files/boot/grub/menu.lst/title[4]/chainloader = "+1" | | The period in the path expression /files/boot/grub/menu.lst/ | title[.="Windows"] is a shortcut for self::*, which is tree node | 'title' in this case, so in laymans terms "print title where title = | Windows". | | As a learning exercise lets assume we don't know the title of the | Windows Grub option, but we assume that anything that has | "chainloader= | +1" we need to do something with, we can use this path expression, | which says "child tree nodes of the name 'chainloader' with the value | '+1'". | | augtool> print /files/boot/grub/menu.lst/ | title[child::chainloader="+1"] | /files/boot/grub/menu.lst/title[4] = "Windows" | /files/boot/grub/menu.lst/title[4]/rootnoverify = "(hd0,0)" | /files/boot/grub/menu.lst/title[4]/chainloader = "+1" | | It can be simplified by dropping the "child::" bit, which is an augeas | shortcut: | | augtool> print /files/boot/grub/menu.lst/title[chainloader="+1"] | /files/boot/grub/menu.lst/title[4] = "Windows" | /files/boot/grub/menu.lst/title[4]/rootnoverify = "(hd0,0)" | /files/boot/grub/menu.lst/title[4]/chainloader = "+1" | | Back to your example, adding the savedefault node: | | augtool> ins savedefault after /files/boot/grub/menu.lst/ | title[.="Windows"]/chainloader | augtool> print /files/boot/grub/menu.lst/title[.="Windows"] | /files/boot/grub/menu.lst/title[4] = "Windows" | /files/boot/grub/menu.lst/title[4]/rootnoverify = "(hd0,0)" | /files/boot/grub/menu.lst/title[4]/chainloader = "+1" | /files/boot/grub/menu.lst/title[4]/savedefault | augtool> save | Saved 1 file(s) | augootl> quit | [root@biguml-laptop ~]# tail -n 4 /boot/grub/grub.conf | title Windows | rootnoverify (hd0,0) | chainloader +1 | savedefault | | Looks good. | | You piqued my interest with the savedefault option though so I looked | it up. Are you sure you don't want it on every kernel boot option so | if you change into different Linux kernels it remembers them as well? | | You can do that with augeas too, using a combination of setm and | clearm (set multiple and clear multiple). | | First use setm to create the 'savedefault' node as a child of all | 'title' nodes and then clear the value of these node, as the | 'savedefault' option doesn't have a value: | | augtool> setm /files/boot/grub/menu.lst/title savedefault 1 | augtool> clearm /files/boot/grub/menu.lst/title savedefault | augtool> save | Saved 1 file(s) | | [root@biguml-laptop ~]# cat /boot/grub/grub.conf | # grub.conf generated by anaconda | # | # Note that you do not have to rerun grub after making changes to this | file | # NOTICE: You have a /boot partition. This means that | # all kernel and initrd paths are relative to /boot/, eg. | # root (hd0,0) | # kernel /vmlinuz-version ro root=/dev/mapper/vg_root-lv_root | # initrd /initrd-[generic-]version.img | #boot=/dev/sda | default=0 | timeout=0 | splashimage=(hd0,0)/grub/splash.xpm.gz | hiddenmenu | title Fedora (2.6.40.6-0.fc15.x86_64) | root (hd0,0) | kernel /vmlinuz-2.6.40.6-0.fc15.x86_64 ro root=/dev/mapper/vg_root- | lv_root rd_LUKS_UUID=luks-08041027-ab79-4f45-87b0-756d1eeb26e5 | rd_LVM_LV=vg_root/lv_root rd_NO_MD rd_NO_DM LANG=en_GB.UTF-8 | SYSFONT=latarcyrheb-sun16 KEYTABLE=uk rhgb quiet | initrd /initramfs-2.6.40.6-0.fc15.x86_64.img | savedefault | title Windows | rootnoverify (hd0,0) | chainloader +1 | savedefault | | | There we go. | | You might run into a problem using setm in Puppet, probably clearm as | well, as I don't think ruby-augeas supports it prop
Re: [Puppet Users] Re: Setting savedefult options with augeas/puppet (SOLVED)
The following class seems to do exactly what I needed it to do. It sets the default context to saved and creates a savedefault parameter for the Windows entry that exists. This method also does not require a onlyif if statement which is much better than the ins after option that was proposed by Luke although his detailed explaination is still very much welcomed. I just did it a different way. ;) class windows_default_boot { augeas{ "set_windows_to_default" : context => "/files/etc/grub.conf", changes => [ "set /files/etc/grub.conf/default saved", "set /files/etc/grub.conf/title[.='Windows']/savedefault 0", "clear /files/etc/grub.conf/title[.='Windows']/savedefault",], } } Thanks again! -- James A. Peltier IT Services - Research Computing Group Simon Fraser University - Burnaby Campus Phone : 778-782-6573 Fax : 778-782-3045 E-Mail : jpelt...@sfu.ca Website : http://www.sfu.ca/itservices http://blogs.sfu.ca/people/jpeltier I will do the best I can with the talent I have -- 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: Setting savedefult options with augeas/puppet
- Original Message - | | You piqued my interest with the savedefault option though so I | | looked | | it up. Are you sure you don't want it on every kernel boot option so | | if you change into different Linux kernels it remembers them as | | well? BTW: No, this is not what this is intended to do. This is intended to allow us to define which machines should boot Windows by default only. Setting the savedefault parameter on all would not perform the steps we want. -- James A. Peltier IT Services - Research Computing Group Simon Fraser University - Burnaby Campus Phone : 778-782-6573 Fax : 778-782-3045 E-Mail : jpelt...@sfu.ca Website : http://www.sfu.ca/itservices http://blogs.sfu.ca/people/jpeltier I will do the best I can with the talent I have -- 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 doesn't work with symbolic link module folder?
I found that my puppet didn't work if I used symbolic link for multi-environment directory. Here is my directory structure. VM stands for virtual machine, which I used to test my puppet scripts. + /etc/puppet + environments + vm + manifests - site.pp + modules + dev ... + manifests + modules If I create a symbolic link like this $ ln -s /home/bewang/ws-puppet/environments /etc/puppet/environments site.pp won't be read by puppet agent. If I copy the directory to /etc/puppet, everything just works smoothly. I'm wondering why puppet doesn't read symbolic link. Thanks. Ben -- 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] Cannot find puppetd.log and puppetmasterd.log.
I'm a newbie of puppet. I'm curious why I cannot find puppetd.log and puppetmasterd.log? I can only find httpd.log and masterhttpd.log in /var/log/puppet. What could be wrong? 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.