bartavelle / language-puppet

A library to work with Puppet manifests, test them and eventually replace everything ruby.
BSD 3-Clause "New" or "Revised" License
51 stars 8 forks source link

Internal error: invalid invariant at loadParameters #146

Closed sylvainfaivre closed 9 years ago

sylvainfaivre commented 9 years ago

ERROR: (fqdn.domain) : Internal error: invalid invariant at loadParameters at # ./modules/mysql/manifests/shell.pp:1:1

here is the source file ./modules/mysql/manifests/shell.pp :

define mysql::shell($username, $password, $databases, $ensure = present)
{
    if($ensure == present)
    {
        user { $title:
            password   => '!',
            gid        => 'dba',
            home       => "/home/$title",
            managehome => true,
            shell      => "/usr/local/bin/mysql_shell_$title.sh";
        }
        file {
            "/usr/local/bin/mysql_shell_$title.sh":
                content => template('mysql/mysql_shell.sh.erb'),
                mode    => '0750',
                owner   => 'root',
                group   => 'dba';
            "/etc/mysql/$title.cnf":
                content => template('mysql/mysql_auth.cnf.erb'),
                mode    => '0440',
                owner   => $title,
                group   => 'dba';
        }
    }
    else
    {
        user { $title: ensure => absent; }
        file {
            "/usr/local/bin/mysql_shell_$title.sh":
                ensure => absent;
            "/etc/mysql/$title.cnf":
                ensure => absent;
            "/etc/ssh/keys/$title":
                ensure => absent;
        }
    }
}
bartavelle commented 9 years ago

I can't reproduce it, but this should have something to do with default values. Can you produce a minimal tarball that would let me reproduce the problem ?

PierreR commented 9 years ago

The fix has broken my tests ;-) I believe this is because of #125 as I get the following error:

$worker_processes must be an integer or have value "auto". at # ./modules/nginx/manifests/config.pp:106:5
bartavelle commented 9 years ago

What about now ?

PierreR commented 9 years ago

Fixed ! Thanks