I am getting the following error on about every other manual run of
puppet... (hostnames removed)


err: Could not retrieve catalog from remote server: Error 400 on
SERVER: Failed to parse template zabbix/userparameter_mysql_conf.erb:
Could not find value for 'zabbix_mysql_user_parameters' at /etc/puppet/
modules/zabbix/manifests/classes/mysql.pp:7 on node
puppetclient.domain

If I then do another puppet run, I do not receive the error.  It seems
that just about every other manual run during testing of new module
changes has this happen.  This is occuring on ALL my puppet clients
that are using the zabbix::mysql module.  All systems running
Puppet-2.6.8.  Below is the full debug log and my zabbix module.

The $zabbix_mysql_user_parameters variable is optional...right now
only one node has it defined explicitly, like so:

    $zabbix_mysql_user_parameters =  {
        item1 => { 'name' => 'mediawiki.usercount[*]', 'command' =>
'mysql -B -s -e "SELECT count(*) FROM user" $1'},
    }

This is the mysql class for zabbix where the empty variable is defined
so that if no node has it defined it shouldn't fail...


$zabbix_mysql_user_parameters = []

class zabbix::mysql inherits zabbix::agent {

    file {
        "$zabbix_userparameter_config_dir/userparameter_mysql.conf":
            content => template("zabbix/
userparameter_mysql_conf.erb"),
            group   => "zabbix",
            owner   => "zabbix",
            mode    => "600",
            require => Package["zabbix-agent"];

        "$zabbix_user_home_dir/.my.cnf":
            source  => "puppet:///modules/zabbix/.my.cnf",
            group   => "zabbix",
            owner   => "zabbix",
            mode    => "600",
            require => [ Package["zabbix-agent"],
File["$zabbix_user_home_dir"] ];
    }

}


Here's the variables usage in the template...
<% zabbix_mysql_user_parameters.each do |key, value_hash| -%>
UserParameter=<%= value_hash['name'] %>,HOME=<%= zabbix_user_home_dir
%> <%= value_hash['command'] %>
<% end -%>


Would the solution be to make the template call use this instead??

<% if has_variable?("zabbix_mysql_user_parameters") -%>
<% zabbix_mysql_user_parameters.each do |key, value_hash| -%>
UserParameter=<%= value_hash['name'] %>,HOME=<%= zabbix_user_home_dir
%> <%= value_hash['command'] %>
<% end -%>
<% end -%>

Thanks!

- Trey

-- 
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.

Reply via email to