Skip to content

Commit

Permalink
Update xinetd to 5e31388979e8f3a667899fad5cefa95289e22281
Browse files Browse the repository at this point in the history
5e31388979e8f3a667899fad5cefa95289e22281 Merge pull request redhat-openstack#49 from mhaskel/1.5.0-prep
8a4a6007ad87830bc0cbcce37e715b56b8a8dc29 move tests to examples
2bc153a8d87dcd3e889d2269752dbf22c9eb7b18 1.5.0 prep
d40229e923ede69cab27a74856a19b34a90b60a1 Merge pull request redhat-openstack#47 from twc-openstack/manage_confdir
57c37d73098186bcc62d89cf97f07edbfcaeb60f Add the ability to manage the xinetd.d conf dir
7370f949f57f0d48d8a0d5fc3d29f955c480674e Merge pull request redhat-openstack#48 from hunner/fix_rspec
29839eaf6835599d66b791d95ff97b928cc275b9 Pin to rspec-puppet 1.x until migration
64b20bbe082b7c2a185159193ae8970de188b0d2 Merge pull request redhat-openstack#42 from jewjitsu/packageensure
d712b23e308455f2f11b01cc3aaa1076e18523f8 add framework for setting package_ensure
9530a0c1e071030a931fd575ead069cabbf65b22 Merge pull request redhat-openstack#43 from decibelhertz/master
be0a89c9f02ef5b3d3da99f8bff1c24558546fb0 Add support for 'nice' argument.
c0d03c8e86f2c5f5bfbc0e35618a9c3a8b8e6d15 Merge pull request redhat-openstack#46 from mhaskel/1.4.0-prep
b0261d0dd2bcccfb3c0f1ea5f6430947cc83b1bb 1.4.0 prep
509b6c77cb192c8f21570e2364ea560bed84add1 Lint cleanup
11a912fe0587b09ceb0ceca73ec8e7a97603ebec Merge pull request redhat-openstack#41 from jewjitsu/defaultusergroup
42b688d51092d2683c3f799594d6df29208bd7b1 Merge pull request redhat-openstack#40 from chrigl/add-gentoo-support
ebd6bd58ddb1e47a6b4a78559a4ba1037414dfd9 Merge pull request redhat-openstack#37 from faker-/master
8b9f19c1974801286c2f6278c2773a21401fb66f Add deprecation warning when $xtype parameter is being used
79cba41d2cf8bee0d74740c6a640435fea41ed73 Merge remote-tracking branch 'upstream/master'
76c47af575875825202f4ac76da2eb641ef11cc9 Merge pull request redhat-openstack#45 from laurenrother/summary
3a9bc33b596597953836119b86667456544d1c1d Add metadata summary per FM-1523
9164a3a93f7bcb9cb0fe4a83eb09ae4d9fb3c26c make default user and group more dynamic and set appropriate group per OS
04dfdde548b2a74d1135446e2b349679f0447d03 added support for gentoo
0740f53 Merge pull request redhat-openstack#38 from apenney/131-release
1bef65e Prepare 1.3.1 release.
aa9895b9d7186237586c4f65f84bbfb76194e45a Remove xtype parameter
ef81a5b Merge pull request redhat-openstack#36 from mhaskel/1.3.0-prep
4e7191d Prep for 1.3.0 release.
  • Loading branch information
xbezdick committed Feb 27, 2015
1 parent 0b6e7ed commit fdd4e90
Show file tree
Hide file tree
Showing 14 changed files with 170 additions and 46 deletions.
2 changes: 1 addition & 1 deletion Puppetfile
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,6 @@ mod 'vswitch',
:git => 'https://github.com/stackforge/puppet-vswitch.git'

mod 'xinetd',
:commit => '6b02de8d4f30a819eb404048e4258e3a5e8023c8',
:commit => '5e31388979e8f3a667899fad5cefa95289e22281',
:git => 'https://github.com/puppetlabs/puppetlabs-xinetd.git'

1 change: 0 additions & 1 deletion xinetd/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
metadata.json
pkg/
.DS_Store
*.swp
Expand Down
22 changes: 0 additions & 22 deletions xinetd/CHANGELOG

This file was deleted.

62 changes: 62 additions & 0 deletions xinetd/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
##2015-02-10 - Release 1.5.0
###Summary
This release adds some new parameters and also pins to rspec-puppet 1.x until migration.

####Features
- New parameters in `class xinetd`
- `package_ensure`
- `purge_confdir`
- New parameter in `xinetd::service`
- `nice`

