Skip to content

Instantly share code, notes, and snippets.

Created November 14, 2012 09:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/4071123 to your computer and use it in GitHub Desktop.
Save anonymous/4071123 to your computer and use it in GitHub Desktop.
Resources and parameters
database { $name:
ensure => $ensure,
charset => $charset,
provider => 'mysql',
require => Class['mysql::server'],
}
In lib/puppet/provider/database/mysql.rb if I want to use the mysql root password
mysql('-p #{@something['mysql::config::root_password']} -NBe', "create database `#{@resource[:name]}` character set #{resource[:charset]}")
I would actually have to add the type parameter and :
database { $name:
ensure => $ensure,
charset => $charset,
provider => 'mysql',
root_password => mysql::config::root_password,
require => Class['mysql::server'],
}
then
mysql('-p #{@resource[:root_password]} -NBe', "create database `#{@resource[:name]}` character set #{resource[:charset]}")
Right?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment