Skip to content
This repository was archived by the owner on Aug 28, 2020. It is now read-only.

Updates #2

Closed
wants to merge 16 commits into from
Closed
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
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.tmp/
.vagrant/
.librarian/
puppet/modules/
4 changes: 4 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
source "https://rubygems.org"

gem "librarian-puppet"
gem "puppet"
57 changes: 57 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
GEM
remote: https://rubygems.org/
specs:
CFPropertyList (2.2.8)
activemodel (4.1.5)
activesupport (= 4.1.5)
builder (~> 3.1)
activesupport (4.1.5)
i18n (~> 0.6, >= 0.6.9)
json (~> 1.7, >= 1.7.7)
minitest (~> 5.1)
thread_safe (~> 0.1)
tzinfo (~> 1.1)
builder (3.2.2)
facter (2.1.0)
CFPropertyList (~> 2.2.6)
faraday (0.9.0)
multipart-post (>= 1.2, < 3)
her (0.7.2)
activemodel (>= 3.0.0, < 4.2)
activesupport (>= 3.0.0, < 4.2)
faraday (>= 0.8, < 1.0)
multi_json (~> 1.7)
hiera (1.3.4)
json_pure
highline (1.6.21)
i18n (0.6.11)
json (1.8.1)
json_pure (1.8.1)
librarian (0.1.2)
highline
thor (~> 0.15)
librarian-puppet (1.3.2)
librarian (>= 0.1.2)
puppet_forge
minitest (5.4.0)
multi_json (1.10.1)
multipart-post (2.0.0)
puppet (3.6.2)
facter (> 1.6, < 3)
hiera (~> 1.0)
json_pure
rgen (~> 0.6.5)
puppet_forge (1.0.3)
her (~> 0.6)
rgen (0.6.6)
thor (0.19.1)
thread_safe (0.3.4)
tzinfo (1.2.2)
thread_safe (~> 0.1)

PLATFORMS
ruby

DEPENDENCIES
librarian-puppet
puppet
5 changes: 3 additions & 2 deletions Puppetfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env ruby
#^syntax detection

forge "https://forge.puppetlabs.com"
forge "https://forgeapi.puppetlabs.com"

mod 'puppetlabs/apache'
mod 'puppetlabs/apt', '1.4.2'
Expand All @@ -11,7 +11,8 @@ mod 'garethr/erlang'
mod 'puppetlabs/mysql'
mod 'puppetlabs/rabbitmq'
mod 'fsalum/redis'
mod 'saz/resolv_conf'
mod 'sensu/sensu'
mod 'nanliu/staging'
mod 'sirhopcount/serverspec', :git => 'https://github.com/sirhopcount/puppet-serverspec.git'
mod 'petems/uchiwa', :git => 'https://github.com/petems/puppet-uchiwa'
mod 'saz/resolv_conf', :git => 'https://github.com/saz/puppet-resolv_conf'
72 changes: 72 additions & 0 deletions Puppetfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
FORGE
remote: https://forgeapi.puppetlabs.com
specs:
fsalum-redis (1.0.0)
thias-sysctl (>= 0.3.0)
garethr-erlang (0.3.0)
puppetlabs-apt (>= 0)
puppetlabs-stdlib (>= 0)
stahnma-epel (>= 0)
maestrodev-wget (1.5.1)
nanliu-staging (0.4.1)
puppetlabs-apache (1.1.1)
puppetlabs-concat (>= 1.0.0)
puppetlabs-stdlib (>= 2.4.0)
puppetlabs-apt (1.4.2)
puppetlabs-stdlib (>= 2.2.1)
puppetlabs-concat (1.1.0)
puppetlabs-stdlib (>= 4.0.0)
puppetlabs-mysql (2.3.1)
puppetlabs-stdlib (>= 3.2.0)
puppetlabs-rabbitmq (4.1.0)
nanliu-staging (>= 0.3.1)
puppetlabs-apt (>= 1.0.0)
puppetlabs-stdlib (>= 2.0.0)
puppetlabs-stdlib (4.3.2)
richardc-datacat (0.6.0)
sensu-sensu (1.1.0)
maestrodev-wget (>= 1.4.5)
puppetlabs-apt (>= 0.0.1)
puppetlabs-stdlib (>= 0.0.1)
stahnma-epel (0.1.1)
thias-sysctl (0.3.2)

GIT
remote: https://github.com/pauloconnor/pauloconnor-uchiwa
ref: master
sha: af4eb35675afb16d3dfdb8a5b026d3f8b74b133a
specs:
pauloconnor-uchiwa (0.2.4)
puppetlabs-apt (>= 0)
puppetlabs-stdlib (>= 0)
richardc-datacat (>= 0)

GIT
remote: https://github.com/saz/puppet-resolv_conf
ref: master
sha: c747c4510a2587979c38f4ad9016122eb75833db
specs:
saz-resolv_conf (3.0.1)

