1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ vendor/

## rspec
spec/fixtures/
junit/

## Puppet module
pkg/
Expand Down
51 changes: 51 additions & 0 deletions .pmtignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# This file is managed centrally by modulesync
# https://github.com/theforeman/foreman-installer-modulesync

## MAC OS
.DS_Store

## TEXTMATE
*.tmproj
tmtags

## EMACS
*~
\#*
.\#*

## VIM
*.swp
*.swo
tags

## Bundler
Gemfile.lock
.bundle
vendor/

## rbenv / rvm
.rbenv*
.rvmrc*
.ruby-*

## rspec
spec/fixtures/
junit/

## Puppet module
pkg/
coverage/
.yardoc/

## InteliJ / RubyMine
.idea

## Beaker
.vagrant/
log/

# Files we don't want to ship in a release
CONTRIBUTING.md
Gemfile
Rakefile
spec/
6 changes: 6 additions & 0 deletions .sync.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
---
.travis.yml:
beaker_sets:
- docker/centos-6
- docker/centos-7
- docker/debian-8
- docker/debian-9
Rakefile:
param_docs_pattern:
- manifests/init.pp
43 changes: 31 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,42 @@
# This file is managed centrally by modulesync
# https://github.com/theforeman/foreman-installer-modulesync
rvm:
- 2.1.5
- 2.1.9
- 2.2.6
- 2.3.0
- 2.4.1
env:
matrix:
# First test the major distros
- PUPPET_VERSION=4.6 ONLY_OS=centos-6-x86_64,centos-7-x86_64,debian-7-x86_64,debian-8-x86_64,ubuntu-14-x86_64,ubuntu-14.04-x86_64,ubuntu-16-x86_64,ubuntu-16.04-x86_64
# Test the rest of the supported platforms
- PUPPET_VERSION=4.6 EXCLUDE_OS=centos-6-x86_64,centos-7-x86_64,debian-7-x86_64,debian-8-x86_64,ubuntu-14-x86_64,ubuntu-14.04-x86_64,ubuntu-16-x86_64,ubuntu-16.04-x86_64,scientific-6-x86_64,scientific-7-x86_64
- PUPPET_VERSION=4.9
matrix:
fast_finish: true
include:
- rvm: 2.2.6
env: PUPPET_VERSION=4.6 ONLY_OS="debian-8-x86_64,centos-7-x86_64,ubuntu-16-x86_64,ubuntu-16.04-x86_64,freebsd-10-amd64,windows-2012 R2-x64"
- rvm: 2.3.0
env: PUPPET_VERSION=4.6 ONLY_OS="debian-8-x86_64,centos-7-x86_64,ubuntu-16-x86_64,ubuntu-16.04-x86_64,freebsd-10-amd64,windows-2012 R2-x64"
- rvm: 2.4.1
env: PUPPET_VERSION=4.6 ONLY_OS="debian-8-x86_64,centos-7-x86_64,ubuntu-16-x86_64,ubuntu-16.04-x86_64,freebsd-10-amd64,windows-2012 R2-x64"
- rvm: 2.4.1
env: PUPPET_VERSION=5.0 ONLY_OS="debian-8-x86_64,centos-7-x86_64,ubuntu-16-x86_64,ubuntu-16.04-x86_64,freebsd-10-amd64,windows-2012 R2-x64"
env: PUPPET_VERSION=5.0
# Acceptance tests
- rvm: 2.3.1
dist: trusty
env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_set=docker/centos-6
script: bundle exec rake beaker
services: docker
bundler_args: --without development
- rvm: 2.3.1
dist: trusty
env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_set=docker/centos-7
script: bundle exec rake beaker
services: docker
bundler_args: --without development
- rvm: 2.3.1
dist: trusty
env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_set=docker/debian-8
script: bundle exec rake beaker
services: docker
bundler_args: --without development
- rvm: 2.3.1
dist: trusty
env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_set=docker/debian-9
script: bundle exec rake beaker
services: docker
bundler_args: --without development
bundler_args: --without system_tests development
sudo: false
22 changes: 21 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,28 @@
# Changelog

