Augeas Bug while playing with ” in /etc/default/grub

Today seems to be the day of buggy software. I am using the Puppet module herculesteam/augeasproviders_grub to manage entries in /etc/default/grub on Debian and CentOS systems, here is an example:

  $elevator = $::virtual ? { 
    'kvm'       => 'noop',
    'physical'  => 'deadline',
    'openvzhn'  => 'deadline',
  }
  Kernel_parameter {
    ensure    => present,
    provider  => 'grub2',
  }
  kernel_parameter { 'quiet':
  }
  kernel_parameter { 'elevator':
    value => $elevator,
  }
  kernel_parameter {'LANG':
    value => 'en_US.UTF-8',
  }
  kernel_parameter {'KEYBOARDTYPE':
    value => 'pc',
  }
  kernel_parameter {'KEYTABLE':
    value => 'de-latin1-nodeadkeys',
  }

This should result in the following line in /etc/default/grub:
GRUB_CMDLINE_LINUX_DEFAULT="nomodeset elevator=noop KEYBOARDTYPE=pc KEYTABLE=de-latin1-nodeadkeys LANG=en_US.UTF-8 quiet"

This works fine, but once every two months it fails and Puppet creates the following line (inserted quote):
GRUB_CMDLINE_LINUX_DEFAULT="nomodeset" elevator=noop KEYBOARDTYPE=pc KEYTABLE=de-latin1-nodeadkeys LANG=en_US.UTF-8 quiet"

I’ve seen this issue on multiple machines in the past half year, but I’m unable to reproduce it. It seems to happen totally random. I’m currently running Puppet 3.8.4 with future parser on all machines. My Augeas/Ruby Versions are:

Debian:
$ dpkg -l | grep augeas; puppet --version; ruby --version
ii augeas-lenses 1.2.0-0.2 all Set of lenses needed by libaugeas0 to parse config files
ii augeas-tools 1.2.0-0.2 amd64 Augeas command line tools
ii libaugeas-ruby 0.5.0-2 all Transitional package for ruby-augeas
ii libaugeas0 1.2.0-0.2 amd64 Augeas configuration editing library and API
ii ruby-augeas 0.5.0-2+b2 amd64 Augeas bindings for the Ruby language
3.8.4
ruby 2.1.5p273 (2014-11-13) [x86_64-linux-gnu]

CentOS:
$ rpm -qa | grep augeas; puppet --version; ruby --version
augeas-libs-1.1.0-17.el7.x86_64
ruby-augeas-0.5.0-1.el7.x86_64
3.8.4
ruby 2.0.0p598 (2014-11-13) [x86_64-linux]

The Augeas team released a new version of their module a few days ago, which I justed installed. If you ever wanted to know how to update your modules via puppet itself (without fancy r10k magic):

# puppet module upgrade herculesteam-augeasproviders_grub
Notice: Preparing to upgrade 'herculesteam-augeasproviders_grub' ...
Notice: Found 'herculesteam-augeasproviders_grub' (v2.0.1) in /etc/puppet/environments/production/modules ...
Notice: Downloading from https://forgeapi.puppetlabs.com ...
Notice: Upgrading -- do not interrupt ...
/etc/puppet/environments/production/modules
└── herculesteam-augeasproviders_grub (v2.0.1 -> v2.1.0)

I’ve no clue on how to debug this. Any thoughts? I will create a bug report if this happens again in the future.

This entry was posted in 30in30, General, Linux, Puppet. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.