Using 'yum groupinstall' in Puppet

Puppet’s package type doesn’t (currently) support yum’s “grouplist” options for various reasons.  It can still be useful to leverage the yum groups in some cases and like many workarounds in Puppet we can leverage the exec type.

exec { 'yum groupinstall Development Tools':
  command => '/usr/bin/yum -y --disableexcludes=all groupinstall "Development Tools"',
  unless  => '/usr/bin/yum grouplist "Development Tools" | /bin/grep "^Installed"',
  timeout => 600 ,

Update: 2016-03-23

CERIT Scientific Cloud nicely wrapped the exec in a module and published it on the Puppet Forge.  If you use their module you can now use the following syntax:

yum::group { ‘Development Tools’:
  ensure => present,