Re: [Puppet Users] exec type doesn't refresh when onlyif is in use
Wouldn't it be easier to use a service definition with the base provider and supply your start, restart status commands? On 30 December 2012 03:27, Jason Edgecombe ja...@rampaginggeek.com wrote: Hi, I'm having trouble with an exec type. I'm using an exec type to start a buildbot slave. It's a long-running pseudo-service. The exec uses the refresh and onlyif. I think that the refresh command isn't running because of the onlyif attribute. I would like a refresh event to fire even if the onlyif attribute is in use. Any help is appreciated. Do I need to split it into two exec's (one normal and another refreshonly)? Here is a snippet from the type definition: == define buildbot::slave::instance( ..., $project_dir, ... ) { $path = ['/usr/local/bin','/usr/bin','**/bin'] $config_files = [$project_dir/info/admin,$** project_dir/info/host] # commands to work with the buildslave $slave_install_command = buildslave create-slave $project_dir $master_host_port $slave_name $slave_password $slave_start_command = buildslave start $project_dir $slave_restart_command = buildslave restart $project_dir $slave_status_command = /bin/kill -0 `/bin/cat $project_dir/twistd.pid` ...snip... exec { $slave_start_command: cwd = $project_dir, path = $path, user = $user, group = $group, unless= $slave_status_command, refresh = $slave_restart_command, require = File[$config_files], subscribe = File[$config_files], } == Here is part of the debug log: Info: /Stage[main]//Buildbot::Slave:**:Instance[openafs1]/File[/** home/buildslave/buildbot/**openafs/info/admin]: Filebucketed /home/buildslave/buildbot/**openafs/info/ad min to puppet with sum 2f840fdf8acf7c334c293c9da08797**21 /Stage[main]//Buildbot::Slave:**:Instance[openafs1]/File[/** home/buildslave/buildbot/**openafs/info/admin]/content: content changed '{md5}**2f840fdf8acf7c334c293c9da08797**21' to '{md5}** 18eca080dfec8ff8fc47a54bf6a962**26' Info: /Stage[main]//Buildbot::Slave:**:Instance[openafs1]/File[/** home/buildslave/buildbot/**openafs/info/admin]: Scheduling refresh of Exec[buildslave start /home/buildslave/buildbot/**openafs] Debug: /Stage[main]//Buildbot::Slave:**:Instance[openafs1]/File[/** home/buildslave/buildbot/**openafs/info/admin]: The container Buildbot::Slave::Instance[**openafs1] will propagate my refresh event Debug: Exec[buildslave start /home/buildslave/buildbot/**openafs](provider=posix): Executing check '/bin/kill -0 `/bin/cat /home/buildslave/buildbot/** openafs/twistd.pid`' Debug: Executing '/bin/kill -0 `/bin/cat /home/buildslave/buildbot/** openafs/twistd.pid`' Debug: Exec[buildslave start /home/buildslave/buildbot/**openafs](provider=posix): Executing check '/bin/kill -0 `/bin/cat /home/buildslave/buildbot/** openafs/twistd.pid`' Debug: Executing '/bin/kill -0 `/bin/cat /home/buildslave/buildbot/** openafs/twistd.pid`' /Stage[main]//Buildbot::Slave:**:Instance[openafs1]/Exec[**buildslave start /home/buildslave/buildbot/**openafs]: Triggered 'refresh' from 1 events Debug: /Stage[main]//Buildbot::Slave:**:Instance[openafs1]/Exec[**buildslave start /home/buildslave/buildbot/**openafs]: The container Buildbot::Slave::Instance[**openafs1] will propagate my refresh event Debug: Buildbot::Slave::Instance[**openafs1]: The container Class[Main] will propagate my refresh event Debug: Class[Main]: The container Stage[main] will propagate my refresh event Thanks, Jason -- 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+unsubscribe@** googlegroups.com puppet-users%2bunsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/** group/puppet-users?hl=enhttp://groups.google.com/group/puppet-users?hl=en . -- Erik Dalén -- 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] exec type doesn't refresh when onlyif is in use
On 12/30/2012 07:53 AM, Erik Dalén wrote: Wouldn't it be easier to use a service definition with the base provider and supply your start, restart status commands? On 30 December 2012 03:27, Jason Edgecombe ja...@rampaginggeek.com wrote: Hi, I'm having trouble with an exec type. I'm using an exec type to start a buildbot slave. It's a long-running pseudo-service. The exec uses the refresh and onlyif. I think that the refresh command isn't running because of the onlyif attribute. I would like a refresh event to fire even if the onlyif attribute is in use. Any help is appreciated. Do I need to split it into two exec's (one normal and another refreshonly)? Here is a snippet from the type definition: == define buildbot::slave::instance( ..., $project_dir, ... ) { $path = ['/usr/local/bin','/usr/bin','**/bin'] $config_files = [$project_dir/info/admin,$** project_dir/info/host] # commands to work with the buildslave $slave_install_command = buildslave create-slave $project_dir $master_host_port $slave_name $slave_password $slave_start_command = buildslave start $project_dir $slave_restart_command = buildslave restart $project_dir $slave_status_command = /bin/kill -0 `/bin/cat $project_dir/twistd.pid` ...snip... exec { $slave_start_command: cwd = $project_dir, path = $path, user = $user, group = $group, unless= $slave_status_command, refresh = $slave_restart_command, require = File[$config_files], subscribe = File[$config_files], } == Here is part of the debug log: Info: /Stage[main]//Buildbot::Slave:**:Instance[openafs1]/File[/** home/buildslave/buildbot/**openafs/info/admin]: Filebucketed /home/buildslave/buildbot/**openafs/info/ad min to puppet with sum 2f840fdf8acf7c334c293c9da08797**21 /Stage[main]//Buildbot::Slave:**:Instance[openafs1]/File[/** home/buildslave/buildbot/**openafs/info/admin]/content: content changed '{md5}**2f840fdf8acf7c334c293c9da08797**21' to '{md5}** 18eca080dfec8ff8fc47a54bf6a962**26' Info: /Stage[main]//Buildbot::Slave:**:Instance[openafs1]/File[/** home/buildslave/buildbot/**openafs/info/admin]: Scheduling refresh of Exec[buildslave start /home/buildslave/buildbot/**openafs] Debug: /Stage[main]//Buildbot::Slave:**:Instance[openafs1]/File[/** home/buildslave/buildbot/**openafs/info/admin]: The container Buildbot::Slave::Instance[**openafs1] will propagate my refresh event Debug: Exec[buildslave start /home/buildslave/buildbot/**openafs](provider=posix): Executing check '/bin/kill -0 `/bin/cat /home/buildslave/buildbot/** openafs/twistd.pid`' Debug: Executing '/bin/kill -0 `/bin/cat /home/buildslave/buildbot/** openafs/twistd.pid`' Debug: Exec[buildslave start /home/buildslave/buildbot/**openafs](provider=posix): Executing check '/bin/kill -0 `/bin/cat /home/buildslave/buildbot/** openafs/twistd.pid`' Debug: Executing '/bin/kill -0 `/bin/cat /home/buildslave/buildbot/** openafs/twistd.pid`' /Stage[main]//Buildbot::Slave:**:Instance[openafs1]/Exec[**buildslave start /home/buildslave/buildbot/**openafs]: Triggered 'refresh' from 1 events Debug: /Stage[main]//Buildbot::Slave:**:Instance[openafs1]/Exec[**buildslave start /home/buildslave/buildbot/**openafs]: The container Buildbot::Slave::Instance[**openafs1] will propagate my refresh event Debug: Buildbot::Slave::Instance[**openafs1]: The container Class[Main] will propagate my refresh event Debug: Class[Main]: The container Stage[main] will propagate my refresh event Thanks, Jason -- 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+unsubscribe@** googlegroups.com puppet-users%2bunsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/** group/puppet-users?hl=enhttp://groups.google.com/group/puppet-users?hl=en . I've thought about that. This is a basically a service, but I can have multiple instances of the process running with different configurations. As I understand, I would need to create a new service script for each instance. Jason -- 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 cloud provisioning and VMware mac address allocation?
Hi all, I've been working on fully automating the VM provisioning for some months now and one piece I could not resolve yet is to automate the dhcp/dns automation and just because I cannot obtain the VM mac address that vsphere/vcenter will allocate to a new vm. I am aware of 3rd party tools such as foreman, but in fact, I am concerned they do not follow puppet release cycle, or it's not their priority ;) I am sure that I am not the first one facing this bottleneck when ~200/300 VMs needs to be created. For theas reason I would like to know from those faced this issue and how they worked it out in an efficient manner. Thanks for sharing your thoughts! Best, Martin -- 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/-/Y5EdQWBTcbMJ. 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] How does facter get ipaddress?
Hi I am running a version 'facterversion = 2.0.0-rc4' do you know if this uses /sbin/ip? does it adapt for ArchLinux which uses puts it in /usr/sbin/ip (judgin from `which ip`) `facter ipaddress` and `facter fqdn` don't work for me. I don't know how to troubleshoot. I just started really reading/playing about puppet today. I also tried the latest version available from rubygems and it still can't find the ipadress or fqdn. What could be the possible problems? On Friday, 30 November 2012 14:19:28 UTC+2, Ashley Penney wrote: On Fri, Nov 30, 2012 at 6:59 AM, Bret Wortman br...@thewortmans.orgjavascript: wrote: Aha! The problem is that ifconfig doesn't return anything containing inet addr: in Fedora 17. The output looks like this: eth0: flags=4163UP,BROADCAST,RUNNING,MULTICAST mtu 1500 inet 192.168.2.13 netmask 255.255.255.0 broadcast 192.168.2.255 inet6 fe80::d6be:d9ff:fe92:1df5 prefixlen 64 scopeid 0x20link inet6 2001:470:1d:429:d6be:d9ff:fe92:1df5 prefixlen 64 scopeid 0x0global ether d4:be:d9:92:1d:f5 txqueuelen 1000 (Ethernet) RX packets 15939189 bytes 11636881674 (10.8 GiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 14236195 bytes 2245276793 (2.0 GiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 device interrupt 19 So it falls through to host `hostname`, which isn't available because I need Puppet to configure freeipa-client for me, which it struggles to do. So I guess I have to hardcode the DNS server into my kickstart and then let puppet take care of the resolv.conf after that. I have no idea if it cleanly merges but if you're feeling brave you could grab https://github.com/puppetlabs/facter/pull/267 and see if that magically does the right thing for F17. It uses /sbin/ip in preference to ifconfig, so it should work a lot better. I couldn't get it merged so it's just sat and gotten a little stale but hopefully does 99% of what you need still if you can merge it for testing. -- 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/-/NhkJH68dxEsJ. 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 cloud provisioning and VMware mac address allocation?
On Sun, Dec 30, 2012 at 7:58 PM, mbia...@edrans.com wrote: Hi all, I've been working on fully automating the VM provisioning for some months now and one piece I could not resolve yet is to automate the dhcp/dns automation and just because I cannot obtain the VM mac address that vsphere/vcenter will allocate to a new vm. I am aware of 3rd party tools such as foreman, but in fact, I am concerned they do not follow puppet release cycle, or it's not their priority ;) Do you mind mentioning what do you mean? The foreman team care a lot about our users and puppet community in general I am sure that I am not the first one facing this bottleneck when ~200/300 VMs needs to be created. For theas reason I would like to know from those faced this issue and how they worked it out in an efficient manner. Thanks for sharing your thoughts! Best, Martin -- 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/-/Y5EdQWBTcbMJ. 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] exec type doesn't refresh when onlyif is in use
On 12/30/2012 6:47 AM, Jason Edgecombe wrote: I've thought about that. This is a basically a service, but I can have multiple instances of the process running with different configurations. As I understand, I would need to create a new service script for each instance. Jason We manage many instances of Redis which is somewhat the same problem. I found it simpler to template init scripts and config files in order to use the native types within Puppet. The allows sudo service redis-server-stage restart work without having to refer to documentation or read what inputs the script needs. Also services start normally when the box comes up without having to wait for a Puppet run and makes it simpler to see what should be running on a box or is running. Ramin modules/redis/manifests/server.pp # We use ${port} for the resource declarations and ${name} for # path so that it should be impossible to create conflicting # servers using the same port and/or the same name define redis::server ( $port, $master='localhost', $master_port=$port ) { include redis::params File { owner = root, group = redis, mode = '0640', } file { redis_${port}.conf: ensure = present, path= ${redis::params::configdir}/redis_multi_${name}.conf, content = template('redis/redis_multi.conf.erb'), notify = Service[redis-server-${port}], } file { redis_slave_${port}.conf: ensure = present, path= ${redis::params::configdir}/slave_multi_${name}.conf, content = template('redis/slave_multi.conf.erb'), notify = Service[redis-server-${port}], } file { redis-server-${port}: ensure = present, path= /etc/init.d/redis-server-${name}, content = template('redis/init_multi.erb'), notify = Service[redis-server-${port}], mode= '0755', } service { redis-server-${port}: ensure = running, enable = true, hasrestart = true, hasstatus = $redis::params::hasstatus, name = redis-server-${name}, } nrpe::redis { $name: port = $port, } Class['redis::service'] - Redis::Server[$name] } -- 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] exec type doesn't refresh when onlyif is in use
On 12/30/2012 04:30 PM, Ramin K wrote: On 12/30/2012 6:47 AM, Jason Edgecombe wrote: I've thought about that. This is a basically a service, but I can have multiple instances of the process running with different configurations. As I understand, I would need to create a new service script for each instance. Jason We manage many instances of Redis which is somewhat the same problem. I found it simpler to template init scripts and config files in order to use the native types within Puppet. The allows sudo service redis-server-stage restart work without having to refer to documentation or read what inputs the script needs. Also services start normally when the box comes up without having to wait for a Puppet run and makes it simpler to see what should be running on a box or is running. Ramin modules/redis/manifests/server.pp # We use ${port} for the resource declarations and ${name} for # path so that it should be impossible to create conflicting # servers using the same port and/or the same name define redis::server ( $port, $master='localhost', $master_port=$port ) { include redis::params File { owner = root, group = redis, mode = '0640', } file { redis_${port}.conf: ensure = present, path= ${redis::params::configdir}/redis_multi_${name}.conf, content = template('redis/redis_multi.conf.erb'), notify = Service[redis-server-${port}], } file { redis_slave_${port}.conf: ensure = present, path= ${redis::params::configdir}/slave_multi_${name}.conf, content = template('redis/slave_multi.conf.erb'), notify = Service[redis-server-${port}], } file { redis-server-${port}: ensure = present, path= /etc/init.d/redis-server-${name}, content = template('redis/init_multi.erb'), notify = Service[redis-server-${port}], mode= '0755', } service { redis-server-${port}: ensure = running, enable = true, hasrestart = true, hasstatus = $redis::params::hasstatus, name = redis-server-${name}, } nrpe::redis { $name: port = $port, } Class['redis::service'] - Redis::Server[$name] } Hi Ramin, That's cool, thanks for sharing! I have the double-exec method working for now, and that works for a development VM, but I'll consider this for a future improvement. Thanks, Jason -- 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] How does facter get ipaddress?
On Sun, Dec 30, 2012 at 12:08 PM, Mandla Mbuli lm.mb...@gmail.com wrote: Hi I am running a version 'facterversion = 2.0.0-rc4' do you know if this uses /sbin/ip? does it adapt for ArchLinux which uses puts it in /usr/sbin/ip (judgin from `which ip`) `facter ipaddress` and `facter fqdn` don't work for me. I don't know how to troubleshoot. I just started really reading/playing about puppet today. I also tried the latest version available from rubygems and it still can't find the ipadress or fqdn. What could be the possible problems? The pull request hasn't been merged so I believe it still only uses ifconfig. You'll have to either find a way to install that on arch or try and manually merge the pull request in I'm afraid! -- 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: Home directory dependency problems
I'm sorry for the late reply. I've been on holiday. Your suggestion was exactly what I needed and has helped me in more ways than just the users module. Thank you so 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/-/hq6yEyyEEoQJ. 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: RHEL/Oracle Linux - user creation.
It looks like I need to file a bug report as Oracle change the name of their linux distribution. snippet /usr/lib/ruby/site_ruby/1.8/puppet/provider/user/useradd.rb t def check_manage_home cmd = [] if @resource.managehome? cmd -m elsif %w{Fedora RedHat CentOS OEL OVS}.include?(Facter.value(:operatingsystem)) cmd -M end cmd end /snippet facter output ol6-3:~ # facter operatingsystem OracleLinux ol6-3:~ # /facter output -Mike On Fri, Dec 28, 2012 at 9:58 PM, John Guthrie jguth...@book.com wrote: Also make certain that your shadow-utils package is up to date. Older package version had an issue where they didn't allow puppet to handle non-local user names very well. If your home directories are on a NAS, then I suspect that you might be running into a similar issue as well. I found that updating shadow-utils seemed to fix the issue. John Guthrie jguth...@book.com From: puppet-users@googlegroups.com [puppet-users@googlegroups.com] on behalf of 刘长元 [liucy1...@gmail.com] Sent: Friday, December 28, 2012 10:02 PM To: puppet-users@googlegroups.com Subject: [Puppet Users] Re: RHEL/Oracle Linux - user creation. user resource use managehome attribute to decide if need to create home directory. and it's default value is false, just try, you can check the results. On Saturday, December 29, 2012 4:38:07 AM UTC+8, mi...@mikerochford.com wrote: I am trying to write a manifest that does not create the home directory for the user as it will be on a NAS volume. It seems that RHEL/Oracle requires your explicitly to use the -M options. Is there a way to do this with puppet? This electronic mail message contains information that (a) is or may be CONFIDENTIAL, PROPRIETARY IN NATURE, OR OTHERWISE PROTECTED BY LAW FROM DISCLOSURE, and (b) is intended only for the use of the addressee(s) named herein. If you are not an intended recipient, please contact the sender immediately and take the steps necessary to delete the message completely from your computer system. Not Intended as a Substitute for a Writing: Notwithstanding the Uniform Electronic Transaction Act or any other law of similar effect, absent an express statement to the contrary, this e-mail message, its contents, and any attachments hereto are not intended to represent an offer or acceptance to enter into a contract and are not otherwise intended to bind this sender, barnesandnoble.com llc, barnesandnoble.com inc. or any other person or entity. -- 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] Re: Home directory dependency problems
J slavetonagios: Can you give the group more detail about how it helped you? Stuart On Dec 30, 2012, at 6:36 PM, j slavetonag...@gmail.com wrote: I'm sorry for the late reply. I've been on holiday. Your suggestion was exactly what I needed and has helped me in more ways than just the users module. Thank you so 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/-/hq6yEyyEEoQJ. 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.