Install mysql with puppet on vagrant vm

心已入冬 提交于 2019-12-11 13:43:49

问题


I'm trying to install mysql server on a vagrant vm with puppet ,I've added this line on the Vagrant file

config.vm.provision "puppet"

in the same Vagrantfile folder I've created the manifests folder and inside it folder it's default.pp with this content

class { '::mysql::server':
  root_password           => 'root',
  remove_default_accounts => false,
  override_options        => $override_options
}
mysql::db { 'wordpress':
  user     => 'wordpress',
  password => '12345',
  host     => 'localhost',
  grant    => ['ALL'],
}

But I get this error message when I execute vagrant provision

==> default: Running provisioner: puppet...
==> default: Running Puppet with default.pp...
==> default: stdin: is not a tty
==> default: Warning: Setting templatedir is deprecated. See http://links.puppetlabs.com/env-settings-deprecations
==> default:    (at /usr/lib/ruby/vendor_ruby/puppet/settings.rb:1139:in `issue_deprecation_warning')
==> default: Error: Puppet::Parser::AST::Resource failed with error ArgumentError: Could not find declared class ::mysql::server at /tmp/vagrant-puppet/manifests-a11d1078b1b1f2e3bdea27312f6ba513/default.pp:5 on node vagrant-ubuntu-trusty-64.hitronhub.home
==> default: Error: Puppet::Parser::AST::Resource failed with error ArgumentError: Could not find declared class ::mysql::server at /tmp/vagrant-puppet/manifests-a11d1078b1b1f2e3bdea27312f6ba513/default.pp:5 on node vagrant-ubuntu-trusty-64.hitronhub.home
The SSH command responded with a non-zero exit status. Vagrant
assumes that this means the command failed. The output for this command
should be in the log above. Please read the output to determine what
went wrong.

回答1:


puppetlabs-mysql is a puppet module, which means it is not included with the base puppet executable. To use it, you'll need to do a few things:

  1. Create a modules directory in your project for holding puppet modules
  2. Use puppet module install --modulepath modules puppetlabs-mysql to install the MySQL module into the modules directory
  3. Configure module_path for the puppet provisioner in your Vagrantfile


来源:https://stackoverflow.com/questions/30142869/install-mysql-with-puppet-on-vagrant-vm

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!