diff --git a/README.md b/README.md index 0070298..f956c0c 100644 --- a/README.md +++ b/README.md @@ -1 +1,23 @@ -# lesson12 \ No newline at end of file +# lesson12 +My workflow: + +1. Deployed two VMs (Centos 7) from Vagrantfile +2. On the first VM edited the memory settings (2.5 GB RAM), IP, hostname (puppet-srv.minsk.epam.com) -- future puppet master +3. On the second VM changed IP, hostname (puppet-agent.minsk.epam.com) -- future puppet agent +4. Changed /etc/hosts (because VMs must see each other), disabled selinux (/etc/selinux/config -- "SELINUX=disabled"), rebooted VMs +5. Added repo for puppet-srv => rpm -Uvh http://yum.puppetlabs.com/puppetlabs-release-el-7.noarch.rpm; yum install puppet-server +6. Added repo for puppet-agent => rpm -Uvh http://yum.puppetlabs.com/puppetlabs-release-el-7.noarch.rpm); yum install puppet +7. Edited conf files for both VMs => vim /etc/puppet/puppet.conf (in puppet-srv added dns_alt_names=puppet-srv.minsk.epam.com in main section, in puppet-agent added server=puppet-srv.minsk.epam.com in main section) +8. Started both puppetmaster and puppet. +9. Looked at all certs on puppet-srv => puppet cert list -a +10. Signed a puppet-agent on puppet-srv => puppet cert sign puppet-agent.minsk.epam.com +11. Installed mysql with the help of puppet modules (mysql v3.10.0) => puppet module install puppetlabs-mysql +12. Created a manifest to describe a configuration => vim /etc/puppet/manifests/site.pp (is attached here) +13. On the puppet-agent performed a command to apply changes => puppet agent --test +14. Logged into database with mentioned credentials. + +<<<<<<< HEAD +======= + + +>>>>>>> 241683570e3ae6c8d63d6348b9483bb61e02fd07 diff --git a/agent/.vagrant/machines/default/virtualbox/action_provision b/agent/.vagrant/machines/default/virtualbox/action_provision new file mode 100644 index 0000000..01b192e --- /dev/null +++ b/agent/.vagrant/machines/default/virtualbox/action_provision @@ -0,0 +1 @@ +1.5:f285dbb2-10b3-4502-a466-c21a8253cffc \ No newline at end of file diff --git a/agent/.vagrant/machines/default/virtualbox/action_set_name b/agent/.vagrant/machines/default/virtualbox/action_set_name new file mode 100644 index 0000000..12d20a3 --- /dev/null +++ b/agent/.vagrant/machines/default/virtualbox/action_set_name @@ -0,0 +1 @@ +1492100347 \ No newline at end of file diff --git a/agent/.vagrant/machines/default/virtualbox/creator_uid b/agent/.vagrant/machines/default/virtualbox/creator_uid new file mode 100644 index 0000000..e37d32a --- /dev/null +++ b/agent/.vagrant/machines/default/virtualbox/creator_uid @@ -0,0 +1 @@ +1000 \ No newline at end of file diff --git a/agent/.vagrant/machines/default/virtualbox/id b/agent/.vagrant/machines/default/virtualbox/id new file mode 100644 index 0000000..9ad95d2 --- /dev/null +++ b/agent/.vagrant/machines/default/virtualbox/id @@ -0,0 +1 @@ +f285dbb2-10b3-4502-a466-c21a8253cffc \ No newline at end of file diff --git a/agent/.vagrant/machines/default/virtualbox/index_uuid b/agent/.vagrant/machines/default/virtualbox/index_uuid new file mode 100644 index 0000000..7102828 --- /dev/null +++ b/agent/.vagrant/machines/default/virtualbox/index_uuid @@ -0,0 +1 @@ +81ebb5bd67644051b3a5b2c1a3775b77 \ No newline at end of file diff --git a/agent/.vagrant/machines/default/virtualbox/private_key b/agent/.vagrant/machines/default/virtualbox/private_key new file mode 100644 index 0000000..a0a8bc3 --- /dev/null +++ b/agent/.vagrant/machines/default/virtualbox/private_key @@ -0,0 +1,27 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIEpQIBAAKCAQEAy1xChb6PSZcL22br2sAew1YIZo2StA17K8Ft+GnGVUc+tk7s +r5VUpCt+NF8/YGlLvsWWTROeOSt1SRpZ5Nb8pX9jv1eZhxZv7zip5Fqy84Z4jt60 +UiYNjPRrPd3FfenALlGsE0H9sZG00Bwy/rR4wgZxes6n1Y6MzvSrjdSnV6E2n1dj +ejWtXn1nE//24pf2iRD6toRsnX9HrTwdL3l8buXayG1C8V/lnV9Ue0nv3u9NnwBP +vCHNeBmccMdXbMJ4sYHivR/1iiRqnrrxEPIW1iG/fnJsh1WUzl7dqtJIrFaW+cai +flB2xwbBGpBIx1/6MZGUPH/2OlCwHsGXkR08zQIDAQABAoIBAQCXd09A6I824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Ohdkw/D7o7909Fmb851U5SlC24JVFo76Nv +RSdQ5FpBkFImb59otav31hnZl/RIFm1IYACB3SfI/GKvh8ig/qsZqha+oq9NUR3x +sFuTq0dDkArsg71GVhrsLY/LPw2eei4jfQD13kiNwZHW2f4wqsftQFg= +-----END RSA PRIVATE KEY----- diff --git a/agent/.vagrant/machines/default/virtualbox/synced_folders b/agent/.vagrant/machines/default/virtualbox/synced_folders new file mode 100644 index 0000000..b2658ae --- /dev/null +++ b/agent/.vagrant/machines/default/virtualbox/synced_folders @@ -0,0 +1 @@ +{"rsync":{"/vagrant":{"type":"rsync","guestpath":"/vagrant","hostpath":"/home/student/PUPPET_LABS/Lab2/agent","disabled":false,"__vagrantfile":true,"owner":"vagrant","group":"vagrant"}}} \ No newline at end of file diff --git a/agent/Vagrantfile b/agent/Vagrantfile new file mode 100644 index 0000000..97619ea --- /dev/null +++ b/agent/Vagrantfile @@ -0,0 +1,72 @@ +# -*- mode: ruby -*- +# vi: set ft=ruby : + +# All Vagrant configuration is done below. The "2" in Vagrant.configure +# configures the configuration version (we support older styles for +# backwards compatibility). Please don't change it unless you know what +# you're doing. +Vagrant.configure("2") do |config| + # The most common configuration options are documented and commented below. + # For a complete reference, please see the online documentation at + # https://docs.vagrantup.com. + + # Every Vagrant development environment requires a box. You can search for + # boxes at https://atlas.hashicorp.com/search. + config.vm.box = "centos/7" + config.vm.hostname = "puppet-agent" + + # Disable automatic box update checking. If you disable this, then + # boxes will only be checked for updates when the user runs + # `vagrant box outdated`. This is not recommended. + # config.vm.box_check_update = false + + # Create a forwarded port mapping which allows access to a specific port + # within the machine from a port on the host machine. In the example below, + # accessing "localhost:8080" will access port 80 on the guest machine. + # config.vm.network "forwarded_port", guest: 80, host: 8080 + + # Create a private network, which allows host-only access to the machine + # using a specific IP. + config.vm.network "private_network", ip: "192.168.99.100" + + # Create a public network, which generally matched to bridged network. + # Bridged networks make the machine appear as another physical device on + # your network. + # config.vm.network "public_network" + + # Share an additional folder to the guest VM. The first argument is + # the path on the host to the actual folder. The second argument is + # the path on the guest to mount the folder. And the optional third + # argument is a set of non-required options. + # config.vm.synced_folder "../data", "/vagrant_data" + + # Provider-specific configuration so you can fine-tune various + # backing providers for Vagrant. These expose provider-specific options. + # Example for VirtualBox: + # + #config.vm.provider "virtualbox" do |vb| + # # Display the VirtualBox GUI when booting the machine + # vb.gui = true + # + # # Customize the amount of memory on the VM: + # vb.memory = "2500" + # end + # + # View the documentation for the provider you are using for more + # information on available options. + + # Define a Vagrant Push strategy for pushing to Atlas. Other push strategies + # such as FTP and Heroku are also available. See the documentation at + # https://docs.vagrantup.com/v2/push/atlas.html for more information. + # config.push.define "atlas" do |push| + # push.app = "YOUR_ATLAS_USERNAME/YOUR_APPLICATION_NAME" + # end + + # Enable provisioning with a shell script. Additional provisioners such as + # Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the + # documentation for more information about their specific syntax and use. + # config.vm.provision "shell", inline: <<-SHELL + # apt-get update + # apt-get install -y apache2 + # SHELL +end diff --git a/mysql1.png b/mysql1.png new file mode 100644 index 0000000..1bd5170 Binary files /dev/null and b/mysql1.png differ diff --git a/mysql2.png b/mysql2.png new file mode 100644 index 0000000..468908f Binary files /dev/null and b/mysql2.png differ diff --git a/mysql3.png b/mysql3.png new file mode 100644 index 0000000..37e942c Binary files /dev/null and b/mysql3.png differ diff --git a/server/.vagrant/machines/default/virtualbox/action_provision b/server/.vagrant/machines/default/virtualbox/action_provision new file mode 100644 index 0000000..84593a9 --- /dev/null +++ b/server/.vagrant/machines/default/virtualbox/action_provision @@ -0,0 +1 @@ +1.5:61ac0801-9cd4-4e4b-9696-b496ac13da7c \ No newline at end of file diff --git a/server/.vagrant/machines/default/virtualbox/action_set_name b/server/.vagrant/machines/default/virtualbox/action_set_name new file mode 100644 index 0000000..acaa180 --- /dev/null +++ b/server/.vagrant/machines/default/virtualbox/action_set_name @@ -0,0 +1 @@ +1492100345 \ No newline at end of file diff --git a/server/.vagrant/machines/default/virtualbox/creator_uid b/server/.vagrant/machines/default/virtualbox/creator_uid new file mode 100644 index 0000000..e37d32a --- /dev/null +++ b/server/.vagrant/machines/default/virtualbox/creator_uid @@ -0,0 +1 @@ +1000 \ No newline at end of file diff --git a/server/.vagrant/machines/default/virtualbox/id b/server/.vagrant/machines/default/virtualbox/id new file mode 100644 index 0000000..c8d0d77 --- /dev/null +++ b/server/.vagrant/machines/default/virtualbox/id @@ -0,0 +1 @@ +61ac0801-9cd4-4e4b-9696-b496ac13da7c \ No newline at end of file diff --git a/server/.vagrant/machines/default/virtualbox/index_uuid b/server/.vagrant/machines/default/virtualbox/index_uuid new file mode 100644 index 0000000..d45e103 --- /dev/null +++ b/server/.vagrant/machines/default/virtualbox/index_uuid @@ -0,0 +1 @@ +e942f133975e425a8624f9302c1a323a \ No newline at end of file diff --git a/server/.vagrant/machines/default/virtualbox/private_key b/server/.vagrant/machines/default/virtualbox/private_key new file mode 100644 index 0000000..8d412a1 --- /dev/null +++ b/server/.vagrant/machines/default/virtualbox/private_key @@ -0,0 +1,27 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIEpQIBAAKCAQEA8zYdYAPPHzXnMdeiUGe6xq0UaUpMgHJHzWHAx8ouvmyclMa1 +Z3E8AZ7AaSFgHBLFk6CA5rIXvI9fxcwdU47dCkUxTquh7/ibXCB6cn/h6VAUamjh +9Wr4CZt6khmyIsGUf8Go5VQNPqlHZkaNGdZqUe7RrZrvh37MQEqVQ+cUwwl6r0xU +hrDRkeJwaZvb7v+s8Jsf/bFJiEJS3PgiUIKmtIXKT4ZwZ10c3u9N2ccCDx4LljVE +2r7FegCqpuCnJ1c/YjTZLNFix+Wk+XbuPIqsMzdd2D2bKlR+sU7i3JfeCWEXXqt3 +E/sPn6c8pRqCj9DyHzfhFxq+MsOBz19EZV5iYwIDAQABAoIBAQDkYcuBzvHfB/n6 +9tdHk7BzQjIpkQh3kVjVhtbFhZkRXeJHXrUX1uAXUWCzGBEtK3922kBQ4amieivg +DIT5Yu0z6LedfVQ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epQOZBW95Y/YCrcY3HZ5v4IhpQE03lcZ +YlxWIJA0CEN/doT86zLgXU2frt9q49mulhQ4cmHff2ustbgy4Ki2KRU= +-----END RSA PRIVATE KEY----- diff --git a/server/.vagrant/machines/default/virtualbox/synced_folders b/server/.vagrant/machines/default/virtualbox/synced_folders new file mode 100644 index 0000000..ab6d7d0 --- /dev/null +++ b/server/.vagrant/machines/default/virtualbox/synced_folders @@ -0,0 +1 @@ +{"rsync":{"/vagrant":{"type":"rsync","guestpath":"/vagrant","hostpath":"/home/student/PUPPET_LABS/Lab2/server","disabled":false,"__vagrantfile":true,"owner":"vagrant","group":"vagrant"}}} \ No newline at end of file diff --git a/server/Vagrantfile b/server/Vagrantfile new file mode 100644 index 0000000..978b869 --- /dev/null +++ b/server/Vagrantfile @@ -0,0 +1,72 @@ +# -*- mode: ruby -*- +# vi: set ft=ruby : + +# All Vagrant configuration is done below. The "2" in Vagrant.configure +# configures the configuration version (we support older styles for +# backwards compatibility). Please don't change it unless you know what +# you're doing. +Vagrant.configure("2") do |config| + # The most common configuration options are documented and commented below. + # For a complete reference, please see the online documentation at + # https://docs.vagrantup.com. + + # Every Vagrant development environment requires a box. You can search for + # boxes at https://atlas.hashicorp.com/search. + config.vm.box = "centos/7" + config.vm.hostname = "puppet-srv" + + # Disable automatic box update checking. If you disable this, then + # boxes will only be checked for updates when the user runs + # `vagrant box outdated`. This is not recommended. + # config.vm.box_check_update = false + + # Create a forwarded port mapping which allows access to a specific port + # within the machine from a port on the host machine. In the example below, + # accessing "localhost:8080" will access port 80 on the guest machine. + # config.vm.network "forwarded_port", guest: 80, host: 8080 + + # Create a private network, which allows host-only access to the machine + # using a specific IP. + config.vm.network "private_network", ip: "192.168.99.99" + + # Create a public network, which generally matched to bridged network. + # Bridged networks make the machine appear as another physical device on + # your network. + # config.vm.network "public_network" + + # Share an additional folder to the guest VM. The first argument is + # the path on the host to the actual folder. The second argument is + # the path on the guest to mount the folder. And the optional third + # argument is a set of non-required options. + # config.vm.synced_folder "../data", "/vagrant_data" + + # Provider-specific configuration so you can fine-tune various + # backing providers for Vagrant. These expose provider-specific options. + # Example for VirtualBox: + # + config.vm.provider "virtualbox" do |vb| + # # Display the VirtualBox GUI when booting the machine + # vb.gui = true + # + # # Customize the amount of memory on the VM: + vb.memory = "2500" + end + # + # View the documentation for the provider you are using for more + # information on available options. + + # Define a Vagrant Push strategy for pushing to Atlas. Other push strategies + # such as FTP and Heroku are also available. See the documentation at + # https://docs.vagrantup.com/v2/push/atlas.html for more information. + # config.push.define "atlas" do |push| + # push.app = "YOUR_ATLAS_USERNAME/YOUR_APPLICATION_NAME" + # end + + # Enable provisioning with a shell script. Additional provisioners such as + # Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the + # documentation for more information about their specific syntax and use. + # config.vm.provision "shell", inline: <<-SHELL + # apt-get update + # apt-get install -y apache2 + # SHELL +end diff --git a/site.pp b/site.pp new file mode 100644 index 0000000..bd9656e --- /dev/null +++ b/site.pp @@ -0,0 +1,27 @@ +node 'puppet-agent.minsk.epam.com' { + class { '::mysql::server': + root_password => 'root', + 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, + password_hash => mysql_password('Epam_2011'), + } + + mysql_grant { 'test_user@localhost/test_mdb.*': + ensure => present, + options => ['GRANT'], + privileges => ['ALL'], + table => 'test_mdb.*', + user => 'test_user@localhost', + } +} diff --git a/test.txt b/test.txt new file mode 100644 index 0000000..f901cf4 --- /dev/null +++ b/test.txt @@ -0,0 +1 @@ +This is just a simple txt file. Don't mention!