diff --git a/Vagrantfile b/Vagrantfile new file mode 100644 index 0000000..2dc82dd --- /dev/null +++ b/Vagrantfile @@ -0,0 +1,19 @@ + +Vagrant.configure("2") do |config| + config.vm.box = "centos/7" +#config.vm.network "public_network", bridge: "eno1",use_dhcp_assigned_default_route: true +config.vm.define "VM1" do |vm1| + vm1.vm.hostname ="CentOS7.1" + vm1.vm.network "private_network", ip:"192.168.100.100" + vm1.vm.provider :virtualbox do |vb| + vb.customize ["modifyvm", :id, "--memory", "4096"] + end +end + config.vm.define "VM2" do |vm2| + vm2.vm.hostname ="CentOS2" + vm2.vm.network "private_network", ip:"192.168.100.101" + vm2.vm.provider :virtualbox do |vb| + vb.customize ["modifyvm", :id, "--memory", "2048"] + end +end +end diff --git a/client.png b/client.png new file mode 100644 index 0000000..5f8446c Binary files /dev/null and b/client.png differ diff --git a/database.png b/database.png new file mode 100644 index 0000000..d166787 Binary files /dev/null and b/database.png differ diff --git a/server.png b/server.png new file mode 100644 index 0000000..7c0e76e Binary files /dev/null and b/server.png differ diff --git a/site.pp b/site.pp new file mode 100644 index 0000000..a7e617e --- /dev/null +++ b/site.pp @@ -0,0 +1,28 @@ +node 'CentOS2' { + class { '::mysql::server': + root_password => 'newpassword', + override_options => { + 'mysqld' => { 'max_connections' => '1024' } + }, + } + + include ::mysql::server::account_security + + mysql_database { 'test_mdb': + ensure => present, + charset => 'utf8', + } + + mysql_user { 'test_user@localhost': + ensure => present, + } + + mysql_grant { 'test_user@localhost/test_mdb.*': + ensure => present, + options => ['GRANT'], + privileges => ['ALL'], + table => 'test_mdb.*', + user => 'test_user@localhost', + } +} + diff --git a/usefulcommands.txt b/usefulcommands.txt new file mode 100644 index 0000000..932ab2c --- /dev/null +++ b/usefulcommands.txt @@ -0,0 +1,39 @@ +For Server: + + sudo rpm -Uvh https://yum.puppetlabs.com/puppetlabs-release-pc1-el-7.noarch.rpm + + yum install -y puppetserver + + systemctl start puppetserver + + systemctl status puppetserver + + sudo /opt/puppetlabs/bin/puppet cert list + + puppet cert list -all + +For Client: + + sudo rpm -Uvh https://yum.puppetlabs.com/puppetlabs-release-pc1-el-7.noarch.rpm + + sudo yum install puppet-agent + + vi /etc/puppetlabs/puppet/puppet.conf + + vi /etc/hosts + + sudo /opt/puppetlabs/bin/puppet agent --test + +For Database: + + puppet module install puppetlabs-mysql + + vi /etc/puppetlabs/code/environments/production/manifests/site.pp + + sudo /opt/puppetlabs/bin/puppet agent --test + + show databases; + + select user from mysql.user; + + diff --git a/user.png b/user.png new file mode 100644 index 0000000..af02386 Binary files /dev/null and b/user.png differ