puppetlabs-xinetd-3.0.00040755000076700000240000000000013165217645012101 5ustar00puppetlabs-xinetd-3.0.0/CHANGELOG.md0100644000076700000240000000647713165217515014000 0ustar00## Unsupported Release 3.0.0 ### Summary This is a major release that removes support for Puppet 3.x and changes a default in manifests/service.pp #### Added - The following parameters: - `cps` - `service_hasstatus`, `service_hasrestart` (for Amazon linux) - `service_restart`, `service_status` (for Archlinux) - `passenv` - `use_default_group` - Puppet 4 & 5 support #### Changed - Puppet version requirement lower bound to 4.7.1 - `$xinetd::service::server` now defaults to `undef` #### Fixed - config template to supress unnecessary newlines ## Release 2.0.0 ### Summary This is a major release that removes support for Puppet 2.x and adds support for Puppet 3.8 and Puppet 4.0. Also includes various new parameters and bugfixes. #### Backwards Incompatibility - Removes support for Puppet 2.x #### Features - Adds Puppet 3.8.x support - Adds Puppet 4.x support - Adds compatibility with ArchLinux - New parameters in `xinetd` - $enabled - $disabled - $log_type - $log_on_failure - $log_on_success - $no_access - $only_from - $max_load - $instances - $per_source - $bind - $mdns - $v6only - $env - $passenv - $groups - $umask - $banner - $banner_fail - $banner_success - $purge_confdir - $redirect - New parameters in `xinetd::service` - $nice - $env #### Bugfixes - (MODULES-2012) Fixes a strict_variables failure when `$default_user` and `$default_group` are set. - Fixes a strict_variables failure on Debian. - Pipe through instances variable from xinetd::service. Documented but not implemented. - Changes `$port` to an optional parameter. - (MODULES-2313) Fixes default_user/group functionality ## 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 puppetlabs-xinetd-3.0.0/CONTRIBUTING.md0100644000076700000240000002306013164770340014402 0ustar00# Contributing to Puppet modules So you want to contribute to a Puppet module: Great! Below are some instructions to get you started doing that very thing while setting expectations around code quality as well as a few tips for making the process as easy as possible. ### Table of Contents 1. [Getting Started](#getting-started) 1. [Commit Checklist](#commit-checklist) 1. [Submission](#submission) 1. [More about commits](#more-about-commits) 1. [Testing](#testing) - [Running Tests](#running-tests) - [Writing Tests](#writing-tests) 1. [Get Help](#get-help) ## Getting Started - Fork the module repository on GitHub and clone to your workspace - Make your changes! ## Commit Checklist ### The Basics - [x] my commit is a single logical unit of work - [x] I have checked for unnecessary whitespace with "git diff --check" - [x] my commit does not include commented out code or unneeded files ### The Content - [x] my commit includes tests for the bug I fixed or feature I added - [x] my commit includes appropriate documentation changes if it is introducing a new feature or changing existing functionality - [x] my code passes existing test suites ### The Commit Message - [x] the first line of my commit message includes: - [x] an issue number (if applicable), e.g. "(MODULES-xxxx) This is the first line" - [x] a short description (50 characters is the soft limit, excluding ticket number(s)) - [x] the body of my commit message: - [x] is meaningful - [x] uses the imperative, present tense: "change", not "changed" or "changes" - [x] includes motivation for the change, and contrasts its implementation with the previous behavior ## Submission ### Pre-requisites - Make sure you have a [GitHub account](https://github.com/join) - [Create a ticket](https://tickets.puppet.com/secure/CreateIssue!default.jspa), or [watch the ticket](https://tickets.puppet.com/browse/) you are patching for. ### Push and PR - Push your changes to your fork - [Open a Pull Request](https://help.github.com/articles/creating-a-pull-request-from-a-fork/) against the repository in the puppetlabs organization ## More about commits 1. Make separate commits for logically separate changes. Please break your commits down into logically consistent units which include new or changed tests relevant to the rest of the change. The goal of doing this is to make the diff easier to read for whoever is reviewing your code. In general, the easier your diff is to read, the more likely someone will be happy to review it and get it into the code base. If you are going to refactor a piece of code, please do so as a separate commit from your feature or bug fix changes. We also really appreciate changes that include tests to make sure the bug is not re-introduced, and that the feature is not accidentally broken. Describe the technical detail of the change(s). If your description starts to get too long, that is a good sign that you probably need to split up your commit into more finely grained pieces. Commits which plainly describe the things which help reviewers check the patch and future developers understand the code are much more likely to be merged in with a minimum of bike-shedding or requested changes. Ideally, the commit message would include information, and be in a form suitable for inclusion in the release notes for the version of Puppet that includes them. Please also check that you are not introducing any trailing whitespace or other "whitespace errors". You can do this by running "git diff --check" on your changes before you commit. 2. Sending your patches To submit your changes via a GitHub pull request, we _highly_ recommend that you have them on a topic branch, instead of directly on "master". It makes things much easier to keep track of, especially if you decide to work on another thing before your first change is merged in. GitHub has some pretty good [general documentation](http://help.github.com/) on using their site. They also have documentation on [creating pull requests](https://help.github.com/articles/creating-a-pull-request-from-a-fork/). In general, after pushing your topic branch up to your repository on GitHub, you can switch to the branch in the GitHub UI and click "Pull Request" towards the top of the page in order to open a pull request. 3. Update the related JIRA issue. If there is a JIRA issue associated with the change you submitted, then you should update the ticket to include the location of your branch, along with any other commentary you may wish to make. # Testing ## Getting Started Our Puppet modules provide [`Gemfile`](./Gemfile)s, which can tell a Ruby package manager such as [bundler](http://bundler.io/) what Ruby packages, or Gems, are required to build, develop, and test this software. Please make sure you have [bundler installed](http://bundler.io/#getting-started) on your system, and then use it to install all dependencies needed for this project in the project root by running ```shell % bundle install --path .bundle/gems Fetching gem metadata from https://rubygems.org/........ Fetching gem metadata from https://rubygems.org/.. Using rake (10.1.0) Using builder (3.2.2) -- 8><-- many more --><8 -- Using rspec-system-puppet (2.2.0) Using serverspec (0.6.3) Using rspec-system-serverspec (1.0.0) Using bundler (1.3.5) Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed. ``` NOTE: some systems may require you to run this command with sudo. If you already have those gems installed, make sure they are up-to-date: ```shell % bundle update ``` ## Running Tests With all dependencies in place and up-to-date, run the tests: ### Unit Tests ```shell % bundle exec rake spec ``` This executes all the [rspec tests](http://rspec-puppet.com/) in the directories defined [here](https://github.com/puppetlabs/puppetlabs_spec_helper/blob/699d9fbca1d2489bff1736bb254bb7b7edb32c74/lib/puppetlabs_spec_helper/rake_tasks.rb#L17) and so on. rspec tests may have the same kind of dependencies as the module they are testing. Although the module defines these dependencies in its [metadata.json](./metadata.json), rspec tests define them in [.fixtures.yml](./fixtures.yml). ### Acceptance Tests Some Puppet modules also come with acceptance tests, which use [beaker][]. These tests spin up a virtual machine under [VirtualBox](https://www.virtualbox.org/), controlled with [Vagrant](http://www.vagrantup.com/), to simulate scripted test scenarios. In order to run these, you need both Virtualbox and Vagrant installed on your system. Run the tests by issuing the following command ```shell % bundle exec rake spec_clean % bundle exec rspec spec/acceptance ``` This will now download a pre-fabricated image configured in the [default node-set](./spec/acceptance/nodesets/default.yml), install Puppet, copy this module, and install its dependencies per [spec/spec_helper_acceptance.rb](./spec/spec_helper_acceptance.rb) and then run all the tests under [spec/acceptance](./spec/acceptance). ## Writing Tests ### Unit Tests When writing unit tests for Puppet, [rspec-puppet][] is your best friend. It provides tons of helper methods for testing your manifests against a catalog (e.g. contain_file, contain_package, with_params, etc). It would be ridiculous to try and top rspec-puppet's [documentation][rspec-puppet_docs] but here's a tiny sample: Sample manifest: ```puppet file { "a test file": ensure => present, path => "/etc/sample", } ``` Sample test: ```ruby it 'does a thing' do expect(subject).to contain_file("a test file").with({:path => "/etc/sample"}) end ``` ### Acceptance Tests Writing acceptance tests for Puppet involves [beaker][] and its cousin [beaker-rspec][]. A common pattern for acceptance tests is to create a test manifest, apply it twice to check for idempotency or errors, then run expectations. ```ruby it 'does an end-to-end thing' do pp = <<-EOF file { 'a test file': ensure => present, path => "/etc/sample", content => "test string", } apply_manifest(pp, :catch_failures => true) apply_manifest(pp, :catch_changes => true) end describe file("/etc/sample") do it { is_expected.to contain "test string" } end ``` # If you have commit access to the repository Even if you have commit access to the repository, you still need to go through the process above, and have someone else review and merge in your changes. The rule is that **all changes must be reviewed by a project developer that did not write the code to ensure that all changes go through a code review process.** The record of someone performing the merge is the record that they performed the code review. Again, this should be someone other than the author of the topic branch. # Get Help ### On the web * [Puppet help messageboard](http://puppet.com/community/get-help) * [Writing tests](https://docs.puppet.com/guides/module_guides/bgtm.html#step-three-module-testing) * [General GitHub documentation](http://help.github.com/) * [GitHub pull request documentation](http://help.github.com/send-pull-requests/) ### On chat * Slack (slack.puppet.com) #forge-modules, #puppet-dev, #windows, #voxpupuli * IRC (freenode) #puppet-dev, #voxpupuli [rspec-puppet]: http://rspec-puppet.com/ [rspec-puppet_docs]: http://rspec-puppet.com/documentation/ [beaker]: https://github.com/puppetlabs/beaker [beaker-rspec]: https://github.com/puppetlabs/beaker-rspec puppetlabs-xinetd-3.0.0/Gemfile0100644000076700000240000000707713164500605013451 0ustar00#This file is generated by ModuleSync, do not edit. source ENV['GEM_SOURCE'] || "https://rubygems.org" # Determines what type of gem is requested based on place_or_version. def gem_type(place_or_version) if place_or_version =~ /^git:/ :git elsif place_or_version =~ /^file:/ :file else :gem end end # Find a location or specific version for a gem. place_or_version can be a # version, which is most often used. It can also be git, which is specified as # `git://somewhere.git#branch`. You can also use a file source location, which # is specified as `file://some/location/on/disk`. def location_for(place_or_version, fake_version = nil) if place_or_version =~ /^(git[:@][^#]*)#(.*)/ [fake_version, { :git => $1, :branch => $2, :require => false }].compact elsif place_or_version =~ /^file:\/\/(.*)/ ['>= 0', { :path => File.expand_path($1), :require => false }] else [place_or_version, { :require => false }] end end # Used for gem conditionals supports_windows = false ruby_version_segments = Gem::Version.new(RUBY_VERSION.dup).segments minor_version = "#{ruby_version_segments[0]}.#{ruby_version_segments[1]}" group :development do gem "puppet-module-posix-default-r#{minor_version}", :require => false, :platforms => "ruby" gem "puppet-module-win-default-r#{minor_version}", :require => false, :platforms => ["mswin", "mingw", "x64_mingw"] gem "puppet-module-posix-dev-r#{minor_version}", :require => false, :platforms => "ruby" gem "puppet-module-win-dev-r#{minor_version}", '0.0.7', :require => false, :platforms => ["mswin", "mingw", "x64_mingw"] gem "json_pure", '<= 2.0.1', :require => false if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.0.0') gem "fast_gettext", '1.1.0', :require => false if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.1.0') gem "fast_gettext", :require => false if Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.1.0') end group :system_tests do gem "puppet-module-posix-system-r#{minor_version}", :require => false, :platforms => "ruby" gem "puppet-module-win-system-r#{minor_version}", :require => false, :platforms => ["mswin", "mingw", "x64_mingw"] gem "beaker", *location_for(ENV['BEAKER_VERSION'] || '>= 3') gem "beaker-pe", :require => false gem "beaker-rspec", *location_for(ENV['BEAKER_RSPEC_VERSION']) gem "beaker-hostgenerator", *location_for(ENV['BEAKER_HOSTGENERATOR_VERSION']) gem "beaker-abs", *location_for(ENV['BEAKER_ABS_VERSION'] || '~> 0.1') gem "puppet-blacksmith", '~> 3.4', :require => false end gem 'puppet', *location_for(ENV['PUPPET_GEM_VERSION']) # Only explicitly specify Facter/Hiera if a version has been specified. # Otherwise it can lead to strange bundler behavior. If you are seeing weird # gem resolution behavior, try setting `DEBUG_RESOLVER` environment variable # to `1` and then run bundle install. gem 'facter', *location_for(ENV['FACTER_GEM_VERSION']) if ENV['FACTER_GEM_VERSION'] gem 'hiera', *location_for(ENV['HIERA_GEM_VERSION']) if ENV['HIERA_GEM_VERSION'] # Evaluate Gemfile.local if it exists if File.exists? "#{__FILE__}.local" eval(File.read("#{__FILE__}.local"), binding) end # Evaluate ~/.gemfile if it exists if File.exists?(File.join(Dir.home, '.gemfile')) eval(File.read(File.join(Dir.home, '.gemfile')), binding) end # vim:ft=ruby puppetlabs-xinetd-3.0.0/LICENSE0100644000076700000240000002613613024320662013156 0ustar00 Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. puppetlabs-xinetd-3.0.0/MAINTAINERS.md0100644000076700000240000000027613164500605014244 0ustar00## Maintenance Maintainers: - Puppet Forge Modules Team `forge-modules |at| puppet |dot| com` Tickets: https://tickets.puppet.com/browse/MODULES. Make sure to set component to `xinetd`. puppetlabs-xinetd-3.0.0/NOTICE0100644000076700000240000000111313164500605013043 0ustar00Puppet Module - puppetlabs-xinetd Copyright 2017 Puppet, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.puppetlabs-xinetd-3.0.0/README.md0100644000076700000240000001203513165004234013421 0ustar00# xinetd [![Build Status](https://travis-ci.org/puppetlabs/puppetlabs-xinetd.png)](https://travis-ci.org/puppetlabs/puppetlabs-xinetd) This is the xinetd module. ## Overview This module configures xinetd, and exposes the xinetd::service definition for adding new services. ## Class: xinetd Sets up the xinetd daemon. Has options for you in case you have specific package names and service needs. ### Parameters * `confdir` * `conffile` * `package_name` * `service_name` * `service_restart` * `service_status` * `service_hasrestart` * `service_hasstatus` Additionally, all the global defaults in the main xinetd.conf can be set. By default they are *not* set, allowing the internal xinetd defaults to be used: (see `man xinetd.conf` for full descriptions) * `enabled` - Takes a list of service ID's to enable. * `disabled` - Takes a list of service ID's to disable. * `log_type` - Determines where the service log output is sent. * `log_on_failure` - Determines what information is logged when a server cannot be started. * `log_on_success` - Determines what information is logged when a server is started and when that server exits. * `no_access` - Determines the remote hosts to which the particular service is unavailable. * `only_from` - Determines the remote hosts to which the particular service is available. * `max_load` - Takes a floating point value as the load at which the service will stop accepting connections. * `cps` - Takes two numbers to set a rate limit for incoming connections. The first number is the number of connections per second at which the service is disabled. The second number is the time in seconds before the service will be enabled again. * `instances` - Determines the number of servers that can be simultaneously active for a service (the default is no limit). * `per_source` - This specifies the maximum instances of this service per source IP address. * `bind` - Allows a service to be bound to a specific interface on the machine. * `mdns` - On systems that support mdns registration of services (currently only Mac OS X), this will enable or disable registration of the service. * `v6only` - Set to yes to use IPv6 only. * `passenv` - The value of this attribute is a list of environment variables from xinetd's environment that will be passed to the server. * `env` - The value of this attribute is a list of environment variables that will be added to the environment before starting a server. * `groups` - If the groups attribute is set to "yes", then the server is executed with access to the groups that the server's effective UID has access to. * `umask` - Sets the inherited umask for the service. * `banner` - Takes the name of a file to be splatted at the remote host when a connection to that service is established. * `banner_fail` - Takes the name of a file to be splatted at the remote host when a connection to that service is denied. * `banner_success` - Takes the name of a file to be splatted at the remote host when a connection to that service is granted. ## Definition: xinetd::service Sets up a xinetd service. All parameters match up with xinetd.conf(5) man page. ### Parameters: * `server` - optional - determines the program to execute for this service (either this or `redirect` is required) * `redirect` - optional - ip or hostname and port of the target service (either this or `server` is required) * `port` - optional - determines the service port (required if service is not listed in `/etc/services`) * `cps` - optional * `flags` - optional * `per_source` - optional * `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" * `use_default_group` - optional - set to "false" to prevent using the OS specific default group for the service, defaults to "true" * `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 * `nice` - optional - integer between -20 and 19, inclusive. Either the `server` or the `redirect` parameter must be set. ### Sample Usage ```puppet xinetd::service { 'tftp': port => '69', server => '/usr/sbin/in.tftpd', server_args => '-s /var/lib/tftp/', socket_type => 'dgram', protocol => 'udp', cps => '100 2', flags => 'IPv4', per_source => '11', } ``` ```puppet xinetd::service { 'ssh-tunnel-host.example.com': port => '2222', redirect => 'host.example.com 22', flags => 'REUSE', service_type => 'UNLISTED', bind => "${::ipaddress_eth1}", only_from => '10.130.50.174', } ``` ## Supported OSes Supports Debian, FreeBSD, Suse, RedHat, and Amazon Linux OS Families. puppetlabs-xinetd-3.0.0/Rakefile0100644000076700000240000000224313164500605013611 0ustar00require 'puppetlabs_spec_helper/rake_tasks' require 'puppet-lint/tasks/puppet-lint' require 'puppet_blacksmith/rake_tasks' if Bundler.rubygems.find_name('puppet-blacksmith').any? PuppetLint.configuration.fail_on_warnings = true PuppetLint.configuration.send('relative') desc 'Generate pooler nodesets' task :gen_nodeset do require 'beaker-hostgenerator' require 'securerandom' require 'fileutils' agent_target = ENV['TEST_TARGET'] if ! agent_target STDERR.puts 'TEST_TARGET environment variable is not set' STDERR.puts 'setting to default value of "redhat-64default."' agent_target = 'redhat-64default.' end master_target = ENV['MASTER_TEST_TARGET'] if ! master_target STDERR.puts 'MASTER_TEST_TARGET environment variable is not set' STDERR.puts 'setting to default value of "redhat7-64mdcl"' master_target = 'redhat7-64mdcl' end targets = "#{master_target}-#{agent_target}" cli = BeakerHostGenerator::CLI.new([targets]) nodeset_dir = "tmp/nodesets" nodeset = "#{nodeset_dir}/#{targets}-#{SecureRandom.uuid}.yaml" FileUtils.mkdir_p(nodeset_dir) File.open(nodeset, 'w') do |fh| fh.print(cli.execute) end puts nodeset end puppetlabs-xinetd-3.0.0/checksums.json0100644000076700000240000000344013165217645015036 0ustar00{ "CHANGELOG.md": "9cbc5fc12eb870b3e723548935472664", "CONTRIBUTING.md": "4d17f3c942e7c93d1577cc4438a231e4", "Gemfile": "99e30e5e231f5f2b460b812c37d084f7", "LICENSE": "3b83ef96387f14655fc854ddc3c6bd57", "MAINTAINERS.md": "245f57dfb612463ba31e10779e8e1121", "NOTICE": "9bdce9df2fb16db4bc7b356f1b1f23e3", "README.md": "645f0d440a458615f8c768f09b64870d", "Rakefile": "3851f083966b9bbd6d46e50dba5aa52a", "examples/init.pp": "efce0952534e5682ed5b82632a34a2f7", "locales/config.yaml": "7df663fb4f341dd341bf25d3c7603c30", "manifests/init.pp": "1105a0f013505a99cb383339f4e5a90c", "manifests/params.pp": "447468bfcbc6a374beec3f963f81db80", "manifests/service.pp": "44dc6c7a966f67ef0d63493a92343406", "metadata.json": "6c78c2348b1f1bb3fc366afb265126d2", "spec/acceptance/nodesets/centos-7-x64.yml": "a713f3abd3657f0ae2878829badd23cd", "spec/acceptance/nodesets/debian-8-x64.yml": "d2d2977900989f30086ad251a14a1f39", "spec/acceptance/nodesets/default.yml": "b42da5a1ea0c964567ba7495574b8808", "spec/acceptance/nodesets/docker/centos-7.yml": "8a3892807bdd62306ae4774f41ba11ae", "spec/acceptance/nodesets/docker/debian-8.yml": "ac8e871d1068c96de5e85a89daaec6df", "spec/acceptance/nodesets/docker/ubuntu-14.04.yml": "dc42ee922a96908d85b8f0f08203ce58", "spec/classes/xinetd_init_spec.rb": "1c84f3356f3842223cddca518d41f1bd", "spec/defines/xinetd_service_spec.rb": "713a05f919e85bef879e4b7daca1169f", "spec/spec_helper.rb": "ffb7ae05597bd18f74611afa37a88a0d", "spec/spec_helper_system.rb": "a8b3b2c2614853b700179d53eb5d549b", "spec/system/class_spec.rb": "b1dcb446277f3bb1916f3528acb73742", "spec/system/service_spec.rb": "70e460d61848c190501cb8d9158520e7", "templates/service.erb": "b9e5b55f501101e2f4b4f9279ad3e37b", "templates/xinetd.conf.erb": "da10e9412989e74077f7830e3dfd2a20" }puppetlabs-xinetd-3.0.0/examples0040755000076700000240000000000013165217645013717 5ustar00puppetlabs-xinetd-3.0.0/examples/init.pp0100644000076700000240000000002113024320662015254 0ustar00include ::xinetd puppetlabs-xinetd-3.0.0/locales0040755000076700000240000000000013165217645013523 5ustar00puppetlabs-xinetd-3.0.0/locales/config.yaml0100644000076700000240000000204413164770340015723 0ustar00--- # This is the project-specific configuration file for setting up # fast_gettext for your project. gettext: # This is used for the name of the .pot and .po files; they will be # called .pot? project_name: puppetlabs-xinetd # This is used in comments in the .pot and .po files to indicate what # project the files belong to and should bea little more desctiptive than # package_name: puppetlabs-xinetd # The locale that the default messages in the .pot file are in default_locale: en # The email used for sending bug reports. bugs_address: docs@puppet.com # The holder of the copyright. copyright_holder: Puppet, Inc. # This determines which comments in code should be eligible for translation. # Any comments that start with this string will be externalized. (Leave # empty to include all.) comments_tag: TRANSLATOR # Patterns for +Dir.glob+ used to find all files that might contain # translatable content, relative to the project root directory source_files: - './lib/**/*.rb' puppetlabs-xinetd-3.0.0/manifests0040755000076700000240000000000013165217645014072 5ustar00puppetlabs-xinetd-3.0.0/manifests/init.pp0100644000076700000240000000431213024320662015436 0ustar00# 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, $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, $enabled = undef, $disabled = undef, $log_type = undef, $log_on_failure = undef, $log_on_success = undef, $no_access = undef, $only_from = undef, $max_load = undef, $cps = undef, $instances = undef, $per_source = undef, $bind = undef, $mdns = undef, $v6only = undef, $env = undef, $passenv = undef, $groups = undef, $umask = undef, $banner = undef, $banner_fail = undef, $banner_success = undef, $purge_confdir = undef, ) inherits xinetd::params { File { owner => 'root', group => '0', notify => Service[$service_name], require => Package[$package_name], } file { $confdir: ensure => directory, mode => '0755', recurse => $purge_confdir, purge => $purge_confdir, } # Template uses: # $confdir file { $conffile: ensure => file, mode => '0644', content => template('xinetd/xinetd.conf.erb'), } package { $package_name: ensure => $package_ensure, before => Service[$service_name], } service { $service_name: ensure => running, enable => true, hasrestart => $service_hasrestart, hasstatus => $service_hasstatus, restart => $service_restart, status => $service_status, require => File[$conffile], } } puppetlabs-xinetd-3.0.0/manifests/params.pp0100644000076700000240000000562313164500605015766 0ustar00# == Class: xinetd::params # class xinetd::params { $default_user = 'root' $package_ensure = 'installed' case $::osfamily { 'FreeBSD': { $default_group = 'wheel' } default: { $default_group = 'root' } } case $::osfamily { 'Debian': { $confdir = '/etc/xinetd.d' $conffile = '/etc/xinetd.conf' $package_name = 'xinetd' $service_hasrestart = true $service_hasstatus = false $service_name = 'xinetd' $service_restart = "/usr/sbin/service ${service_name} reload" $service_status = undef } 'FreeBSD': { $confdir = '/usr/local/etc/xinetd.d' $conffile = '/usr/local/etc/xinetd.conf' $package_name = 'security/xinetd' $service_hasrestart = false $service_hasstatus = true $service_name = 'xinetd' $service_restart = undef $service_status = undef } 'Suse': { $confdir = '/etc/xinetd.d' $conffile = '/etc/xinetd.conf' $package_name = 'xinetd' $service_hasrestart = true $service_hasstatus = false $service_name = 'xinetd' $service_restart = "/sbin/service ${service_name} reload" $service_status = undef } 'RedHat': { $confdir = '/etc/xinetd.d' $conffile = '/etc/xinetd.conf' $package_name = 'xinetd' $service_hasrestart = true $service_hasstatus = true $service_name = 'xinetd' $service_restart = "/sbin/service ${service_name} reload" $service_status = undef } 'Gentoo': { $confdir = '/etc/xinetd.d' $conffile = '/etc/xinetd.conf' $package_name = 'sys-apps/xinetd' $service_hasrestart = true $service_hasstatus = true $service_name = 'xinetd' $service_restart = undef $service_status = undef } 'Archlinux': { $confdir = '/etc/xinetd.d' $conffile = '/etc/xinetd.conf' $package_name = 'xinetd' $service_hasrestart = true $service_hasstatus = true $service_name = 'xinetd' $service_restart = undef $service_status = undef } 'Linux': { case $::operatingsystem { 'Amazon': { $confdir = '/etc/xinetd.d' $conffile = '/etc/xinetd.conf' $package_name = 'xinetd' $service_name = 'xinetd' $service_hasrestart = true $service_hasstatus = false $service_restart = undef $service_status = undef } default: { fail("xinetd: module does not support Linux operatingsystem ${::operatingsystem}") } } } default: { fail("xinetd: module does not support osfamily ${::osfamily}") } } } puppetlabs-xinetd-3.0.0/manifests/service.pp0100644000076700000240000001333313165004234016136 0ustar00# 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_success - optional - may contain any combination of # 'PID', 'HOST', 'USERID', 'EXIT', 'DURATION', 'TRAFFIC' # $log_on_success_operator - optional - defaults to '+='. This is whether or # not values specified will be add, set or remove # from the default. # $log_on_failure - optional - may contain any combination of # 'HOST', 'USERID', 'ATTEMPT' # $log_on_failure_operator - optional - defaults to '+='. This is whether or # not values specified will be add, set or remove # from the default. # $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 - optional - determines the service port (required if service is not listed in /etc/services) # $server - optional - 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" # $use_default_group - optional - defaults to true # $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 - deprecated - use $service_type instead # $no_access - optional # $access_times - optional # $log_type - optional # $bind - optional # $nice - optional - integer between -20 and 19, inclusive. # $redirect - optional - ip or hostname and port of the target service # # Actions: # setups up a xinetd service by creating a file in /etc/xinetd.d/ # # Requires: # $server or $redirect 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', # nice => 19, # } # xinetd::service # define xinetd::service ( $server = undef, $port = undef, $ensure = present, $log_on_success = undef, $log_on_success_operator = '+=', $log_on_failure = undef, $log_on_failure_operator = '+=', $service_type = undef, $service_name = $title, $cps = undef, $disable = 'no', $flags = undef, $group = undef, Boolean $use_default_group = true, $groups = 'yes', $instances = 'UNLIMITED', $per_source = undef, Enum['tcp', 'udp'] $protocol = 'tcp', $server_args = undef, $socket_type = 'stream', $user = undef, $only_from = undef, $wait = undef, $xtype = undef, $no_access = undef, $access_times = undef, $log_type = undef, $bind = undef, Optional[Integer[-20, 19]] $nice = undef, $env = undef, $passenv = undef, $redirect = undef, ) { include ::xinetd unless ($server or $redirect) { fail('xinetd::service needs either of server or redirect') } if $user { $_user = $user } else { $_user = $xinetd::params::default_user } if $group or !$use_default_group { $_group = $group } else { $_group = $xinetd::params::default_group } if $wait { $_wait = $wait } else { $_wait = $protocol ? { 'tcp' => 'no', 'udp' => 'yes' } } if $xtype { warning ('The $xtype parameter to xinetd::service is deprecated. Use the service_type parameter instead.') } # Template uses: # - $port # - $disable # - $socket_type # - $protocol # - $_wait # - $user # - $group # - $groups # - $server # - $bind # - $service_type # - $server_args # - $only_from # - $per_source # - $log_on_success # - $log_on_success_operator # - $log_on_failure # - $log_on_failure_operator # - $cps # - $flags # - $xtype (deprecated) # - $no_access # - $access_types # - $log_type # - $nice # - $env # - $passenv # - $redirect file { "${xinetd::confdir}/${title}": ensure => $ensure, owner => 'root', mode => '0644', content => template('xinetd/service.erb'), notify => Service[$xinetd::service_name], require => File[$xinetd::confdir], } } puppetlabs-xinetd-3.0.0/metadata.json0100644000076700000240000000132413165217645014630 0ustar00{ "name": "puppetlabs-xinetd", "version": "3.0.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", "dependencies": [ { "name": "puppetlabs/stdlib", "version_requirement": ">=4.6.0 < 5.0.0" } ], "data_provider": null, "description": "Puppet module to configure xinetd services", "requirements": [ { "name": "puppet", "version_requirement": ">= 4.7.1 < 6.0.0" } ] } puppetlabs-xinetd-3.0.0/spec0040755000076700000240000000000013165217645013033 5ustar00puppetlabs-xinetd-3.0.0/spec/acceptance0040755000076700000240000000000013165217645015121 5ustar00puppetlabs-xinetd-3.0.0/spec/acceptance/nodesets0040755000076700000240000000000013165217645016745 5ustar00puppetlabs-xinetd-3.0.0/spec/acceptance/nodesets/centos-7-x64.yml0100644000076700000240000000025613024320662021611 0ustar00HOSTS: centos-7-x64: roles: - agent - default platform: el-7-x86_64 hypervisor: vagrant box: puppetlabs/centos-7.2-64-nocm CONFIG: type: foss puppetlabs-xinetd-3.0.0/spec/acceptance/nodesets/debian-8-x64.yml0100644000076700000240000000026113024320662021535 0ustar00HOSTS: debian-8-x64: roles: - agent - default platform: debian-8-amd64 hypervisor: vagrant box: puppetlabs/debian-8.2-64-nocm CONFIG: type: foss puppetlabs-xinetd-3.0.0/spec/acceptance/nodesets/default.yml0100644000076700000240000000027213024320662021155 0ustar00HOSTS: ubuntu-1404-x64: roles: - agent - default platform: ubuntu-14.04-amd64 hypervisor: vagrant box: puppetlabs/ubuntu-14.04-64-nocm CONFIG: type: foss puppetlabs-xinetd-3.0.0/spec/acceptance/nodesets/docker0040755000076700000240000000000013165217645020214 5ustar00puppetlabs-xinetd-3.0.0/spec/acceptance/nodesets/docker/centos-7.yml0100644000076700000240000000057513024320662022445 0ustar00HOSTS: centos-7-x64: platform: el-7-x86_64 hypervisor: docker image: centos:7 docker_preserve_image: true docker_cmd: '["/usr/sbin/init"]' # install various tools required to get the image up to usable levels docker_image_commands: - 'yum install -y crontabs tar wget openssl sysvinit-tools iproute which initscripts' CONFIG: trace_limit: 200 puppetlabs-xinetd-3.0.0/spec/acceptance/nodesets/docker/debian-8.yml0100644000076700000240000000054413024320662022371 0ustar00HOSTS: debian-8-x64: platform: debian-8-amd64 hypervisor: docker image: debian:8 docker_preserve_image: true docker_cmd: '["/sbin/init"]' docker_image_commands: - 'apt-get update && apt-get install -y net-tools wget locales strace lsof && echo "en_US.UTF-8 UTF-8" > /etc/locale.gen && locale-gen' CONFIG: trace_limit: 200 puppetlabs-xinetd-3.0.0/spec/acceptance/nodesets/docker/ubuntu-14.04.yml0100644000076700000240000000073213024320662022767 0ustar00HOSTS: ubuntu-1404-x64: platform: ubuntu-14.04-amd64 hypervisor: docker image: ubuntu:14.04 docker_preserve_image: true docker_cmd: '["/sbin/init"]' docker_image_commands: # ensure that upstart is booting correctly in the container - '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' CONFIG: trace_limit: 200 puppetlabs-xinetd-3.0.0/spec/classes0040755000076700000240000000000013165217645014470 5ustar00puppetlabs-xinetd-3.0.0/spec/classes/xinetd_init_spec.rb0100644000076700000240000001346713164770340020427 0ustar00require 'spec_helper' describe 'xinetd' do context 'When using default values' do let :facts do { :osfamily => 'Debian' } end it { should contain_package('xinetd') should contain_file('/etc/xinetd.conf') should contain_service('xinetd') } it { # Ensure that the config file allows xinetd to use its own defaults should contain_file('/etc/xinetd.conf').without_content(/enabled *=/) should contain_file('/etc/xinetd.conf').without_content(/disabled *=/) should contain_file('/etc/xinetd.conf').without_content(/log_type *=/) should contain_file('/etc/xinetd.conf').without_content(/log_on_failure *=/) should contain_file('/etc/xinetd.conf').without_content(/log_on_success *=/) should contain_file('/etc/xinetd.conf').without_content(/no_access *=/) should contain_file('/etc/xinetd.conf').without_content(/only_from *=/) should contain_file('/etc/xinetd.conf').without_content(/max_load *=/) should contain_file('/etc/xinetd.conf').without_content(/cps *=/) should contain_file('/etc/xinetd.conf').without_content(/instances *=/) should contain_file('/etc/xinetd.conf').without_content(/per_source *=/) should contain_file('/etc/xinetd.conf').without_content(/bind *=/) should contain_file('/etc/xinetd.conf').without_content(/mdns *=/) should contain_file('/etc/xinetd.conf').without_content(/v6only *=/) should contain_file('/etc/xinetd.conf').without_content(/passenv *=/) should contain_file('/etc/xinetd.conf').without_content(/env *=/) should contain_file('/etc/xinetd.conf').without_content(/groups *=/) should contain_file('/etc/xinetd.conf').without_content(/umask *=/) should contain_file('/etc/xinetd.conf').without_content(/banner *=/) should contain_file('/etc/xinetd.conf').without_content(/banner_fail *=/) should contain_file('/etc/xinetd.conf').without_content(/banner_success *=/) } end context 'When overriding the default vaules' do let :facts do { :osfamily => 'Debian' } end let :params do { :enabled => 'tftp nrpe', :disabled => 'time echo', :log_type => 'SYSLOG daemon info', :log_on_failure => 'HOST', :log_on_success => 'PID HOST DURATION EXIT', :no_access => '128.138.209.10', :only_from => '127.0.0.1', :max_load => '2', :cps => '50 10', :instances => '50', :per_source => '50', :bind => '0.0.0.0', :mdns => 'yes', :v6only => 'no', :env => 'foo=bar', :passenv => 'PATH', :groups => 'yes', :umask => '002', :banner => '/etc/banner', :banner_fail => '/etc/banner.fail', :banner_success => '/etc/banner.good', } end it { # Ensure that the config file allows xinetd to use its own defaults should contain_file('/etc/xinetd.conf').with_content(/enabled *= tftp nrpe/) should contain_file('/etc/xinetd.conf').with_content(/disabled *= time echo/) should contain_file('/etc/xinetd.conf').with_content(/log_type *= SYSLOG daemon info/) should contain_file('/etc/xinetd.conf').with_content(/log_on_failure *= HOST/) should contain_file('/etc/xinetd.conf').with_content(/log_on_success *= PID HOST DURATION EXIT/) should contain_file('/etc/xinetd.conf').with_content(/no_access *= 128.138.209.10/) should contain_file('/etc/xinetd.conf').with_content(/only_from *= 127.0.0.1/) should contain_file('/etc/xinetd.conf').with_content(/max_load *= 2/) should contain_file('/etc/xinetd.conf').with_content(/cps *= 50 10/) should contain_file('/etc/xinetd.conf').with_content(/instances *= 50/) should contain_file('/etc/xinetd.conf').with_content(/per_source *= 50/) should contain_file('/etc/xinetd.conf').with_content(/bind *= 0.0.0.0/) should contain_file('/etc/xinetd.conf').with_content(/mdns *= yes/) should contain_file('/etc/xinetd.conf').with_content(/v6only *= no/) should contain_file('/etc/xinetd.conf').with_content(/env *= foo=bar/) should contain_file('/etc/xinetd.conf').with_content(/passenv *= PATH/) should contain_file('/etc/xinetd.conf').with_content(/groups *= yes/) should contain_file('/etc/xinetd.conf').with_content(/umask *= 002/) should contain_file('/etc/xinetd.conf').with_content(/banner *= \/etc\/banner/) should contain_file('/etc/xinetd.conf').with_content(/banner_fail *= \/etc\/banner\.fail/) should contain_file('/etc/xinetd.conf').with_content(/banner_success *= \/etc\/banner\.good/) } end context 'with defaults on Linux' do let :facts do { :osfamily => 'Debian' } end it { should contain_package('xinetd') should contain_file('/etc/xinetd.conf') should contain_file('/etc/xinetd.d').with_ensure('directory') should contain_service('xinetd') } end context 'with defaults on FreeBSD' do let :facts do { :osfamily => 'FreeBSD' } end it { should contain_package('security/xinetd') should contain_file('/usr/local/etc/xinetd.conf') should contain_file('/usr/local/etc/xinetd.d').with_ensure('directory') should contain_service('xinetd') } end context 'with managed confdir' do let :facts do { :osfamily => 'Debian' } end 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 puppetlabs-xinetd-3.0.0/spec/defines0040755000076700000240000000000013165217645014450 5ustar00puppetlabs-xinetd-3.0.0/spec/defines/xinetd_service_spec.rb0100644000076700000240000001032113165004234021057 0ustar00require 'spec_helper' describe 'xinetd::service' do let :default_params do { 'port' => '80', 'server' => 'httpd' } end let :title do "httpd" end describe "ensure proper user/group are set in FreeBSD" do let :facts do { :osfamily => 'FreeBSD' } end let :params do default_params end it { should contain_file('/usr/local/etc/xinetd.d/httpd').with_content(/user\s*=\sroot/) should contain_file('/usr/local/etc/xinetd.d/httpd').with_content(/group\s*=\swheel/) } end let :facts do { :osfamily => 'Debian' } 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 describe 'with group' do let :params do default_params.merge({'group' => 'foo'}) end it { should contain_file('/etc/xinetd.d/httpd').with_content(/group\s*=\s*foo/) } end describe 'with use_default_group true' do let :params do default_params.merge({'use_default_group' => true}) end it { should contain_file('/etc/xinetd.d/httpd').with_content(/group\s*=\s*root/) } end describe 'with use_default_group false' do let :params do default_params.merge({'use_default_group' => false}) end it { should contain_file('/etc/xinetd.d/httpd').without_content(/group\s*=/) } end describe 'without log_on_' do let :params do default_params end it { should contain_file('/etc/xinetd.d/httpd').without_content(/log_on_success/) should contain_file('/etc/xinetd.d/httpd').without_content(/log_on_failure/) } end describe 'with log_on_ w/default operator' do let :params do default_params.merge({ :log_on_success => 'SUCCESS_TEST', :log_on_failure => 'FAILURE_TEST', }) end it { should contain_file('/etc/xinetd.d/httpd').with_content( /log_on_success\s*\+=\s*SUCCESS_TEST/) should contain_file('/etc/xinetd.d/httpd').with_content( /log_on_failure\s*\+=\s*FAILURE_TEST/) } end describe 'with log_on_ with equal operator' do let :params do default_params.merge({ :log_on_success => 'SUCCESS_TEST', :log_on_failure => 'FAILURE_TEST', :log_on_success_operator => '=', :log_on_failure_operator => '=', }) end it { should contain_file('/etc/xinetd.d/httpd').with_content( /log_on_success\s*\=\s*SUCCESS_TEST/) should contain_file('/etc/xinetd.d/httpd').with_content( /log_on_failure\s*\=\s*FAILURE_TEST/) } end # nice values, good [-20,0,9,19].each do |i| describe "with nice valid nice value: #{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 ['-21','90','foo',-21,90,20].each do |i| describe "with out-of-range nice value: #{i}" do let :params do default_params.merge({ :nice => i }) end it 'should fail' do expect { should contain_class('xinetd') }.to raise_error(Puppet::Error) end end end describe 'with redirect' do let :params do { :port => '80', :redirect => 'somehost.somewhere 65535', } end it { should contain_file('/etc/xinetd.d/httpd').with_content( /redirect\s*\=\s*somehost.somewhere 65535/) } end describe 'without redirect and server' do let :params do { :port => '80', } end it 'should fail' do expect { should contain_class('xinetd') }.to raise_error(Puppet::Error) end end end puppetlabs-xinetd-3.0.0/spec/fixtures0040755000076700000240000000000013165217645014704 5ustar00puppetlabs-xinetd-3.0.0/spec/functions0040755000076700000240000000000013165217645015043 5ustar00puppetlabs-xinetd-3.0.0/spec/hosts0040755000076700000240000000000013165217645014173 5ustar00puppetlabs-xinetd-3.0.0/spec/spec_helper.rb0100644000076700000240000000061113164500605015711 0ustar00#This file is generated by ModuleSync, do not edit. require 'puppetlabs_spec_helper/module_spec_helper' if Puppet::Util::Package.versioncmp(Puppet.version, '4.5.0') >= 0 RSpec.configure do |c| c.before :each do Puppet.settings[:strict] = :error end end end # put local configuration and setup into spec_helper_local begin require 'spec_helper_local' rescue LoadError end puppetlabs-xinetd-3.0.0/spec/spec_helper_system.rb0100644000076700000240000000131613024320662017316 0ustar00require 'rspec-system/spec_helper' require 'rspec-system-puppet/helpers' require 'rspec-system-serverspec/helpers' include Serverspec::Helper::RSpecSystem include Serverspec::Helper::DetectOS include RSpecSystemPuppet::Helpers RSpec.configure do |c| # Project root proj_root = File.expand_path(File.join(File.dirname(__FILE__), '..')) # Enable colour c.tty = true c.include RSpecSystemPuppet::Helpers # This is where we 'setup' the nodes before running our tests c.before :suite do # Install puppet puppet_install # Install modules and dependencies puppet_module_install(:source => proj_root, :module_name => 'xinetd') shell('puppet module install puppetlabs-stdlib') end end puppetlabs-xinetd-3.0.0/spec/system0040755000076700000240000000000013165217645014357 5ustar00puppetlabs-xinetd-3.0.0/spec/system/class_spec.rb0100644000076700000240000000054513024320662017067 0ustar00require 'spec_helper_system' describe 'xinetd class' do describe puppet_apply(<<-EOS class { 'xinetd': } EOS ) do its(:exit_code) { should_not eq(1) } its(:refresh) { should be_nil } its(:exit_code) { should be_zero } end describe service('xinetd') do it { should be_running } it { should be_enabled } end end puppetlabs-xinetd-3.0.0/spec/system/service_spec.rb0100644000076700000240000000122313024320662017414 0ustar00require 'spec_helper_system' describe 'adding a service' do describe puppet_apply(<<-EOS class { 'xinetd': } 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', } EOS ) do its(:exit_code) { should_not eq(1) } its(:refresh) { should be_nil } its(:exit_code) { should be_zero } end describe service('xinetd') do it { should be_running } it { should be_enabled } end end puppetlabs-xinetd-3.0.0/templates0040755000076700000240000000000013165217645014077 5ustar00puppetlabs-xinetd-3.0.0/templates/service.erb0100644000076700000240000000363113165004234016274 0ustar00# This file is being maintained by Puppet. # DO NOT EDIT service <%= @service_name %> { <% if @port -%> port = <%= @port %> <% end -%> disable = <%= @disable %> socket_type = <%= @socket_type %> protocol = <%= @protocol %> wait = <%= @_wait %> user = <%= @_user %> <% if @_group -%> group = <%= @_group %> <% end -%> groups = <%= @groups %> <% if @server -%> server = <%= @server %> <% end -%> <% 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_success -%> log_on_success <%= @log_on_success_operator %> <%= @log_on_success %> <% end -%> <% if @log_on_failure -%> log_on_failure <%= @log_on_failure_operator %> <%= @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 -%> <% if @nice -%> nice = <%= @nice %> <% end -%> <% if @env -%> env = <%= @env %> <% end -%> <% if @passenv -%> passenv = <%= @passenv %> <% end -%> <% if @instances -%> instances = <%= @instances %> <% end -%> <% if @redirect -%> redirect = <%= @redirect %> <% end -%> } puppetlabs-xinetd-3.0.0/templates/xinetd.conf.erb0100644000076700000240000000432113024320662017050 0ustar00# 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. <% if @enabled -%> enabled = <%= @enabled %> <% end -%> <% if @disabled -%> disabled = <%= @disabled %> <% end -%> # Define general logging characteristics. <% if @log_type -%> log_type = <%= @log_type %> <% end -%> <% if @log_on_failure -%> log_on_failure = <%= @log_on_failure %> <% end -%> <% if @log_on_success -%> log_on_success = <%= @log_on_success %> <% end -%> # Define access restriction defaults <% if @no_access -%> no_access = <%= @no_access %> <% end -%> <% if @only_from -%> only_from = <%= @only_from %> <% end -%> <% if @max_load -%> max_load = <%= @max_load %> <% end -%> <% if @cps -%> cps = <%= @cps %> <% end -%> <% if @instances -%> instances = <%= @instances %> <% end -%> <% if @per_source -%> per_source = <%= @per_source %> <% end -%> # Address and networking defaults <% if @bind -%> bind = <%= @bind %> <% end -%> <% if @mdns -%> mdns = <%= @mdns %> <% end -%> <% if @v6only -%> v6only = <%= @v6only %> <% end -%> # setup environmental attributes <% if @env -%> env = <%= @env %> <% end -%> <% if @passenv -%> passenv = <%= @passenv %> <% end -%> <% if @groups -%> groups = <%= @groups %> <% end -%> <% if @umask -%> umask = <%= @umask %> <% end -%> # Generally, banners are not used. This sets up their global defaults <% if @banner -%> banner = <%= @banner %> <% end -%> <% if @banner_fail -%> banner_fail = <%= @banner_fail %> <% end -%> <% if @banner_success -%> banner_success = <%= @banner_success %> <% end -%> } includedir <%= @confdir %>