diff --git a/Vagrantfile b/Vagrantfile new file mode 100644 index 0000000..2b3dd9a --- /dev/null +++ b/Vagrantfile @@ -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 diff --git a/pexplorer.PNG b/pexplorer.PNG new file mode 100644 index 0000000..6054824 Binary files /dev/null and b/pexplorer.PNG differ diff --git a/prod/environment.conf b/prod/environment.conf new file mode 100644 index 0000000..e37a531 --- /dev/null +++ b/prod/environment.conf @@ -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 diff --git a/prod/manifests/site.pp b/prod/manifests/site.pp new file mode 100644 index 0000000..a277788 --- /dev/null +++ b/prod/manifests/site.pp @@ -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, + } +} diff --git a/site.pp b/site.pp new file mode 100644 index 0000000..23b2005 --- /dev/null +++ b/site.pp @@ -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