Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Aleh_Slesarenka_Task2 #7

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions Vagrantfile
Original file line number Diff line number Diff line change
@@ -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
Binary file added client.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added database.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added server.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 28 additions & 0 deletions site.pp
Original file line number Diff line number Diff line change
@@ -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',
}
}

39 changes: 39 additions & 0 deletions usefulcommands.txt
Original file line number Diff line number Diff line change
@@ -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;


Binary file added user.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.