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
24 changes: 24 additions & 0 deletions Vagrantfile
Original file line number Diff line number Diff line change
@@ -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 = "centos/7"
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
Binary file added pexplorer.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions prod/environment.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Each environment can have an environment.conf file. Its settings will only
# affect its own environment. See docs for more info:
# https://docs.puppetlabs.com/puppet/latest/reference/config_file_environment.html

# Any unspecified settings use default values; some of those defaults are based
# on puppet.conf settings.

# If these settings include relative file paths, they'll be resolved relative to
# this environment's directory.

# Allowed settings and default values:

# modulepath = ./modules:$basemodulepath
# manifest = (default_manifest from puppet.conf, which defaults to ./manifests)
# config_version = (no script; Puppet will use the time the catalog was compiled)
# environment_timeout = (environment_timeout from puppet.conf, which defaults to 0)
# Note: unless you have a specific reason, we recommend only setting
# environment_timeout in puppet.conf.
modulepath = /etc/puppetlabs/code/environments/production/modules
23 changes: 23 additions & 0 deletions prod/manifests/site.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
node vm7.mnt.com {

include '::mysql::server'

mysql::db { 'prod_mdb':
user => 'prod_user',
password => 'password',
grant => ['ALL'],
}


package { 'nginx':
ensure => installed,
require => Package['epel-release']
}
package { 'epel-release':
ensure => installed,
}
service { 'nginx':
enable => true,
ensure => running,
}
}
23 changes: 23 additions & 0 deletions site.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Installing puppetdb and puppetexplorer as modules:
#puppet module install puppetlabs-puppetdb --version 5.1.2
#puppet module install spotify-puppetexplorer --version 1.1.1
#puppet module install puppetlabs-apache --version 1.11.0

node epbyminw2976.minsk.epam.com {

# Configure puppetdb and its underlying database
class { 'puppetdb': }

# Configure the Puppet master to use puppetdb
class { 'puppetdb::master::config': }

#rewrite rule for apache; population metric names changed in PuppetDB 4.x
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]'] } ] }
}

}

#turn off selinux or use bash command to fix issue with explorer:
#setsebool -P httpd_can_network_connect on