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

Commit

Permalink
(SIMP-1695) Update for Puppet 4 (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nick Miller authored and jeannegreulich committed Jan 5, 2017
1 parent 1c51187 commit eda1713
Show file tree
Hide file tree
Showing 15 changed files with 124 additions and 206 deletions.
4 changes: 1 addition & 3 deletions .fixtures.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ fixtures:
iptables: "https://github.com/simp/pupmod-simp-iptables"
network: "https://github.com/simp/pupmod-simp-network"
simplib: "https://github.com/simp/pupmod-simp-simplib"
stdlib:
repo: "https://github.com/simp/puppetlabs-stdlib"
branch: "simp-master"
stdlib: "https://github.com/simp/puppetlabs-stdlib"
symlinks:
gfs2: "#{source_dir}"
8 changes: 3 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,15 @@
.yardoc
dist
/pkg
!/spec/fixtures/
/spec/fixtures/*
/spec/fixtures
/spec/rp_env
!/spec/fixtures/hieradata
!/spec/fixtures/hieradata/*.yaml
!/spec/hieradata/default.yaml
!/spec/fixtures/site.pp
/spec/fixtures/hieradata/hiera.yaml
/.rspec_system
/.vagrant
/.bundle
/Gemfile.lock
/vendor
/junit
/log
/doc
4 changes: 3 additions & 1 deletion .puppet-lint.rc
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
--log-format="%{path}:%{line}:%{check}:%{KIND}:%{message}"
--relative
--no-class_inherits_from_params_class-check
--no-80chars-check
--no-140chars-check
--no-trailing_comma-check
--no-empty_string_assignment-check
87 changes: 15 additions & 72 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# PE/SIMP versions
# app pup ruby
# 2015.2 4.3 2.1.7
# 2015.3 4.3 2.1.8
# 2016.1 4.4 2.1.9
# 2016.2 4.5 2.1.9
# S6.0.0 4.7 2.1.9
---
language: ruby
sudo: false
Expand All @@ -11,87 +18,23 @@ script:
notifications:
email: false
rvm:
- 2.0.0
- 2.1.0
- 2.2.1
- 1.9.3
- 2.1.9
env:
global:
- STRICT_VARIABLES=yes
- TRUSTED_NODE_DATA=yes
matrix:
- PUPPET_VERSION="~> 4.7.0"
- PUPPET_VERSION="~> 4.5.0"
- PUPPET_VERSION="~> 3.8.0"
- PUPPET_VERSION="~> 4.4.0"
- PUPPET_VERSION="~> 3.5.0"
- PUPPET_VERSION="~> 3.6.0"
- PUPPET_VERSION="~> 3.7.0"
- PUPPET_VERSION="~> 3.7.0" FUTURE_PARSER=yes
- PUPPET_VERSION="~> 3.8.0" FUTURE_PARSER=yes
- PUPPET_VERSION="~> 4.0.0"
- PUPPET_VERSION="~> 4.1.0"
- PUPPET_VERSION="~> 4.2.0"
- PUPPET_VERSION="~> 4.3.0"
- PUPPET_VERSION="~> 3.8.0" FUTURE_PARSER=yes
matrix:
fast_finish: true
allow_failures:
- rvm: 1.9.3
- rvm: 2.2.1
- env: PUPPET_VERSION="~> 3.5.0"
- env: PUPPET_VERSION="~> 3.6.0"
- env: PUPPET_VERSION="~> 3.7.0"
- env: PUPPET_VERSION="~> 3.7.0" FUTURE_PARSER=yes
- env: PUPPET_VERSION="~> 3.8.0" FUTURE_PARSER=yes
- env: PUPPET_VERSION="~> 4.0.0"
- env: PUPPET_VERSION="~> 4.1.0"
- env: PUPPET_VERSION="~> 4.2.0"
- env: PUPPET_VERSION="~> 4.5.0"
- env: PUPPET_VERSION="~> 3.8.0"
- env: PUPPET_VERSION="~> 4.4.0"
- env: PUPPET_VERSION="~> 4.3.0"


exclude:
# Ruby 1.9.3
- rvm: 1.9.3
env: PUPPET_VERSION="~> 3.5.0"
- rvm: 1.9.3
env: PUPPET_VERSION="~> 3.6.0"
- rvm: 1.9.3
env: PUPPET_VERSION="~> 3.7.0"
- rvm: 1.9.3
env: PUPPET_VERSION="~> 3.7.0" FUTURE_PARSER=yes
- rvm: 1.9.3
env: PUPPET_VERSION="~> 4.0.0"
- rvm: 1.9.3
env: PUPPET_VERSION="~> 4.1.0"
- rvm: 1.9.3
env: PUPPET_VERSION="~> 4.2.0"
- rvm: 1.9.3
env: PUPPET_VERSION="~> 4.3.0"

# Ruby 2.1.0
- rvm: 2.1.0
env: PUPPET_VERSION="~> 3.5.0"
- rvm: 2.1.0
env: PUPPET_VERSION="~> 3.6.0"
- rvm: 2.1.0
env: PUPPET_VERSION="~> 3.7.0"
- rvm: 2.1.0
env: PUPPET_VERSION="~> 3.7.0" FUTURE_PARSER=yes

# Ruby 2.2.1
- rvm: 2.2.1
env: PUPPET_VERSION="~> 3.5.0"
- rvm: 2.2.1
env: PUPPET_VERSION="~> 3.6.0"
- rvm: 2.2.1
env: PUPPET_VERSION="~> 3.7.0"
- rvm: 2.2.1
env: PUPPET_VERSION="~> 3.7.0" FUTURE_PARSER=yes
- rvm: 2.2.1
env: PUPPET_VERSION="~> 3.8.0"
- rvm: 2.2.1
env: PUPPET_VERSION="~> 4.0.0"
- rvm: 2.2.1
env: PUPPET_VERSION="~> 4.1.0"
- rvm: 2.2.1
env: PUPPET_VERSION="~> 4.2.0"
- rvm: 2.2.1
env: PUPPET_VERSION="~> 4.3.0"
- env: PUPPET_VERSION="~> 3.8.0" FUTURE_PARSER=yes
4 changes: 4 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
* Wed Jan 04 2016 Nick Miller <[email protected]> - 5.0.0-0
- Strong typed module
- Renamed $cluster_nets to the catalyst $trusted_nets

* Tue Aug 02 2016 Trevor Vaughan <[email protected]> - 4.1.1-0
- Update to the new package naming convention

Expand Down
4 changes: 0 additions & 4 deletions CONTRIBUTING.md

This file was deleted.

49 changes: 20 additions & 29 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,41 +1,31 @@
# ------------------------------------------------------------------------------
# Environment variables:
# SIMP_GEM_SERVERS | a space/comma delimited list of rubygem servers
# PUPPET_VERSION | specifies the version of the puppet gem to load
# ------------------------------------------------------------------------------
# NOTE: SIMP Puppet rake tasks support ruby 2.0 and ruby 2.1
# ------------------------------------------------------------------------------
puppetversion = ENV.key?('PUPPET_VERSION') ? "#{ENV['PUPPET_VERSION']}" : '~>3'
gem_sources = ENV.key?('SIMP_GEM_SERVERS') ? ENV['SIMP_GEM_SERVERS'].split(/[, ]+/) : ['https://rubygems.org']

gem_sources.each { |gem_source| source gem_source }

group :test do
gem "rake"
gem 'puppet', puppetversion
gem "rspec", '< 3.2.0'
gem "rspec-puppet"
gem "hiera-puppet-helper"
gem "puppetlabs_spec_helper"
gem "metadata-json-lint"
gem "simp-rspec-puppet-facts", "~> 1.3"


# simp-rake-helpers does not suport puppet 2.7.X
if "#{ENV['PUPPET_VERSION']}".scan(/\d+/).first != '2' &&
# simp-rake-helpers and ruby 1.8.7 bomb Travis tests
# TODO: fix upstream deps (parallel in simp-rake-helpers)
RUBY_VERSION.sub(/\.\d+$/,'') != '1.8'
gem 'simp-rake-helpers'
end
gem 'rake'
gem 'puppet', ENV.fetch('PUPPET_VERSION', '~>4')
gem 'rspec'
gem 'rspec-puppet'
gem 'hiera-puppet-helper'
gem 'puppetlabs_spec_helper'
gem 'metadata-json-lint'
gem 'puppet-lint-empty_string-check', :require => false
gem 'puppet-lint-trailing_comma-check', :require => false
gem 'simp-rspec-puppet-facts', ENV.fetch('SIMP_RSPEC_PUPPET_FACTS_VERSION', '~> 1.3')
gem 'simp-rake-helpers', ENV.fetch('SIMP_RAKE_HELPERS_VERSION', '~> 3.0')
end

group :development do
gem "travis"
gem "travis-lint"
gem "travish"
gem "puppet-blacksmith"
gem "guard-rake"
gem 'travis'
gem 'travis-lint'
gem 'travish'
gem 'puppet-blacksmith'
gem 'puppet-strings'
gem 'guard-rake'
gem 'pry'
gem 'pry-doc'

Expand All @@ -45,7 +35,8 @@ group :development do
end

group :system_tests do
gem 'beaker'
# This patch is required to fix Beaker's broken `aio` handling
gem 'beaker', :git => 'https://github.com/trevor-vaughan/beaker.git', :branch => 'BKR-931-2.51.0'
gem 'beaker-rspec'
gem 'simp-beaker-helpers', '>= 1.0.5'
gem 'simp-beaker-helpers', ENV.fetch('SIMP_BEAKER_HELPERS_VERSION', '~> 1.5')
end
3 changes: 0 additions & 3 deletions build/package_metadata.yaml

This file was deleted.

78 changes: 36 additions & 42 deletions manifests/cluster_allow.pp
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# == Class: gfs2::cluster_allow
#
# This function opens the following ports and connection types for the provided
# $cluster_nets.
# $trusted_nets.
#
# Port Number(s) Type Use
# 1229 UDP fencing access
Expand All @@ -15,69 +13,65 @@
# 50006 50008 50009 TCP ccsd access
# 50007 UDP ccsd access
#
# == Parameters
#
# [*cluster_nets*]
# For the widest subnet accessibility, set $cluster_nets to
# nets2cidr(hiera('client_nets')).
#
# == Authors
# @param trusted_nets
# For the widest subnet accessibility, set $trusted_nets to
# nets2cidr(hiera('trusted_nets')).
#
# * Trevor Vaughan <[email protected]>
# @author Trevor Vaughan <[email protected]>
#
class gfs2::cluster_allow (
$cluster_nets
Simplib::Netlist $trusted_nets = simplib::lookup('simp_options::trusted_nets', { 'default_value' => ['127.0.0.1'] }),
) {

iptables::add_udp_listen { 'allow_cman':
client_nets => $cluster_nets,
dports => ['5404','5405','6809']
iptables::listen::udp { 'allow_cman':
trusted_nets => $trusted_nets,
dports => [ 5404,5405,6809 ]
}

# Conga
iptables::add_tcp_stateful_listen { 'allow_ricci':
client_nets => $cluster_nets,
dports => '11111'
iptables::listen::tcp_stateful { 'allow_ricci':
trusted_nets => $trusted_nets,
dports => [ 11111 ]
}

iptables::add_udp_listen { 'allow_ricci':
client_nets => $cluster_nets,
dports => '11111',
require => Service['ricci']
iptables::listen::udp { 'allow_ricci':
trusted_nets => $trusted_nets,
dports => [ 11111 ],
require => Service['ricci']
}

iptables::add_tcp_stateful_listen { 'allow_gnbd':
client_nets => $cluster_nets,
dports => '14567'
iptables::listen::tcp_stateful { 'allow_gnbd':
trusted_nets => $trusted_nets,
dports => [ 14567 ]
}

iptables::add_tcp_stateful_listen { 'allow_modclusterd':
client_nets => $cluster_nets,
dports => '16851'
iptables::listen::tcp_stateful { 'allow_modclusterd':
trusted_nets => $trusted_nets,
dports => [ 16851 ]
}

iptables::add_tcp_stateful_listen { 'allow_dlm':
client_nets => $cluster_nets,
dports => '21064'
iptables::listen::tcp_stateful { 'allow_dlm':
trusted_nets => $trusted_nets,
dports => [ 21064 ]
}

iptables::add_tcp_stateful_listen { 'allow_ccsd':
client_nets => $cluster_nets,
dports => [ '50006', '50008', '50009' ]
iptables::listen::tcp_stateful { 'allow_ccsd':
trusted_nets => $trusted_nets,
dports => [ 50006,50008,50009 ]
}

iptables::add_udp_listen { 'allow_ccsd':
client_nets => $cluster_nets,
dports => '50007'
iptables::listen::udp { 'allow_ccsd':
trusted_nets => $trusted_nets,
dports => [ 50007 ]
}

iptables::add_udp_listen { 'allow_fencing':
client_nets => $cluster_nets,
dports => '1229'
iptables::listen::udp { 'allow_fencing':
trusted_nets => $trusted_nets,
dports => [ 1229 ]
}

iptables_rule { 'allow_cluster_multicast':
order => '6',
content => "-s ${cluster_nets} -m addrtype --src-type MULTICAST -j ACCEPT"
order => 6,
content => "-s ${trusted_nets} -m addrtype --src-type MULTICAST -j ACCEPT"
}
}
16 changes: 5 additions & 11 deletions manifests/init.pp
Original file line number Diff line number Diff line change
@@ -1,19 +1,13 @@
# == Class: gfs2
#
# This class supports the Global File System. It ensures that the
# appropriate files are in the appropriate places and that the necessary
# packages and services are present.
#
# == Notes
#
# This module is incompatible with the acpid module.
#
# == Authors
#
# * Trevor Vaughan <[email protected]>
# @author Trevor Vaughan <[email protected]>
#
class gfs2 {
include 'network'
include '::network'

file { '/etc/cluster':
ensure => 'directory',
Expand All @@ -23,7 +17,7 @@
}

iptables_rule { 'allow_anycast_multicast':
order => '5',
order => 5,
content => '-s 224.0.0.1 -m addrtype --src-type MULTICAST -j ACCEPT',
require => Package['ricci']
}
Expand All @@ -35,10 +29,10 @@
# For the SCSI Fence
package { 'sg3_utils': ensure => 'latest' }

if $::virtual and ( ( $::virtual == 'xenu' ) or ( $::virtual == 'xen0' ) ) {
if $facts['virtual'] and ( ( $facts['virtual'] == 'xenu' ) or ( $facts['virtual'] == 'xen0' ) ) {
package { [
'kmod-gnbd-xen',
"libvirt.${::hardwaremodel}" ]:
"libvirt.${facts['hardwaremodel']}" ]:
ensure => 'latest'
}
}
Expand Down
Loading

0 comments on commit eda1713

Please sign in to comment.