##2015-01-20 - Release 1.4.0
###Summary

This release adds support for Gentoo and improves FreeBSD support

####Features
- Gentoo support added
- Better defaults for group for FreeBSD
- Add deprecation warning for `$xtype` parameter

##2014-07-15 - Release 1.3.1
###Summary

This release merely updates metadata.json so the module can be uninstalled and
upgraded via the puppet module command.

##2014-06-18 - Release 1.3.0
####Features
- Add 'log_on_success', 'log_on_success_operator' and 'log_on_failure_operator
parameters to xinetd::service
- Add 'service_restart', 'service_status', 'service_hasrestart', and
'service_hasstatus' parameters to class xinetd.
- Add support for Amazon Linux.
- License changes to ASLv2
- Testing and documentation updates.

####Bugfixes
- Remove duplicated $log_on_failure parameter

##2013-07-30 - Release 1.2.0
####Features
- Add `confdir`, `conffile`, `package_name`, and `service_name` parameters to
`Class['xinetd']`
- Add support for FreeBSD and Suse.
- Add `log_on_failure`, `service_name`, `groups`, `no_access`, `access_times`,
`log_type`, `only_from`, and `xtype` parameters to `Xinetd::Service` define

####Bugfixes
- Redesign for `xinetd::params` pattern
- Add validation
- Add unit testing

##2012-06-07 - Release 1.1.0
- Add port and bind options to services
- make services deletable

##2010-08-12 - Release 1.0.1
-added documentation

##2010-06-24 - Release 1.0.0
- initial release
2 changes: 1 addition & 1 deletion xinetd/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ source 'https://rubygems.org'

group :development, :test do
gem 'rake', :require => false
gem 'rspec-puppet', :require => false
gem 'rspec-puppet', '~> 1.0', :require => false
gem 'puppetlabs_spec_helper', :require => false
gem 'puppet-lint', :require => false
gem 'serverspec', :require => false
Expand Down
9 changes: 0 additions & 9 deletions xinetd/Modulefile

This file was deleted.