## [4.0.0](https://github.com/theforeman/puppet-tftp/tree/4.0.0) (2018-01-25)
[Full Changelog](https://github.com/theforeman/puppet-tftp/compare/3.0.2...4.0.0)

**Breaking changes:**

- Update hiera yaml to version 5 [\#57](https://github.com/theforeman/puppet-tftp/pull/57) ([mmoll](https://github.com/mmoll))

**Implemented enhancements:**

- add option to manage root\_dir [\#67](https://github.com/theforeman/puppet-tftp/pull/67) ([bastelfreak](https://github.com/bastelfreak))
- remove EOL OSes, add new ones [\#63](https://github.com/theforeman/puppet-tftp/pull/63) ([mmoll](https://github.com/mmoll))
- Set the service for the Red Hat osfamily [\#59](https://github.com/theforeman/puppet-tftp/pull/59) ([ekohl](https://github.com/ekohl))

## 3.0.2
* Allow puppetlabs/xinetd 3.0.0
* Set the service for the Red Hat OS family

## 3.0.1
* Fix `invalid byte sequence in UTF-8` error

## 3.0.0
* Drop Puppet 3 support
* Add handling for some buggy PXE stacks
* Add handling for some buggy PXE stacks

## 2.0.0
* Drop support for Ruby 1.8.7
Expand Down
20 changes: 10 additions & 10 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ Checklist (and a short version for the impatient)
description (50 characters is the soft limit, excluding ticket
number(s)), and should skip the full stop.

- If you have a [http://projects.theforeman.org/projects/puppet-foreman/issues](Redmine issue)
- If you have a [https://projects.theforeman.org/projects/puppet-foreman/issues](Redmine issue)
number, associate the issue in the message. The first line should start
with the issue number in the form "fixes #XXXX - rest of message".
[More information on the Redmine style](http://projects.theforeman.org/projects/foreman/wiki/Reviewing_patches-commit_message_format).
[More information on the Redmine style](https://projects.theforeman.org/projects/foreman/wiki/Reviewing_patches-commit_message_format).
Tickets are not required for our installer Puppet modules.

- If you have a GitHub issue number, associate the issue in the message.
Expand Down Expand Up @@ -108,9 +108,9 @@ The long version
is merged in.

GitHub has some pretty good
[general documentation](http://help.github.com/) on using
[general documentation](https://help.github.com/) on using
their site. They also have documentation on
[creating pull requests](http://help.github.com/send-pull-requests/).
[creating pull requests](https://help.github.com/send-pull-requests/).

In general, after pushing your topic branch up to your
repository on GitHub, you can switch to the branch in the
Expand All @@ -132,10 +132,10 @@ 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,
package manager such as [bundler](https://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)
Please make sure you have [bundler installed](https://bundler.io/#getting-started)
on your system, then use it to install all dependencies needed for this project,
by running

Expand Down Expand Up @@ -238,11 +238,11 @@ review.
Additional Resources
====================

* [Support and contact details](http://theforeman.org/support.html)
* [Support and contact details](https://theforeman.org/support.html)

* [General Foreman contribution details](http://theforeman.org/contribute.html)
* [General Foreman contribution details](https://theforeman.org/contribute.html)

* [General GitHub documentation](http://help.github.com/)
* [General GitHub documentation](https://help.github.com/)

* [GitHub pull request documentation](http://help.github.com/send-pull-requests/)
* [GitHub pull request documentation](https://help.github.com/send-pull-requests/)

26 changes: 14 additions & 12 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,32 @@
source 'https://rubygems.org'

gem 'puppet', ENV.key?('PUPPET_VERSION') ? "~> #{ENV['PUPPET_VERSION']}" : '>= 4.6'
gem 'facter', ENV.key?('FACTER_VERSION') ? "~> #{ENV['FACTER_VERSION']}" : '~> 2.4.6'

gem 'rake'
gem 'rspec', '~> 3.0'
gem 'rdoc', '~> 5.1.0', {"platforms"=>["ruby_21"]}
gem 'rspec-puppet', '~> 2.3'
gem 'rspec-puppet-facts', '>= 1.7'
gem 'puppetlabs_spec_helper', '>= 2.1.1'
gem 'puppet-lint', '>= 2'
gem 'puppet-lint-unquoted_string-check'
gem 'puppet-lint-empty_string-check'
gem 'puppet-lint-spaceship_operator_without_tag-check'
gem 'puppet-lint-variable_contains_upcase'
gem 'puppet-lint-absolute_classname-check'
gem 'puppet-lint-undef_in_function-check'
gem 'puppet-lint-leading_zero-check'
gem 'puppet-lint-trailing_comma-check'
gem 'puppet-lint-classes_and_types_beginning_with_digits-check'
gem 'puppet-lint-empty_string-check'
gem 'puppet-lint-file_ensure-check'
gem 'puppet-lint-leading_zero-check'
gem 'puppet-lint-param-docs', '>= 1.3.0'
gem 'puppet-lint-spaceship_operator_without_tag-check'
gem 'puppet-lint-strict_indent-check'
gem 'puppet-lint-trailing_comma-check'
gem 'puppet-lint-undef_in_function-check'
gem 'puppet-lint-unquoted_string-check'
gem 'puppet-lint-variable_contains_upcase'
gem 'puppet-lint-version_comparison-check'
gem 'simplecov'
gem 'puppet-blacksmith', '>= 3.1.0', {"groups"=>["development"]}
gem 'json', '~> 1.0', {"platforms"=>["ruby_19"], "groups"=>["test"]}
gem 'json_pure', '~> 1.0', {"platforms"=>["ruby_19"], "groups"=>["test"]}
gem 'logging', '~> 2.1.0', {"platforms"=>["ruby_19"], "groups"=>["test"]}
gem 'puppet-blacksmith', '>= 4.1.0', {"groups"=>["development"]}
gem 'beaker', '>= 3.9.0', {"groups"=>["system_tests"]}
gem 'beaker-rspec', {"groups"=>["system_tests"]}
gem 'beaker-module_install_helper', {"groups"=>["system_tests"]}
gem 'beaker-puppet_install_helper', {"groups"=>["system_tests"]}
gem 'metadata-json-lint'
gem 'kafo_module_lint'
Expand Down
2 changes: 2 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ begin
require 'puppet_blacksmith/rake_tasks'
Blacksmith::RakeTask.new do |t|
t.tag_pattern = "%s"
t.tag_message_pattern = "Version %s"
t.tag_sign = true
end
rescue LoadError
end
Expand Down
1 change: 1 addition & 0 deletions data/RedHat.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
tftp::daemon: false
tftp::service: tftp.socket
tftp::package: tftp-server
tftp::root: "/var/lib/tftpboot"
tftp::syslinux_package: syslinux
2 changes: 2 additions & 0 deletions data/common.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
tftp::manage_root_dir: true
32 changes: 16 additions & 16 deletions hiera.yaml
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
---
version: 4
datadir: data
version: 5

defaults:
datadir: data
data_hash: 'yaml_data'

hierarchy:
- name: "Full Version"
backend: yaml
path: "%{facts.os.name}-%{facts.os.release.full}"
- name: 'Full Version'
path: '%{facts.os.name}-%{facts.os.release.full}.yaml'

- name: "Major Version"
backend: yaml
path: "%{facts.os.name}-%{facts.os.release.major}"
- name: 'Major Version'
path: '%{facts.os.name}-%{facts.os.release.major}.yaml'

- name: "Distribution Name"
backend: yaml
path: "%{facts.os.name}"
- name: 'Distribution Name'
path: '%{facts.os.name}.yaml'

- name: "Operating System Family"
backend: yaml
path: "%{facts.os.family}"
- name: 'Operating System Family'
path: '%{facts.os.family}.yaml'

- name: "common"
backend: yaml
- name: 'common'
path: 'common.yaml'
11 changes: 6 additions & 5 deletions manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

case $::tftp::daemon {
default: {
file { $::tftp::root:
ensure => directory,
if $tftp::manage_root_dir {
ensure_resource('file', $::tftp::root, {'ensure' => 'directory'})
}

if $::osfamily =~ /^(FreeBSD|DragonFly)$/ {
Expand All @@ -29,9 +29,10 @@
}

file {'/etc/tftpd.map':
source => "puppet:///modules/${module_name}/tftpd.map",
mode => '0644',
notify => Class['xinetd'],
source => "puppet:///modules/${module_name}/tftpd.map",
mode => '0644',
show_diff => false, # Puppet explodes with 'Error: invalid byte sequence in UTF-8' when trying to display the diff
notify => Class['xinetd'],
}

file { $::tftp::root:
Expand Down
2 changes: 2 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,15 @@
# @param package Name of the TFTP server package
# @param syslinux_package Name of the syslinux package, essential for pxe boot
# @param daemon Runs a TFTP service when true, configures xinetd when false
# @param manage_root_dir manages the root dir, which tftpd will serve, defaults to true
# @param service Name of the TFTP service, when daemon is true
# @param service_provider Override TFTP service provider, when daemon is true
class tftp (
Stdlib::Absolutepath $root,
String $package,
Variant[String, Array[String]] $syslinux_package,
Boolean $daemon,
Boolean $manage_root_dir,
Optional[String] $service = undef,
Optional[String] $service_provider = undef,
) {
Expand Down
Loading