0

I am having the following issue:

Invalid resource type msql::db at /tmp/vagrant-puppet/manifests-a11d1078b1b1f2e3bdea27312f6ba513/db.pp:6

My manifest (db.pp) is:

include mysql::server

msql::db { "loja":
  schema   => "loja_schema",
  password => "lojasecret",
}

My defined type called mysql::db is in a module called mysql. This module has a manifest folder with init.pp:

class mysql { }

And a file called db.pp where the defined type is:

define mysql::db($schema, $user = $title, $password) {
  #Dependência
  Class['mysql::server'] -> Mysql::db[$title]

  exec { "$title-schema":
    unless  => "mysql -uroot $schema",
    command => "mysqladmin -uroot create $schema",
    path  => "/usr/bin/",
  }

  exec {"$title-user":
    unless  => "mysql -u$user -p$password $schema",
    command => "mysql -uroot -e \"GRANT ALL PRIVILEGES ON \
                                  $schema.* TO '$user'@'%' \
                                  IDENTIFIED BY '$password';\"",
    path    => "/usr/bin/",
    require => Exec["$title-schema"],
  }
}

What it seems to be problem? Thanks.

2

You typed msql::db, that is probably a typo.

I think you probably meant mysql::db.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.