File renamed without changes.
6 changes: 5 additions & 1 deletion xinetd/manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,13 @@
$confdir = $xinetd::params::confdir,
$conffile = $xinetd::params::conffile,
$package_name = $xinetd::params::package_name,
$package_ensure = $xinetd::params::package_ensure,
$service_name = $xinetd::params::service_name,
$service_restart = $xinetd::params::service_restart,
$service_status = $xinetd::params::service_status,
$service_hasrestart = $xinetd::params::service_hasrestart,
$service_hasstatus = $xinetd::params::service_hasstatus,
$purge_confdir = false,
) inherits xinetd::params {

File {
Expand All @@ -30,6 +32,8 @@
file { $confdir:
ensure => directory,
mode => '0755',
recurse => $purge_confdir,
purge => $purge_confdir,
}

# Template uses:
Expand All @@ -41,7 +45,7 @@
}

package { $package_name:
ensure => installed,
ensure => $package_ensure,
before => Service[$service_name],
}

Expand Down
20 changes: 19 additions & 1 deletion xinetd/manifests/params.pp
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
class xinetd::params {
$default_default_user = 'root'
$default_default_group = 'root'
$package_ensure = 'installed'

case $::osfamily {
'Debian': {
Expand All @@ -13,6 +16,7 @@
'FreeBSD': {
$confdir = '/usr/local/etc/xinetd.d'
$conffile = '/usr/local/etc/xinetd.conf'
$default_group = 'wheel'
$package_name = 'security/xinetd'
$service_hasrestart = false
$service_hasstatus = true
Expand All @@ -36,6 +40,14 @@
$service_name = 'xinetd'
$service_restart = "/sbin/service ${service_name} reload"
}
'Gentoo': {
$confdir = '/etc/xinetd.d'
$conffile = '/etc/xinetd.conf'
$package_name = 'sys-apps/xinetd'
$service_hasrestart = true
$service_hasstatus = true
$service_name = 'xinetd'
}
'Linux': {
case $::operatingsystem {
'Amazon': {
Expand All @@ -54,5 +66,11 @@
}
}
}
if $default_user == undef {
$default_user = $default_default_user
}
if $default_group == undef {
$default_group = $default_default_group
}
}
24 changes: 19 additions & 5 deletions xinetd/manifests/service.pp
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,12 @@
# $instances - optional - defaults to "UNLIMITED"
# $only_from - optional
# $wait - optional - based on $protocol will default to "yes" for udp and "no" for tcp
# $xtype - optional - determines the "type" of service, see xinetd.conf(5)
# $xtype - deprecated - use $service_type instead
# $no_access - optional
# $access_times - optional
# $log_type - optional
# $bind - optional
# $nice - optional
#
# Actions:
# setups up a xinetd service by creating a file in /etc/xinetd.d/
Expand All @@ -57,6 +58,7 @@
# cps => '100 2',
# flags => 'IPv4',
# per_source => '11',
# nice => '19',
# } # xinetd::service
#
define xinetd::service (
Expand All @@ -72,21 +74,22 @@
$cps = undef,
$disable = 'no',
$flags = undef,
$group = 'root',
$group = $xinetd::params::default_group,
$groups = 'yes',
$instances = 'UNLIMITED',
$per_source = undef,
$protocol = 'tcp',
$server_args = undef,
$socket_type = 'stream',
$user = 'root',
$user = $xinetd::params::default_user,
$only_from = undef,
$wait = undef,
$xtype = undef,
$no_access = undef,
$access_times = undef,
$log_type = undef,
$bind = undef
$bind = undef,
$nice = undef
) {

include xinetd
Expand All @@ -101,6 +104,16 @@
}
}

if $xtype {
warning ('The $xtype parameter to xinetd::service is deprecated. Use the service_type parameter instead.')
}
if $nice {
validate_re($nice,'^-?[0-9]+$')
if !is_numeric($nice) or $nice < -19 or $nice > 19 {
fail("Invalid value for nice, ${nice}")
}
}

# Template uses:
# - $port
# - $disable
Expand All @@ -122,10 +135,11 @@
# - $log_on_failure_operator
# - $cps
# - $flags
# - $xtype
# - $xtype (deprecated)
# - $no_access
# - $access_types
# - $log_type
# - $nice
file { "${xinetd::confdir}/${title}":
ensure => $ensure,
owner => 'root',
Expand Down
14 changes: 14 additions & 0 deletions xinetd/metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "puppetlabs-xinetd",
"version": "1.5.0",
"author": "puppetlabs",
"summary": "Configures xinetd and exposes the xinetd::service definition for adding new services.",
"license": "Apache-2.0",
"source": "https://github.com/puppetlabs/puppetlabs-xinetd",
"project_page": "https://github.com/puppetlabs/puppetlabs-xinetd",
"issues_url": "https://tickets.puppetlabs.com/browse/MODULES",
"description": "Puppet module to configure xinetd services",
"dependencies": [
{"name":"puppetlabs/stdlib","version_requirement":">=2.2.1"}
]
}
30 changes: 25 additions & 5 deletions xinetd/spec/classes/xinetd_init_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,29 @@
{ :osfamily => 'Debian' }
end

it {
should contain_package('xinetd')
should contain_file('/etc/xinetd.conf')
should contain_service('xinetd')
}
describe 'with defaults' do
it {
should contain_package('xinetd')
should contain_file('/etc/xinetd.conf')
should contain_file('/etc/xinetd.d').with_ensure('directory')
should contain_file('/etc/xinetd.d').with_recurse(false)
should contain_file('/etc/xinetd.d').with_purge(false)
should contain_service('xinetd')
}
end

describe 'with managed confdir' do
let :params do
{ :purge_confdir => true }
end

it {
should contain_package('xinetd')
should contain_file('/etc/xinetd.conf')
should contain_file('/etc/xinetd.d').with_ensure('directory')
should contain_file('/etc/xinetd.d').with_recurse(true)
should contain_file('/etc/xinetd.d').with_purge(true)
should contain_service('xinetd')
}
end
end
21 changes: 21 additions & 0 deletions xinetd/spec/defines/xinetd_service_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,25 @@
}
end

# nice values, good
['-19','9','19'].each do |i|
describe "with nice #{i}" do
let :params do
default_params.merge({ :nice => i })
end
it {
should contain_file('/etc/xinetd.d/httpd').with_content(
/nice\s*=\s*#{i}/)
}
end
end
# nice values, bad
['-20','90','foo'].each do |i|
describe "with nice #{i}" do
let :params do
default_params.merge({ :nice => i })
end
it { expect { should compile }.to raise_error(Puppet::Error) }
end
end
end
3 changes: 3 additions & 0 deletions xinetd/templates/service.erb
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,7 @@ service <%= @service_name %>
<% if @log_type -%>
log_type = <%= @log_type %>
<% end -%>
<% if @nice -%>
nice = <%= @nice %>
<% end -%>
}

0 comments on commit fdd4e90

Please sign in to comment.