Skip to content
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
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
# lesson13
# lesson13

2 folders for different nodes (and conf files there):
srv - puppetserver
agent - puppet agent

Folder pics for screenshots
44 changes: 44 additions & 0 deletions Vagrantfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# -*- 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|

config.vm.define "srv" do |srv|
srv.vm.hostname = "srv"
srv.vm.box = "centos/7"
srv.vm.network "private_network", ip: "192.168.100.100"
srv.vm.provider "virtualbox" do |main|
main.name = "srv"
main.memory = 4096


srv.vm.provision "shell", inline:"rpm -Uvh https://yum.puppetlabs.com/puppetlabs-release-pc1-el-7.noarch.rpm; yum install -y puppetserver"
srv.vm.provision "shell", inline: "yum install -y facter vim"

end
end

config.vm.define "agent" do |agent|
agent.vm.hostname = "agent"
agent.vm.box = "centos/7"
agent.vm.network "private_network", ip: "192.168.100.101"
agent.vm.provider "virtualbox" do |node|
node.name = "agent"
node.memory = 512

agent.vm.provision "shell", inline:"rpm -Uvh https://yum.puppetlabs.com/puppetlabs-release-pc1-el-7.noarch.rpm; yum install -y facter vim puppet"
end
end


#config.vm.provision "shell", inline: "yum install -y epel-release"
#config.vm.provision "shell", inline: "yum install -y java puppet facter nano vim"
#config.vm.provision "shell", inline: "setenforce permissive"
#config.vm.provision "shell", inline: "puppet apply -e 'include exittask' --modulepath=/vagrant"


end
4 changes: 4 additions & 0 deletions agent/puppet.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

server = srv.minsk.epam.com
certname = agent.minsk.epam.com

Binary file added pics/expl1.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 pics/expl2.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 pics/expl3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions srv/hosts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
127.0.0.1 srv srv
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
# ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6

192.168.100.100 srv.minsk.epam.com puppet
192.168.100.101 agent.minsk.epam.com

7 changes: 7 additions & 0 deletions srv/prod/hosts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
127.0.0.1 srv srv
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
# ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6

192.168.100.100 srv.minsk.epam.com puppet
192.168.100.101 agent.minsk.epam.com

27 changes: 27 additions & 0 deletions srv/prod/site.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
node 'agent.minsk.epam.com' {
class { '::mysql::server':
root_password => 'root',
override_options => {
'mysqld' => { 'max_connections' => '1024' }
},
}
include ::mysql::server::account_security

mysql_database { 'prod_mdb':
ensure => present,
charset => 'utf8',
}

mysql_user { 'prod_user@localhost':
ensure => present,
password_hash => mysql_password('Epam_2011'),
}

mysql_grant { 'prod_user@localhost/prod_mdb.*':
ensure => present,
options => ['GRANT'],
privileges => ['ALL'],
table => 'prod_mdb.*',
user => 'prod_user@localhost',
}
}
Empty file added srv/production/config.ini
Empty file.
7 changes: 7 additions & 0 deletions srv/production/hosts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
127.0.0.1 srv srv
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
# ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6

192.168.100.100 srv.minsk.epam.com puppet
192.168.100.101 agent.minsk.epam.com

9 changes: 9 additions & 0 deletions srv/production/puppet.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[master]
vardir = /opt/puppetlabs/server/data/puppetserver
logdir = /var/log/puppetlabs/puppetserver
rundir = /var/run/puppetlabs/puppetserver
pidfile = /var/run/puppetlabs/puppetserver/puppetserver.pid
codedir = /etc/puppetlabs/code
storeconfigs = true
storeconfigs_backend = puppetdb
reports = store,puppetdb
3 changes: 3 additions & 0 deletions srv/production/puppetdb.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[main]
server_urls = https://srv.minsk.epam.com:8081/
soft_write_failure = false
9 changes: 9 additions & 0 deletions srv/production/site.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
node srv.minsk.epam.com {
class { 'puppetdb': }
class { 'puppetdb::master::config': }
class {'::puppetexplorer':
vhost_options => {
rewrites => [ { rewrite_rule => ['^/api/metrics/v1/mbeans/puppetlabs.puppetdb.query.population:type=default,name=(.*)$ https://%{HTTP_HOST}/api/metrics/v1/mbeans/puppetlabs.puppetdb.population:name=$1 [R=301,L]'] } ] }
}
}