GIT
remote: https://github.com/sirhopcount/puppet-serverspec.git
ref: master
sha: 716996ca2ec2f0476a5b1cf56fd433469f79b401
specs:
sirhopcount-serverspec (0.0.1)

DEPENDENCIES
fsalum-redis (>= 0)
garethr-erlang (>= 0)
nanliu-staging (>= 0)
pauloconnor-uchiwa (>= 0)
puppetlabs-apache (>= 0)
puppetlabs-apt (= 1.4.2)
puppetlabs-concat (>= 0)
puppetlabs-mysql (>= 0)
puppetlabs-rabbitmq (>= 0)
puppetlabs-stdlib (>= 0)
saz-resolv_conf (>= 0)
sensu-sensu (>= 0)
sirhopcount-serverspec (>= 0)

10 changes: 6 additions & 4 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,18 @@ VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|

# Set box
config.vm.box = "ubuntu-12.04.4-64bit-vbox-4.3.10-puppet-2.7.25"
config.vm.box_url = "http://vagrant.goodfellasonline.nl/ubuntu-12.04.4-64bit-vbox-4.3.10-puppet-2.7.25.box"
config.vm.box = 'puppetlabs/ubuntu-12.04-64-puppet'

# Set box memory to 1024
config.vm.provider :virtualbox do |vb|
vb.customize ["modifyvm", :id, "--memory", "1024"]
end

# Always run apt-get update
config.vm.provision "shell", inline: "apt-get update"
config.vm.provision "shell", inline: "apt-get update -y"

# Install RubyGems so `Provider gem is not functional on this host` doesnt happen
config.vm.provision "shell", inline: "apt-get install rubygems -y"

# Create an extra shared folder for the puppet files folder
config.vm.synced_folder "puppet/files", "/etc/puppet/files"
Expand All @@ -34,7 +36,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.define :server do |conf|
conf.vm.hostname = 'mon01.vagrant.local'
conf.vm.network :private_network, ip: "192.168.50.4"
conf.vm.network :forwarded_port, guest: 8080, host: 8080
conf.vm.network :forwarded_port, guest: 3000, host: 3000
end

# Sensu client
Expand Down
2 changes: 1 addition & 1 deletion puppet/files/rspec_testing.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
require "json"
require "socket"

serverspec_results = `cd /etc/serverspec ; ruby -S rspec spec/ --format json`
serverspec_results = `cd /etc/serverspec ; /usr/local/bin/rspec spec/ --format json`
parsed = JSON.parse(serverspec_results)

parsed["examples"].each do |serverspec_test|
Expand Down
6 changes: 4 additions & 2 deletions puppet/manifests/classes/base.pp
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,17 @@
}

# Array of software packages that need to be installed
$pkgs_allow = [ 'sysstat',
$pkgs_allow = [
'sysstat',
'atop',
'curl',
'htop',
'multitail',
'ngrep',
'vim',
'swaks',
'tcpdump', ]
'tcpdump',
]

# Install software packages
package{ $pkgs_allow:
Expand Down
69 changes: 34 additions & 35 deletions puppet/manifests/classes/confmon.pp
Original file line number Diff line number Diff line change
Expand Up @@ -18,49 +18,48 @@
#
class confmon {

## RabbitMQ
## RabbitMQ

# Install rabbitmq
class { '::rabbitmq':
delete_guest_user => true,
}

# Create rabbitmq vhost for /sensu
rabbitmq_vhost { '/sensu':
ensure => present,
require => Class['::rabbitmq'],
}

# Create rabbitmq user named sensu
rabbitmq_user { 'sensu':
password => 'secret',
require => Class['::rabbitmq'],
}

# Set permissions for user sensu on vhost sensu
rabbitmq_user_permissions { 'sensu@/sensu':
configure_permission => '.*',
read_permission => '.*',
write_permission => '.*',
require => Class['::rabbitmq'],
}
class { 'rabbitmq':
ssl => false,
delete_guest_user => true,
}
-> rabbitmq_vhost { 'sensu': }
-> rabbitmq_user { 'sensu': password => 'secret' }
-> rabbitmq_user_permissions { 'sensu@sensu':
configure_permission => '.*',
read_permission => '.*',
write_permission => '.*',
}

## Redis

# Install redis
# Install and configure redis
class { 'redis': }

## Sensu

# Install and configure redis
class {'sensu':
server => true,
api => true,
dashboard => true,
rabbitmq_user => 'sensu',
rabbitmq_password => 'secret',
client_name => $fqdn,
client_address => '192.168.50.4',
class { 'sensu':
server => true,
api => true,
purge_config => true,
rabbitmq_password => 'secret',
rabbitmq_host => 'localhost',
rabbitmq_port => 5672,
}

class { 'uchiwa':
require => Class['sensu'],
}

uchiwa::api { 'Main Server':
host => '192.168.50.4',
ssl => false,
port => 4567,
user => 'sensu',
pass => 'secret',
path => '',
timeout => 5000
}

}