Akom's Tech Ruminations

Various tech outbursts - code and solutions to practical problems

Puppet: recursively delete a Windows Registry key

Posted by Admin • Wednesday, October 14. 2015 • Category: DevOps
Puppet forge has a registry provider that allows one to manage a key or value. What it cannot do is delete a whole tree starting at a particular key. So, hacks to the rescue:


  # deletes the whole tree if it exists
  define registry_wipe_tree($key = $title) {
    exec {"Purge registry $key":
      path => ['c:/windows/system32'],
      command => "reg DELETE \"${key}\" /f",
      onlyif => "reg QUERY \"${key}\"",
    }
  }
 


Now if you want to, say, disable Java auto-update:

registry_wipe_tree{'HKLM\SOFTWARE\JavaSoft\Java Update':}
registry_wipe_tree{'HKLM\SOFTWARE\Wow6432Node\JavaSoft\Java Update': }
 

Linux Jenkins Swarm Slaves on Windows using Puppet

Posted by Admin • Monday, October 12. 2015 • Category: DevOps, Linux
Jenkins Swarm plugin is great, and instrumentation for Linux is fairly well-known, but what about Windows? Here is one approach for setting it up as a windows sevice (what we want Puppet to do):
  1. Download Swarm jar
  2. Download winsw from Kohsuke
  3. Rename winsw to jenkins_swarm.exe
  4. Create jenkins_swarm.xml
  5. Run jenkins_swarm.exe install
  6. Start service
Now for the details

Continue reading "Jenkins Swarm Slaves on Windows using Puppet"

Linux Jenkins Windows Slaves cannot install JDK

Posted by Admin • Monday, October 12. 2015 • Category: DevOps, Linux
Despite making the jenkins slave user a local administrator. The slave runs tools\hudson.model.JDK\JDK_1.7\jdk.exe (or 1.6), and fails (see the extended post body for the log).

If you're seeing Error 1722.There is a problem with this Windows Installer package, then most likely you have another (newer?) version of this JDK installed system-wide. Uninstall from Control Panel, try again.

Continue reading "Jenkins Windows Slaves cannot install JDK"