custom data_binding (module_data) not loading via puppet gem

asked 2014-06-20 16:18:57 -0500

odgrim gravatar image

updated 2014-06-20 16:43:29 -0500

I've had a setup that worked quite well for a while using the default yum puppetlabs puppet package (the one that dumps everything into siteruby). When I tried switching to a gem so we can start moving toward a new ruby I found that a custom databinding in the module_data module wasn't getting pulled up at all (strace revealed they weren't even being read).

What controls where puppet looks for custom in-module libs/data_bindings/hiera backends?

Assume a very basic test module pulled from the net with this junk data:

---
mysql::config_file: '/path/from/data_in_modules'
mysql::manage_config_file: true
mysql::old_root_password: 'password_from_data_in_modules'

and...

class mysql (
      $config_file        = 'module_default',
      $manage_config_file = 'module_default',
      $old_root_password  = 'module_default'
) {
     notify { "The value of config_file: ${config_file}": }
     notify { "The value of manage_config_file: ${manage_config_file}": }
     notify { "The value of old_root_password: ${old_root_password}": }
}

and it works as intended:

# puppet apply /etc/puppet/environments/production/manifests/site.pp
Warning: Config file /etc/puppet/hiera.yaml not found, using Hiera defaults
Notice: Compiled catalog for centos-6-4-compile.opsqa.sjc2.local in environment production in 0.06 seconds
Notice: The value of config_file: /path/from/data_in_modules
Notice: /Stage[main]/Mysql/Notify[The value of config_file: /path/from/data_in_modules]/message: defined 'message' as 'The value of config_file: /path/from/data_in_modules'
Notice: The value of manage_config_file: true
Notice: /Stage[main]/Mysql/Notify[The value of manage_config_file: true]/message: defined 'message' as 'The value of manage_config_file: true'
Notice: The value of old_root_password: password_from_data_in_modules
Notice: /Stage[main]/Mysql/Notify[The value of old_root_password: password_from_data_in_modules]/message: defined 'message' as 'The value of old_root_password: password_from_data_in_modules'
Notice: Finished catalog run in 0.05 seconds

But when using any other ruby and gem permutation (including system+gem, SCL ruby + gem, compiled ruby + gem etc):

# . /opt/rh/ruby193/enable
# which ruby
/opt/rh/ruby193/root/usr/bin/ruby
# /opt/rh/ruby193/root/usr/local/bin/puppet apply /etc/puppet/environments/production/manifests/site.pp
Warning: Config file /etc/puppet/hiera.yaml not found, using Hiera defaults
Notice: Compiled catalog for centos-6-4-compile.opsqa.sjc2.local in environment production in 0.12 seconds
Notice: The value of config_file: module_default
Notice: /Stage[main]/Mysql/Notify[The value of config_file: module_default]/message: defined 'message' as 'The value of config_file: module_default'
Notice: The value of old_root_password: module_default
Notice: /Stage[main]/Mysql/Notify[The value of old_root_password: module_default]/message: defined 'message' as 'The value of old_root_password: module_default'
Notice: The value of manage_config_file: module_default
Notice: /Stage[main]/Mysql/Notify[The value of manage_config_file: module_default]/message: defined 'message' as 'The value of manage_config_file: module_default'
Notice: Finished catalog run in 0.15 seconds
edit retag flag offensive close merge delete