From ccc216175109fa6e53b0f6a6f319351b79a1b25b Mon Sep 17 00:00:00 2001 From: root Date: Fri, 14 Apr 2017 01:32:33 +0300 Subject: [PATCH] task2 --- README.md | 10 +++++++++- Vagrantfile | 24 ++++++++++++++++++++++++ site.pp | 20 ++++++++++++++++++++ 3 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 Vagrantfile create mode 100644 site.pp diff --git a/README.md b/README.md index 0070298..1f45343 100644 --- a/README.md +++ b/README.md @@ -1 +1,9 @@ -# lesson12 \ No newline at end of file +# lesson12 + +SHOW DATABASES; ++--------------------+ +| Database | ++--------------------+ +| information_schema | +| test_mdb | ++--------------------+ diff --git a/Vagrantfile b/Vagrantfile new file mode 100644 index 0000000..ca23505 --- /dev/null +++ b/Vagrantfile @@ -0,0 +1,24 @@ +# -*- mode: ruby -*- +# vi: set ft=ruby : + +$vm1_ip="192.168.56.107" +#$cookbook_dir="~/chef/task7/cookbooks" +Vagrant.configure(2) do |config| + + config.vm.define "vm7" do |vm7_config| + vm7_config.vm.box = "sbeliakou/centos-6.8-x86_64" + vm7_config.vm.network "private_network", ip: $vm1_ip + vm7_config.vm.hostname = "vm7.mnt.com" + vm7_config.vm.provider "virtualbox" do |v| + v.name = "vm7" + v.customize ["modifyvm", :id, "--memory", 2048] + v.customize ["modifyvm", :id, "--natdnshostresolver1", "on"] + end +# config.vm.provision "chef_solo" do |chef| +# chef.cookbooks_path = $cookbook_dir +# chef.add_recipe "java::default" +# chef.add_recipe "jboss::default" +# end + #vm7_config.vm.synced_folder "~/chef", "/var/chef" #, type: "nfs" + end +end diff --git a/site.pp b/site.pp new file mode 100644 index 0000000..68c8be8 --- /dev/null +++ b/site.pp @@ -0,0 +1,20 @@ +node vm7.mnt.com { + class {'::mysql::server': + root_password => 'rootroot', + } + mysql_database {'test_mdb': + ensure => present, + charset => 'utf8', + } + mysql_user { 'test_user@localhost': + ensure => present, + password_hash => mysql_password('testtest'), + } + mysql_grant {'test_user@localhost/test_mdb.*': + ensure => present, + options => ['GRANT'], + privileges => ['ALL'], + table => 'test_mdb.*', + user => 'test_user@localhost', + } +}