Skip to content
Snippets Groups Projects
Commit c63d9851 authored by Daniel Klockenkämper's avatar Daniel Klockenkämper Committed by GitHub
Browse files

Merge pull request #69 from derdanne/bugfix_rpcbind.service__default_domain

several bugfixes - see CHANGELOG
parents 38bf7332 144dd8ba
No related branches found
No related tags found
No related merge requests found
......@@ -4,13 +4,14 @@ AllCops:
Include:
- ./**/*.rb
Exclude:
- ./Gemfile
- ./Rakefile
- files/**/*
- vendor/**/*
- .vendor/**/*
- pkg/**/*
- spec/fixtures/**/*
- Gemfile
- Rakefile
- Guardfile
Lint/ConditionPosition:
Enabled: True
......@@ -50,7 +51,7 @@ Lint/AmbiguousOperator:
Lint/AssignmentInCondition:
Enabled: True
Style/SpaceBeforeComment:
Layout/SpaceBeforeComment:
Enabled: True
Style/AndOr:
......@@ -118,22 +119,22 @@ Lint/UselessAssignment:
Lint/Void:
Enabled: True
Style/AccessModifierIndentation:
Layout/AccessModifierIndentation:
Enabled: True
Style/AccessorMethodName:
Naming/AccessorMethodName:
Enabled: True
Style/Alias:
Enabled: True
Style/AlignArray:
Layout/AlignArray:
Enabled: True
Style/AlignHash:
Layout/AlignHash:
Enabled: True
Style/AlignParameters:
Layout/AlignParameters:
Enabled: True
Metrics/BlockNesting:
......@@ -151,13 +152,13 @@ Style/BracesAroundHashParameters:
Style/CaseEquality:
Enabled: True
Style/CaseIndentation:
Layout/CaseIndentation:
Enabled: True
Style/CharacterLiteral:
Enabled: True
Style/ClassAndModuleCamelCase:
Naming/ClassAndModuleCamelCase:
Enabled: True
Style/ClassAndModuleChildren:
......@@ -185,64 +186,64 @@ Style/WordArray:
Style/UnneededPercentQ:
Enabled: True
Style/Tab:
Layout/Tab:
Enabled: True
Style/SpaceBeforeSemicolon:
Layout/SpaceBeforeSemicolon:
Enabled: True
Style/TrailingBlankLines:
Layout/TrailingBlankLines:
Enabled: True
Style/SpaceInsideBlockBraces:
Layout/SpaceInsideBlockBraces:
Enabled: True
Style/SpaceInsideBrackets:
Layout/SpaceInsideBrackets:
Enabled: True
Style/SpaceInsideHashLiteralBraces:
Layout/SpaceInsideHashLiteralBraces:
Enabled: True
Style/SpaceInsideParens:
Layout/SpaceInsideParens:
Enabled: True
Style/LeadingCommentSpace:
Layout/LeadingCommentSpace:
Enabled: True
Style/SpaceBeforeFirstArg:
Layout/SpaceBeforeFirstArg:
Enabled: True
Style/SpaceAfterColon:
Layout/SpaceAfterColon:
Enabled: True
Style/SpaceAfterComma:
Layout/SpaceAfterComma:
Enabled: True
Style/SpaceAfterMethodName:
Layout/SpaceAfterMethodName:
Enabled: True
Style/SpaceAfterNot:
Layout/SpaceAfterNot:
Enabled: True
Style/SpaceAfterSemicolon:
Layout/SpaceAfterSemicolon:
Enabled: True
Style/SpaceAroundEqualsInParameterDefault:
Layout/SpaceAroundEqualsInParameterDefault:
Enabled: True
Style/SpaceAroundOperators:
Layout/SpaceAroundOperators:
Enabled: True
Style/SpaceBeforeBlockBraces:
Layout/SpaceBeforeBlockBraces:
Enabled: True
Style/SpaceBeforeComma:
Layout/SpaceBeforeComma:
Enabled: True
Style/CollectionMethods:
Enabled: True
Style/CommentIndentation:
Layout/CommentIndentation:
Enabled: True
Style/ColonMethodCall:
......@@ -255,7 +256,7 @@ Style/CommentAnnotation:
Metrics/CyclomaticComplexity:
Enabled: False
Style/ConstantName:
Naming/ConstantName:
Enabled: True
Style/Documentation:
......@@ -267,7 +268,7 @@ Style/DefWithParentheses:
Style/PreferredHashMethods:
Enabled: True
Style/DotPosition:
Layout/DotPosition:
EnforcedStyle: trailing
Style/DoubleNegation:
......@@ -276,25 +277,25 @@ Style/DoubleNegation:
Style/EachWithObject:
Enabled: True
Style/EmptyLineBetweenDefs:
Layout/EmptyLineBetweenDefs:
Enabled: True
Style/IndentArray:
Layout/IndentArray:
Enabled: True
Style/IndentHash:
Layout/IndentHash:
Enabled: True
Style/IndentationConsistency:
Layout/IndentationConsistency:
Enabled: True
Style/IndentationWidth:
Layout/IndentationWidth:
Enabled: True
Style/EmptyLines:
Layout/EmptyLines:
Enabled: True
Style/EmptyLinesAroundAccessModifier:
Layout/EmptyLinesAroundAccessModifier:
Enabled: True
Style/EmptyLiteral:
......@@ -313,7 +314,7 @@ Style/MethodDefParentheses:
Style/LineEndConcatenation:
Enabled: True
Style/TrailingWhitespace:
Layout/TrailingWhitespace:
Enabled: True
Style/StringLiterals:
......@@ -364,7 +365,7 @@ Style/UnlessElse:
Style/VariableInterpolation:
Enabled: True
Style/VariableName:
Naming/VariableName:
Enabled: True
Style/WhileUntilDo:
......@@ -373,7 +374,7 @@ Style/WhileUntilDo:
Style/EvenOdd:
Enabled: True
Style/FileName:
Naming/FileName:
Enabled: True
Style/For:
......@@ -382,7 +383,7 @@ Style/For:
Style/Lambda:
Enabled: True
Style/MethodName:
Naming/MethodName:
Enabled: True
Style/MultilineTernaryOperator:
......@@ -418,7 +419,7 @@ Style/NumericLiterals:
Style/OneLineConditional:
Enabled: True
Style/OpMethod:
Naming/BinaryOperatorParameterName:
Enabled: True
Style/ParenthesesAroundCondition:
......@@ -430,7 +431,7 @@ Style/PercentLiteralDelimiters:
Style/PerlBackrefs:
Enabled: True
Style/PredicateName:
Naming/PredicateName:
Enabled: True
Style/RedundantException:
......@@ -465,9 +466,6 @@ Metrics/ParameterLists:
Lint/RequireParentheses:
Enabled: True
Style/SpaceBeforeFirstArg:
Enabled: True
Style/ModuleFunction:
Enabled: True
......@@ -483,7 +481,7 @@ Style/Encoding:
Style/BlockDelimiters:
Enabled: True
Style/MultilineBlockLayout:
Layout/MultilineBlockLayout:
Enabled: True
# 'Complexity' is very relative
......@@ -497,11 +495,15 @@ Metrics/PerceivedComplexity:
Lint/UselessAssignment:
Enabled: True
Style/ClosingParenthesisIndentation:
Layout/ClosingParenthesisIndentation:
Enabled: True
# RSpec
RSpec/BeforeAfterAll:
Exclude:
- spec/acceptance/**/*
# We don't use rspec in this way
RSpec/DescribeClass:
Enabled: False
......@@ -521,6 +523,10 @@ RSpec/RepeatedDescription:
RSpec/NestedGroups:
Enabled: False
# this is broken on ruby1.9
Layout/IndentHeredoc:
Enabled: False
# disable Yaml safe_load. This is needed to support ruby2.0.0 development envs
Security/YAMLLoad:
Enabled: false
\ No newline at end of file
......@@ -11,25 +11,58 @@ matrix:
include:
- rvm: 2.3.1
env: PUPPET_VERSION="~> 4.6.0" STRICT_VARIABLES="yes" CHECK=test
bundler_args: --without system_tests development
- rvm: 2.3.1
env: PUPPET_VERSION="~> 4.7.0" STRICT_VARIABLES="yes" CHECK=test
bundler_args: --without system_tests development
- rvm: 2.3.1
env: PUPPET_VERSION="~> 4.8.0" STRICT_VARIABLES="yes" CHECK=test
bundler_args: --without system_tests development
- rvm: 2.3.1
env: PUPPET_VERSION="~> 4.9.0" STRICT_VARIABLES="yes" CHECK=test
bundler_args: --without system_tests development
- rvm: 2.3.1
env: PUPPET_VERSION="~> 4.10.0" STRICT_VARIABLES="yes" CHECK=test
- rvm: 2.4.0
env: PUPPET_VERSION="~> 4.10.0" STRICT_VARIABLES="yes" CHECK=test
- rvm: 2.3.1
env: PUPPET_VERSION="~> 4.10.0" STRICT_VARIABLES="yes" CHECK=rubocop
- rvm: 2.3.1
bundler_args: --without system_tests development
- rvm: 2.4.1
env: PUPPET_VERSION="~> 5.0" STRICT_VARIABLES="yes" CHECK=test
bundler_args: --without system_tests development
- rvm: 2.4.1
env: PUPPET_VERSION="~> 5.0" STRICT_VARIABLES="yes" CHECK=rubocop
bundler_args: --without system_tests development
- rvm: 2.4.1
env: PUPPET_INSTALL_TYPE=agent BEAKER_set=ubuntu-14.04
bundler_args: --without development
script: bundle exec rake beaker
services: docker
sudo: required
- rvm: 2.3.1
- rvm: 2.4.1
env: PUPPET_INSTALL_TYPE=agent BEAKER_set=ubuntu-16.04
bundler_args: --without development
script: bundle exec rake beaker
services: docker
sudo: required
- rvm: 2.4.1
env: PUPPET_INSTALL_TYPE=agent BEAKER_set=centos-6
bundler_args: --without development
script: bundle exec rake beaker
services: docker
sudo: required
- rvm: 2.4.1
env: PUPPET_INSTALL_TYPE=agent BEAKER_set=centos-7
bundler_args: --without development
script: bundle exec rake beaker
services: docker
sudo: required
- rvm: 2.4.1
env: PUPPET_INSTALL_TYPE=agent BEAKER_set=debian-7
bundler_args: --without development
script: bundle exec rake beaker
services: docker
sudo: required
- rvm: 2.4.1
env: PUPPET_INSTALL_TYPE=agent BEAKER_set=debian-8
bundler_args: --without development
script: bundle exec rake beaker
services: docker
sudo: required
......
##2017-10-10 - Release 2.0.5
###Summary
####Bugfixes
- set $nfs_v4_idmap_domain to 'example.org' when $::domain is undef
- add client service rpcbind.socket for RedHat 7
- set client service rpcbind.service for RedHat 7 to enable => false
- fix service parameters for Debian 7
####Features
- update rubocop rules and fix ruby code style
- change type of server_nfsv4_servicehelper to array for allowing multiple helper services
- add acceptance tests for CentOs 6 and 7 and Debian 7 and 8
- add acceptance tests for nfs configured as client
- add testing with Puppet v5
##2017-07-11 - Release 2.0.4
###Summary
......
......@@ -192,7 +192,7 @@ class nfs(
Boolean $server_service_hasrestart = $::nfs::params::server_service_hasrestart,
Boolean $server_service_hasstatus = $::nfs::params::server_service_hasstatus,
Optional[String] $server_service_restart_cmd = $::nfs::params::server_service_restart_cmd,
Optional[String] $server_nfsv4_servicehelper = $::nfs::params::server_nfsv4_servicehelper,
Optional[Array] $server_nfsv4_servicehelper = $::nfs::params::server_nfsv4_servicehelper,
$client_services = $::nfs::params::client_services,
$client_nfsv4_services = $::nfs::params::client_nfsv4_services,
Boolean $client_services_enable = $::nfs::params::client_services_enable,
......
......@@ -35,7 +35,12 @@ class nfs::params {
$nfs_v4_export_root = '/export'
$nfs_v4_export_root_clients = "*.${::domain}(ro,fsid=root,insecure,no_subtree_check,async,root_squash)"
$nfs_v4_mount_root = '/srv'
if $::domain != undef {
$nfs_v4_idmap_domain = $::domain
} else {
$nfs_v4_idmap_domain = 'example.org'
}
# Different path and package definitions
case $::osfamily {
......@@ -97,15 +102,15 @@ class nfs::params {
case $::osfamily {
'Debian': {
case $::lsbdistcodename {
'jessie': {
'jessie', 'wheezy': {
$client_idmapd_setting = ['set NEED_IDMAPD yes']
$client_nfs_options = 'tcp,nolock,rsize=32768,wsize=32768,intr,noatime,nfsvers=3,actimeo=3'
$client_services_enable = true
$client_services = {'rpcbind' => {}}
$client_nfsv4_fstype = 'nfs4'
$client_nfsv4_options = 'tcp,nolock,rsize=32768,wsize=32768,intr,noatime,actimeo=3'
$client_nfsv4_services = {'rpcbind' => {}, 'nfs-common' => {}}
$server_nfsv4_servicehelper = 'nfs-common'
$client_nfsv4_services = {'rpcbind' => {}, 'nfs-common' => { require => Service['rpcbind'] }}
$server_nfsv4_servicehelper = [ 'nfs-common' ]
$server_service_name = 'nfs-kernel-server'
}
'stretch', 'xenial', 'yakkety', 'zesty': {
......@@ -116,7 +121,7 @@ class nfs::params {
$client_nfsv4_fstype = 'nfs4'
$client_nfsv4_options = 'tcp,nolock,rsize=32768,wsize=32768,intr,noatime,actimeo=3'
$client_nfsv4_services = {'rpcbind' => {}}
$server_nfsv4_servicehelper = 'nfs-idmapd'
$server_nfsv4_servicehelper = [ 'nfs-idmapd' ]
$server_service_name = 'nfs-server'
}
default: {
......@@ -127,7 +132,7 @@ class nfs::params {
$client_nfsv4_fstype = 'nfs4'
$client_nfsv4_options = 'tcp,nolock,rsize=32768,wsize=32768,intr,noatime,actimeo=3'
$client_nfsv4_services = {'rpcbind' => {}, 'idmapd' => {}}
$server_nfsv4_servicehelper = 'idmapd'
$server_nfsv4_servicehelper = [ 'idmapd' ]
$server_service_name = 'nfs-kernel-server'
}
}
......@@ -138,11 +143,27 @@ class nfs::params {
$client_idmapd_setting = ['']
$client_nfs_options = 'tcp,nolock,rsize=32768,wsize=32768,intr,noatime,actimeo=3'
$client_services_enable = true
$client_services = {'rpcbind.service' => {}}
$client_services = { 'rpcbind.service' => {
ensure => 'running',
enable => false,
},
'rpcbind.socket' => {
ensure => 'running',
enable => true,
},
}
$client_nfsv4_fstype = 'nfs4'
$client_nfsv4_options = 'tcp,nolock,rsize=32768,wsize=32768,intr,noatime,actimeo=3'
$client_nfsv4_services = {'rpcbind.service' => {}}
$server_nfsv4_servicehelper = 'nfs-idmap.service'
$client_nfsv4_services = { 'rpcbind.service' => {
ensure => 'running',
enable => false,
},
'rpcbind.socket' => {
ensure => 'running',
enable => true,
},
}
$server_nfsv4_servicehelper = [ 'nfs-idmap.service' ]
$server_service_name = 'nfs-server.service'
}
default: {
......@@ -153,7 +174,7 @@ class nfs::params {
$client_nfsv4_fstype = 'nfs4'
$client_nfsv4_options = 'tcp,nolock,rsize=32768,wsize=32768,intr,noatime,actimeo=3'
$client_nfsv4_services = {'rpcbind' => {}, 'rpcidmapd' => {}}
$server_nfsv4_servicehelper = 'rpcidmapd'
$server_nfsv4_servicehelper = [ 'rpcidmapd', 'rpcbind' ]
$server_service_name = 'nfs'
}
}
......@@ -166,7 +187,7 @@ class nfs::params {
$client_nfsv4_fstype = 'nfs4'
$client_nfsv4_options = 'tcp,nolock,rsize=32768,wsize=32768,intr,noatime,nfsvers=4,actimeo=3'
$client_nfsv4_services = {'rpcbind' => {}, 'rpc.idmapd' => {}}
$server_nfsv4_servicehelper = 'rpc.idmapd'
$server_nfsv4_servicehelper = [ 'rpc.idmapd' ]
$server_service_name = 'nfs'
}
'Suse': {
......@@ -188,7 +209,7 @@ class nfs::params {
$client_nfsv4_fstype = 'nfs4'
$client_nfsv4_options = 'tcp,nolock,rsize=32768,wsize=32768,intr,noatime,nfsvers=4,actimeo=3'
$client_nfsv4_services = {'rpcbind' => {}}
$server_nfsv4_servicehelper = 'nfs-idmapd'
$server_nfsv4_servicehelper = [ 'nfs-idmapd' ]
$server_service_name = 'nfs-server.service'
}
default: {
......
......@@ -18,27 +18,32 @@ class nfs::server::service {
if $::nfs::nfs_v4 == true {
if $::nfs::manage_server_service {
service { $::nfs::server_service_name:
if $::nfs::server_nfsv4_servicehelper != undef and $::nfs::manage_server_servicehelper {
$server_service_require = Service[$::nfs::server_nfsv4_servicehelper]
$::nfs::server_nfsv4_servicehelper.each |$service_name| {
service { $service_name:
ensure => $::nfs::server_service_ensure,
enable => $::nfs::server_service_enable,
hasrestart => $::nfs::server_service_hasrestart,
hasstatus => $::nfs::server_service_hasstatus,
restart => $::nfs::server_service_restart_cmd,
subscribe => [ Concat[$::nfs::exports_file], Augeas[$::nfs::idmapd_file] ],
}
}
} else {
$server_service_require = undef
}
if $::nfs::server_nfsv4_servicehelper != undef and $::nfs::manage_server_servicehelper {
service { $::nfs::server_nfsv4_servicehelper:
if $::nfs::manage_server_service {
service { $::nfs::server_service_name:
ensure => $::nfs::server_service_ensure,
enable => $::nfs::server_service_enable,
hasrestart => $::nfs::server_service_hasrestart,
hasstatus => $::nfs::server_service_hasstatus,
restart => $::nfs::server_service_restart_cmd,
subscribe => [ Concat[$::nfs::exports_file], Augeas[$::nfs::idmapd_file] ],
require => $server_service_require,
}
}
} else {
if $::nfs::manage_server_service {
......
{
"name": "derdanne-nfs",
"version": "2.0.4",
"version": "2.0.5",
"source": "https://github.com/derdanne/puppet-nfs.git",
"author": "derdanne",
"license": "Apache-2.0",
......@@ -69,7 +69,7 @@
"requirements": [
{
"name": "puppet",
"version_requirement": ">= 4.0.0 < 5.0.0"
"version_requirement": ">= 4.0.0 < 6.0.0"
}
]
}
......@@ -2,17 +2,36 @@ require 'spec_helper_acceptance'
describe 'nfs class' do
if fact('osfamily') == 'Debian'
if fact('lsbdistcodename') == 'trusty'
if fact('lsbdistcodename') == 'jessie' || fact('lsbdistcodename') == 'wheezy'
server_service = 'nfs-kernel-server'
server_servicehelper = 'idmapd'
server_servicehelpers = %w[nfs-common]
client_services = %w[rpcbind nfs-common]
elsif fact('lsbdistcodename') == 'trusty'
server_service = 'nfs-kernel-server'
server_servicehelpers = %w[idmapd]
client_services = %w[rpcbind]
else
server_service = 'nfs-server'
server_servicehelpers = %w[nfs-idmapd]
client_services = %w[rpcbind]
end
server_packages = %w[nfs-common nfs-kernel-server nfs4-acl-tools rpcbind]
client_packages = %w[nfs-common nfs4-acl-tools]
end
if fact('lsbdistcodename') == 'xenial'
server_service = 'nfs-server'
server_servicehelper = 'nfs-idmapd'
server_packages = %w[nfs-common nfs-kernel-server nfs4-acl-tools rpcbind]
if fact('osfamily') == 'RedHat'
if fact('operatingsystemmajrelease') == '6'
server_service = 'nfs'
server_servicehelpers = %w[rpcidmapd rpcbind]
client_services = %w[rpcbind]
end
if fact('operatingsystemmajrelease') == '7'
server_service = 'nfs-server.service'
server_servicehelpers = %w[nfs-idmap.service]
client_services = %w[rpcbind.service rpcbind.socket]
end
server_packages = %w[nfs-utils nfs4-acl-tools rpcbind]
client_packages = %w[nfs-utils nfs4-acl-tools rpcbind]
end
describe 'include nfs without params' do
......@@ -27,14 +46,14 @@ describe 'nfs class' do
describe 'include nfs with server params' do
context 'server params' do
server_pp = <<-EOS
server_pp = <<-PUPPETCODE
file { ['/data_folder', '/homeexport']:
ensure => 'directory',
}
class { '::nfs':
server_enabled => true,
nfs_v4 => true,
nfs_v4_idmap_domain => 'example.com',
nfs_v4_idmap_domain => 'example.org',
nfs_v4_export_root => '/export',
nfs_v4_export_root_clients => '*(rw,fsid=0,insecure,no_subtree_check,async,no_root_squash)',
}
......@@ -47,7 +66,7 @@ describe 'nfs class' do
clients => '*(rw,insecure,async,root_squash,no_subtree_check)',
mount => '/srv/home',
}
EOS
PUPPETCODE
it 'works with no errors based on the example' do
expect(apply_manifest(server_pp).exit_code).not_to eq(1)
......@@ -63,16 +82,63 @@ describe 'nfs class' do
end
end
# Buggy nfs-kernel-server does not run in docker ubuntu 14.04
if fact('lsbdistcodename') == 'xenial'
# Buggy nfs-kernel-server does not run in docker with Ubuntu 14.04, Debian wheezy and CentOs 6 images
if fact('lsbdistcodename') == 'trusty' || fact('lsbdistcodename') == 'wheezy' || (fact('osfamily') == 'RedHat' && fact('operatingsystemmajrelease') == '6')
puts 'Buggy nfs-kernel-server does not run in docker with Ubuntu 14.04, Debian wheezy and CentOs 6 images'
else
describe service(server_service) do
it { is_expected.to be_running }
end
end
server_servicehelpers.each do |server_servicehelper|
# puppet reports wrong status for nfs-common on wheezy
if server_servicehelper == 'nfs-common' && fact('lsbdistcodename') == 'wheezy'
puts 'puppet reports wrong status for nfs-common on wheezy'
else
describe service(server_servicehelper) do
it { is_expected.to be_running }
end
end
end
end
end
describe 'include nfs with client params' do
context 'client params' do
client_pp = <<-PUPPETCODE
class { '::nfs':
server_enabled => false,
client_enabled => true,
nfs_v4_client => true,
nfs_v4_idmap_domain => 'example.org',
}
PUPPETCODE
it 'works with no errors based on the example' do
expect(apply_manifest(client_pp).exit_code).not_to eq(1)
end
it 'runs a second time without changes' do
expect(apply_manifest(client_pp).exit_code).to eq(0)
end
client_packages.each do |package|
describe package(package) do
it { is_expected.to be_installed }
end
end
client_services.each do |service|
# puppet reports wrong status for nfs-common on wheezy
if service == 'nfs-common' && fact('lsbdistcodename') == 'wheezy'
puts 'puppet reports wrong status for nfs-common on wheezy'
else
describe service(service) do
it { is_expected.to be_running }
end
end
end
end
end
end
---
# This file is managed via modulesync
# https://github.com/voxpupuli/modulesync
# https://github.com/voxpupuli/modulesync_config
HOSTS:
centos-6-x64:
platform: el-6-x86_64
hypervisor: docker
image: centos:6
docker_preserve_image: true
docker_cmd: '["/sbin/init"]'
docker_image_commands:
- 'rm -rf /var/run/network/*'
- 'yum install -y crontabs initscripts iproute openssl sysvinit-tools tar wget which'
- 'rm /etc/init/tty.conf'
# for local development
- 'echo "MaxAuthTries 100" >> /etc/ssh/sshd_config'
CONFIG:
trace_limit: 200
masterless: true
...
# vim: syntax=yaml
\ No newline at end of file
---
# This file is managed via modulesync
# https://github.com/voxpupuli/modulesync
# https://github.com/voxpupuli/modulesync_config
HOSTS:
centos-7-x64:
platform: el-7-x86_64
hypervisor: docker
image: centos:7
docker_preserve_image: true
docker_cmd: '["/usr/sbin/init"]'
docker_image_commands:
- 'yum install -y crontabs initscripts iproute openssl sysvinit-tools tar wget which ss'
- 'systemctl mask getty@tty1.service'
# for local development
- 'echo "MaxAuthTries 100" >> /etc/ssh/sshd_config'
CONFIG:
trace_limit: 200
masterless: true
...
# vim: syntax=yaml
\ No newline at end of file
---
# This file is managed via modulesync
# https://github.com/voxpupuli/modulesync
# https://github.com/voxpupuli/modulesync_config
HOSTS:
debian-7-x64:
platform: debian-7-amd64
hypervisor: docker
image: debian:7
docker_preserve_image: true
docker_cmd: '["/sbin/init"]'
docker_image_commands:
- 'echo deb http://ftp.debian.org/debian wheezy-backports main >> /etc/apt/sources.list'
- 'apt-get update && apt-get install -y cron locales-all net-tools wget'
# for local development
- 'echo "MaxAuthTries 100" >> /etc/ssh/sshd_config'
CONFIG:
trace_limit: 200
masterless: true
...
\ No newline at end of file
---
# This file is managed via modulesync
# https://github.com/voxpupuli/modulesync
# https://github.com/voxpupuli/modulesync_config
HOSTS:
debian-8-x64:
platform: debian-8-amd64
hypervisor: docker
image: debian:8
docker_preserve_image: true
docker_cmd: '["/sbin/init"]'
docker_image_commands:
- 'echo deb http://ftp.debian.org/debian jessie-backports main >> /etc/apt/sources.list'
- 'apt-get update && apt-get install -y cron locales-all net-tools wget'
- 'rm -f /usr/sbin/policy-rc.d'
- 'systemctl mask getty@tty1.service getty-static.service'
# for local development
- 'echo "MaxAuthTries 100" >> /etc/ssh/sshd_config'
CONFIG:
trace_limit: 200
masterless: true
...
# vim: syntax=yaml
\ No newline at end of file
......@@ -9,6 +9,10 @@ HOSTS:
# ensure that upstart is booting correctly in the container
#- 'apt-get update && locale-gen en_US.UTF-8'
- 'rm /usr/sbin/policy-rc.d && rm /sbin/initctl && dpkg-divert --rename --remove /sbin/initctl && apt-get update && apt-get install -y net-tools wget && locale-gen en_US.UTF-8'
# for local development
- 'echo "MaxAuthTries 100" >> /etc/ssh/sshd_config'
CONFIG:
type: foss
trace_limit: 200
...
# vim: syntax=yaml
\ No newline at end of file
......@@ -8,6 +8,10 @@ HOSTS:
docker_image_commands:
# ensure that upstart is booting correctly in the container
- 'apt-get update && apt-get install locales && locale-gen en_US.UTF-8'
# for local development
- 'echo "MaxAuthTries 100" >> /etc/ssh/sshd_config'
CONFIG:
type: foss
trace_limit: 200
...
# vim: syntax=yaml
\ No newline at end of file
......@@ -29,7 +29,7 @@ describe 'nfs' do
end
server_service = 'nfs-kernel-server'
server_servicehelper = 'idmapd'
server_servicehelpers = %w[idmapd]
server_packages = %w[nfs-common nfs-kernel-server nfs4-acl-tools rpcbind]
client_services = %w[rpcbind]
client_nfs_vfour_services = %w[rpcbind]
......@@ -47,7 +47,7 @@ describe 'nfs' do
end
server_service = 'nfs-server'
server_servicehelper = 'nfs-idmapd'
server_servicehelpers = %w[nfs-idmapd]
server_packages = %w[nfs-common nfs-kernel-server nfs4-acl-tools rpcbind]
client_services = %w[rpcbind]
client_nfs_vfour_services = %w[rpcbind]
......@@ -65,10 +65,10 @@ describe 'nfs' do
end
server_service = 'nfs-kernel-server'
server_servicehelper = 'idmapd'
server_servicehelpers = %w[nfs-common]
server_packages = %w[nfs-common nfs-kernel-server nfs4-acl-tools rpcbind]
client_services = %w[rpcbind]
client_nfs_vfour_services = %w[rpcbind idmapd]
client_nfs_vfour_services = %w[rpcbind nfs-common]
client_packages = %w[nfs-common nfs4-acl-tools]
when 'Debian_8'
......@@ -83,7 +83,7 @@ describe 'nfs' do
end
server_service = 'nfs-kernel-server'
server_servicehelper = 'nfs-common'
server_servicehelpers = %w[nfs-common]
server_packages = %w[nfs-common nfs-kernel-server nfs4-acl-tools rpcbind]
client_services = %w[rpcbind]
client_nfs_vfour_services = %w[rpcbind nfs-common]
......@@ -101,7 +101,7 @@ describe 'nfs' do
end
server_service = 'nfs-server'
server_servicehelper = 'nfs-idmapd'
server_servicehelpers = %w[nfs-idmapd]
server_packages = %w[nfs-common nfs-kernel-server nfs4-acl-tools rpcbind]
client_services = %w[rpcbind]
client_nfs_vfour_services = %w[rpcbind]
......@@ -118,7 +118,7 @@ describe 'nfs' do
end
server_service = 'nfs'
server_servicehelper = 'rpcidmapd'
server_servicehelpers = %w[rpcidmapd rpcbind]
server_packages = %w[nfs-utils nfs4-acl-tools rpcbind]
client_services = %w[rpcbind]
client_nfs_vfour_services = %w[rpcbind rpcidmapd]
......@@ -135,10 +135,10 @@ describe 'nfs' do
end
server_service = 'nfs-server.service'
server_servicehelper = 'nfs-idmap.service'
server_servicehelpers = %w[nfs-idmap.service]
server_packages = %w[nfs-utils nfs4-acl-tools rpcbind]
client_services = %w[rpcbind.service]
client_nfs_vfour_services = %w[rpcbind.service]
client_services = %w[rpcbind.service rpcbind.socket]
client_nfs_vfour_services = %w[rpcbind.service rpcbind.socket]
client_packages = %w[nfs-utils nfs4-acl-tools rpcbind]
when 'Gentoo'
......@@ -152,7 +152,7 @@ describe 'nfs' do
end
server_service = 'nfs'
server_servicehelper = 'rpc.idmapd'
server_servicehelpers = %w[rpc.idmapd]
server_packages = %w[net-nds/rpcbind net-fs/nfs-utils net-libs/libnfsidmap]
client_services = %w[rpcbind]
client_nfs_vfour_services = %w[rpcbind rpc.idmapd]
......@@ -169,7 +169,7 @@ describe 'nfs' do
end
server_service = 'nfsserver'
server_servicehelper = ''
server_servicehelpers = ''
server_packages = %w[nfs-kernel-server]
client_services = %w[rpcbind nfs]
client_nfs_vfour_services = %w[rpcbind nfs]
......@@ -186,7 +186,7 @@ describe 'nfs' do
end
server_service = 'nfs-server.service'
server_servicehelper = 'nfs-idmapd'
server_servicehelpers = %w[nfs-idmapd]
server_packages = %w[nfs-utils]
client_services = %w[rpcbind]
client_nfs_vfour_services = %w[rpcbind]
......@@ -218,7 +218,8 @@ describe 'nfs' do
it { is_expected.to contain_file('/export').with('ensure' => 'directory') }
it { is_expected.to contain_augeas('/etc/idmapd.conf').with_changes(%r{set Domain teststring}) }
context os do
if server_servicehelper != ''
if server_servicehelpers != ''
server_servicehelpers.each do |server_servicehelper|
it do
is_expected.to contain_service(server_servicehelper).
with('ensure' => 'running').
......@@ -228,6 +229,7 @@ describe 'nfs' do
end
end
end
end
context 'server_enabled => false, client_enabled => true' do
let(:params) { { server_enabled: false, client_enabled: true } }
......@@ -235,7 +237,23 @@ describe 'nfs' do
it { is_expected.to contain_class('nfs::client::config') }
it { is_expected.to contain_class('nfs::client::package') }
it { is_expected.to contain_class('nfs::client::service') }
context os do
case os
when 'RedHat_7'
it do
is_expected.to contain_service('rpcbind.service').
with('ensure' => 'running').
with('enable' => false).
without_subscribe
end
it do
is_expected.to contain_service('rpcbind.socket').
with('ensure' => 'running').
with('enable' => true).
without_subscribe
end
else
client_services.each do |service|
it do
is_expected.to contain_service(service).
......@@ -244,6 +262,7 @@ describe 'nfs' do
end
end
end
end
context 'nfs_v4 => true' do
let(:params) { { nfs_v4_client: true, server_enabled: false, client_enabled: true } }
......@@ -288,7 +307,8 @@ describe 'nfs' do
it { is_expected.to contain_file('/export').with('ensure' => 'directory') }
it { is_expected.to contain_augeas('/etc/idmapd.conf').with_changes(%r{set Domain teststring}) }
context os do
if server_servicehelper != ''
if server_servicehelpers != ''
server_servicehelpers.each do |server_servicehelper|
it do
is_expected.to contain_service(server_servicehelper).
with('ensure' => 'running').
......@@ -296,6 +316,7 @@ describe 'nfs' do
end
end
end
end
server_packages.each do |package|
context os do
service = 'Service[' + server_service + ']'
......@@ -332,9 +353,13 @@ describe 'nfs' do
it { is_expected.not_to contain_service(server_service) }
end
context os do
if server_servicehelpers != ''
server_servicehelpers.each do |server_servicehelper|
it { is_expected.not_to contain_service(server_servicehelper) }
end
end
end
end
context 'nfs_v4 => true, storeconfigs_enabled => true' do
let(:params) { { nfs_v4: true, storeconfigs_enabled: true, server_enabled: true, nfs_v4_idmap_domain: 'teststring' } }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment