puppetlabs-xinetd-1.2.0/000755 000765 000024 00000000000 12176034650 015630 5ustar00hunnerstaff000000 000000 puppetlabs-xinetd-1.2.0/CHANGELOG000644 000765 000024 00000001103 12176034650 017035 0ustar00hunnerstaff000000 000000 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 1.1.0 - Add port and bind options to services - make services deletable 1.0.1 - 20100812 * added documentation 1.0.0 - 20100624 * initial release puppetlabs-xinetd-1.2.0/Gemfile000644 000765 000024 00000000645 12176034650 017130 0ustar00hunnerstaff000000 000000 source 'https://rubygems.org' group :development, :test do gem 'rake', :require => false gem 'rspec-puppet', :require => false gem 'puppetlabs_spec_helper', :require => false gem 'puppet-lint', :require => false end if puppetversion = ENV['PUPPET_GEM_VERSION'] gem 'puppet', puppetversion, :require => false else gem 'puppet', :require => false end # vim:ft=ruby puppetlabs-xinetd-1.2.0/Gemfile.lock000644 000765 000024 00000001513 12176034650 020052 0ustar00hunnerstaff000000 000000 GEM remote: https://rubygems.org/ specs: diff-lcs (1.2.4) facter (1.7.2) hiera (1.2.1) json_pure json_pure (1.8.0) metaclass (0.0.1) mocha (0.14.0) metaclass (~> 0.0.1) puppet (3.2.3) facter (~> 1.6) hiera (~> 1.0) rgen (~> 0.6.5) puppet-lint (0.3.2) puppetlabs_spec_helper (0.4.1) mocha (>= 0.10.5) rake rspec (>= 2.9.0) rspec-puppet (>= 0.1.1) rake (10.1.0) rgen (0.6.5) rspec (2.14.1) rspec-core (~> 2.14.0) rspec-expectations (~> 2.14.0) rspec-mocks (~> 2.14.0) rspec-core (2.14.4) rspec-expectations (2.14.0) diff-lcs (>= 1.1.3, < 2.0) rspec-mocks (2.14.1) rspec-puppet (0.1.6) rspec PLATFORMS ruby DEPENDENCIES puppet puppet-lint puppetlabs_spec_helper rake rspec-puppet puppetlabs-xinetd-1.2.0/LICENSE000644 000765 000024 00000001374 12176034650 016642 0ustar00hunnerstaff000000 000000 Xinetd Puppet Module. Copyright (C) 2010 Garrett Honeycutt Garrett Honeycutt can be contacted at: contact@garretthoneycutt.com. This program and entire repository is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA puppetlabs-xinetd-1.2.0/manifests/000755 000765 000024 00000000000 12176034650 017621 5ustar00hunnerstaff000000 000000 puppetlabs-xinetd-1.2.0/metadata.json000644 000765 000024 00000002770 12176034650 020311 0ustar00hunnerstaff000000 000000 { "name": "puppetlabs-xinetd", "version": "1.2.0", "source": "https://github.com/puppetlabs/puppetlabs-xinetd", "author": "Puppet Labs", "license": "Apache License 2.0", "summary": "Puppet Labs Xinetd Module", "description": "Puppet module to configure xinetd services", "project_page": "https://github.com/puppetlabs/puppetlabs-xinetd", "dependencies": [ { "name": "puppetlabs/stdlib", "version_requirement": ">= 2.2.1" } ], "types": [ ], "checksums": { "CHANGELOG": "5b9b4043ec6e89c17791822e716c8fea", "Gemfile": "75063ce32be0cee9d635bc8a1dfcbe27", "Gemfile.lock": "d08f5ba1e7865283624e1dad14b0d8ca", "LICENSE": "c213819d6586389247f91b04ccd00802", "Modulefile": "2446caa19e31e075a8ac410da5099a74", "README": "d7257388d0242a22d7a95a0af3005674", "Rakefile": "0254db5d3fc38c67a2c160d7296a24f8", "manifests/init.pp": "e63a6b40fbb7f1bdacf1f956cc1ad6fe", "manifests/params.pp": "d8c37920c22b27a47a4150ad60ad1adc", "manifests/service.pp": "2d84a98917504d91125130f0f69e9562", "spec/classes/xinetd_init_spec.rb": "db443eb5e3d8e3f177a2e11ee3e1c1e0", "spec/defines/xinetd_service_spec.rb": "49b9566836aa61d56f5622b45f1d56ab", "spec/spec.opts": "a600ded995d948e393fbe2320ba8e51c", "spec/spec_helper.rb": "0db89c9a486df193c0e40095422e19dc", "templates/service.erb": "686185a0237be1037aa00949e85ed918", "templates/xinetd.conf.erb": "39a49b490f2bd5e0b133ce9a58a74b0b", "tests/init.pp": "c31f20acadb59d84cc56ebe12a138a03" } }puppetlabs-xinetd-1.2.0/Modulefile000644 000765 000024 00000000540 12176034650 017637 0ustar00hunnerstaff000000 000000 name 'puppetlabs-xinetd' version '1.2.0' source 'https://github.com/puppetlabs/puppetlabs-xinetd' author 'Puppet Labs' license 'Apache License 2.0' summary 'Puppet Labs Xinetd Module' description 'Puppet module to configure xinetd services' project_page 'https://github.com/puppetlabs/puppetlabs-xinetd' dependency 'puppetlabs/stdlib', '>= 2.2.1' puppetlabs-xinetd-1.2.0/Rakefile000644 000765 000024 00000000054 12176034650 017274 0ustar00hunnerstaff000000 000000 require 'puppetlabs_spec_helper/rake_tasks' puppetlabs-xinetd-1.2.0/README000644 000765 000024 00000002514 12176034650 016512 0ustar00hunnerstaff000000 000000 xinetd This is the xinetd module. # Definition: xinetd::service # # sets up a xinetd service # all parameters match up with xinetd.conf(5) man page # # Parameters: # $cps - optional # $flags - optional # $per_source - optional # $port - required - determines the service port # $server - required - determines the program to execute for this service # $server_args - optional # $disable - optional - defaults to "no" # $socket_type - optional - defaults to "stream" # $protocol - optional - defaults to "tcp" # $user - optional - defaults to "root" # $group - optional - defaults to "root" # $instances - optional - defaults to "UNLIMITED" # $wait - optional - based on $protocol will default to "yes" for udp and "no" for tcp # $service_type - optional - type setting in xinetd # # Actions: # setups up a xinetd service by creating a file in /etc/xinetd.d/ # # Requires: # $server must be set # # Sample Usage: # # setup tftp service # xinetd::service {"tftp": # port => "69", # server => "/usr/sbin/in.tftpd", # server_args => "-s $base", # socket_type => "dgram", # protocol => "udp", # cps => "100 2", # flags => "IPv4", # per_source => "11", # } # xinetd::service puppetlabs-xinetd-1.2.0/spec/000755 000765 000024 00000000000 12176034650 016562 5ustar00hunnerstaff000000 000000 puppetlabs-xinetd-1.2.0/templates/000755 000765 000024 00000000000 12176034650 017626 5ustar00hunnerstaff000000 000000 puppetlabs-xinetd-1.2.0/tests/000755 000765 000024 00000000000 12176034650 016772 5ustar00hunnerstaff000000 000000 puppetlabs-xinetd-1.2.0/tests/init.pp000644 000765 000024 00000000017 12176034650 020274 0ustar00hunnerstaff000000 000000 include xinetd puppetlabs-xinetd-1.2.0/templates/service.erb000644 000765 000024 00000002522 12176034650 021761 0ustar00hunnerstaff000000 000000 # This file is being maintained by Puppet. # DO NOT EDIT service <%= @service_name %> { port = <%= @port %> disable = <%= @disable %> socket_type = <%= @socket_type %> protocol = <%= @protocol %> wait = <%= @_wait %> user = <%= @user %> group = <%= @group %> groups = <%= @groups %> server = <%= @server %> <% if @bind -%> bind = <%= @bind %> <% end -%> <% if @service_type -%> type = <%= @service_type %> <% end -%> <% if @server_args -%> server_args = <%= @server_args %> <% end -%> <% if @only_from -%> only_from = <%= @only_from %> <% end -%> <% if @per_source -%> per_source = <%= @per_source %> <% end -%> <% if @log_on_failure -%> log_on_failure += <%= @log_on_failure %> <% end -%> <% if @cps -%> cps = <%= @cps %> <% end -%> <% if @flags -%> flags = <%= @flags %> <% end -%> <% if @xtype -%> type = <%= @xtype %> <% end -%> <% if @no_access -%> no_access = <%= @no_access %> <% end -%> <% if @access_times -%> access_times = <%= @access_times %> <% end -%> <% if @log_type -%> log_type = <%= @log_type %> <% end -%> } puppetlabs-xinetd-1.2.0/templates/xinetd.conf.erb000644 000765 000024 00000002443 12176034650 022542 0ustar00hunnerstaff000000 000000 # This file is being maintained by Puppet. # DO NOT EDIT # # This is the master xinetd configuration file. Settings in the # default section will be inherited by all service configurations # unless explicitly overridden in the service configuration. See # xinetd.conf in the man pages for a more detailed explanation of # these attributes. defaults { # The next two items are intended to be a quick access place to # temporarily enable or disable services. # # enabled = # disabled = # Define general logging characteristics. log_type = SYSLOG daemon info log_on_failure = HOST log_on_success = PID HOST DURATION EXIT # Define access restriction defaults # # no_access = # only_from = # max_load = 0 cps = 50 10 instances = 50 per_source = 10 # Address and networking defaults # # bind = # mdns = yes v6only = no # setup environmental attributes # # passenv = groups = yes umask = 002 # Generally, banners are not used. This sets up their global defaults # # banner = # banner_fail = # banner_success = } includedir <%= @confdir %> puppetlabs-xinetd-1.2.0/spec/classes/000755 000765 000024 00000000000 12176034650 020217 5ustar00hunnerstaff000000 000000 puppetlabs-xinetd-1.2.0/spec/defines/000755 000765 000024 00000000000 12176034650 020177 5ustar00hunnerstaff000000 000000 puppetlabs-xinetd-1.2.0/spec/fixtures/000755 000765 000024 00000000000 12176034650 020433 5ustar00hunnerstaff000000 000000 puppetlabs-xinetd-1.2.0/spec/spec.opts000644 000765 000024 00000000057 12176034650 020425 0ustar00hunnerstaff000000 000000 --format s --colour --loadby mtime --backtrace puppetlabs-xinetd-1.2.0/spec/spec_helper.rb000644 000765 000024 00000000064 12176034650 021400 0ustar00hunnerstaff000000 000000 require 'puppetlabs_spec_helper/module_spec_helper' puppetlabs-xinetd-1.2.0/spec/fixtures/modules/000755 000765 000024 00000000000 12176034650 022103 5ustar00hunnerstaff000000 000000 puppetlabs-xinetd-1.2.0/spec/defines/xinetd_service_spec.rb000644 000765 000024 00000001500 12176034650 024545 0ustar00hunnerstaff000000 000000 require 'spec_helper' describe 'xinetd::service' do let :facts do { :osfamily => 'Debian' } end let :default_params do { 'port' => '80', 'server' => 'httpd' } end let :title do "httpd" end describe 'with default ensure' do let :params do default_params end it { should contain_file('/etc/xinetd.d/httpd').with_ensure('present') } end describe 'with ensure=present' do let :params do default_params.merge({'ensure' => 'present'}) end it { should contain_file('/etc/xinetd.d/httpd').with_ensure('present') } end describe 'with ensure=absent' do let :params do default_params.merge({'ensure' => 'absent'}) end it { should contain_file('/etc/xinetd.d/httpd').with_ensure('absent') } end end puppetlabs-xinetd-1.2.0/spec/classes/xinetd_init_spec.rb000644 000765 000024 00000000347 12176034650 024100 0ustar00hunnerstaff000000 000000 require 'spec_helper' describe 'xinetd' do let :facts do { :osfamily => 'Debian' } end it { should contain_package('xinetd') should contain_file('/etc/xinetd.conf') should contain_service('xinetd') } end puppetlabs-xinetd-1.2.0/manifests/init.pp000644 000765 000024 00000002100 12176034650 021116 0ustar00hunnerstaff000000 000000 # Class: xinetd # # This module manages xinetd # # Sample Usage: # xinetd::service { 'rsync': # port => '873', # server => '/usr/bin/rsync', # server_args => '--daemon --config /etc/rsync.conf', # } # class xinetd ( $confdir = $xinetd::params::confdir, $conffile = $xinetd::params::conffile, $package_name = $xinetd::params::package_name, $service_name = $xinetd::params::service_name ) inherits xinetd::params { File { owner => 'root', group => '0', notify => Service[$service_name], require => Package[$package_name], } file { $confdir: ensure => directory, mode => '0755', } # Template uses: # $confdir file { $conffile: ensure => file, mode => '0644', content => template('xinetd/xinetd.conf.erb'), } package { $package_name: ensure => installed, before => Service[$service_name], } service { $service_name: ensure => running, enable => true, hasrestart => false, hasstatus => true, require => File[$conffile], } } puppetlabs-xinetd-1.2.0/manifests/params.pp000644 000765 000024 00000001514 12176034650 021446 0ustar00hunnerstaff000000 000000 class xinetd::params { case $::osfamily { 'Debian': { $confdir = '/etc/xinetd.d' $conffile = '/etc/xinetd.conf' $package_name = 'xinetd' $service_name = 'xinetd' } 'FreeBSD': { $confdir = '/usr/local/etc/xinetd.d' $conffile = '/usr/local/etc/xinetd.conf' $package_name = 'security/xinetd' $service_name = 'xinetd' } 'Suse': { $confdir = '/etc/xinetd.d' $conffile = '/etc/xinetd.conf' $package_name = 'xinetd' $service_name = 'xinetd' } 'RedHat': { $confdir = '/etc/xinetd.d' $conffile = '/etc/xinetd.conf' $package_name = 'xinetd' $service_name = 'xinetd' } default: { fail("xinetd: module does not support osfamily ${::osfamily}") } } } puppetlabs-xinetd-1.2.0/manifests/service.pp000644 000765 000024 00000006516 12176034650 021632 0ustar00hunnerstaff000000 000000 # Definition: xinetd::service # # sets up a xinetd service # all parameters match up with xinetd.conf(5) man page # # Parameters: # $ensure - optional - defaults to 'present' # $log_on_failure - optional - may contain any combination of # 'HOST', 'USERID', 'ATTEMPT' # $service_type - optional - type setting in xinetd # may contain any combinarion of 'RPC', 'INTERNAL', # 'TCPMUX/TCPMUXPLUS', 'UNLISTED' # $cps - optional # $flags - optional # $per_source - optional # $port - required - determines the service port # $server - required - determines the program to execute for this service # $server_args - optional # $disable - optional - defaults to "no" # $socket_type - optional - defaults to "stream" # $protocol - optional - defaults to "tcp" # $user - optional - defaults to "root" # $group - optional - defaults to "root" # $groups - optional - defaults to "yes" # $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) # $no_access - optional # $access_times - optional # $log_type - optional # $bind - optional # # Actions: # setups up a xinetd service by creating a file in /etc/xinetd.d/ # # Requires: # $server must be set # $port must be set # # Sample Usage: # # setup tftp service # xinetd::service { 'tftp': # port => '69', # server => '/usr/sbin/in.tftpd', # server_args => '-s $base', # socket_type => 'dgram', # protocol => 'udp', # cps => '100 2', # flags => 'IPv4', # per_source => '11', # } # xinetd::service # define xinetd::service ( $port, $server, $ensure = present, $log_on_failure = undef, $service_type = undef, $service_name = $title, $cps = undef, $disable = 'no', $flags = undef, $group = 'root', $groups = 'yes', $instances = 'UNLIMITED', $log_on_failure = undef, $per_source = undef, $protocol = 'tcp', $server_args = undef, $socket_type = 'stream', $user = 'root', $only_from = undef, $wait = undef, $xtype = undef, $no_access = undef, $access_times = undef, $log_type = undef, $bind = undef, ) { include xinetd if $wait { $_wait = $wait } else { validate_re($protocol, '(tcp|udp)') $_wait = $protocol ? { tcp => 'no', udp => 'yes' } } # Template uses: # - $port # - $disable # - $socket_type # - $protocol # - $_wait # - $user # - $group # - $groups # - $server # - $bind # - $service_type # - $server_args # - $only_from # - $per_source # - $log_on_failure # - $cps # - $flags # - $xtype # - $no_access # - $access_types # - $log_type file { "${xinetd::confdir}/${title}": ensure => $ensure, owner => 'root', mode => '0644', content => template('xinetd/service.erb'), notify => Service[$xinetd::service_name], require => File[$xinetd::confdir], } }