7 changes: 7 additions & 0 deletions .fixtures-puppet6.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
fixtures:
repositories:
stdlib:
repo: 'https://github.com/puppetlabs/puppetlabs-stdlib.git'
ref: 'v6.0.0'
symlinks:
dnsclient: "#{source_dir}"
2 changes: 1 addition & 1 deletion .fixtures.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ fixtures:
repositories:
stdlib:
repo: 'https://github.com/puppetlabs/puppetlabs-stdlib.git'
ref: '4.6.0'
ref: 'v7.0.0'
symlinks:
dnsclient: "#{source_dir}"
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ tmp
# YARD artifacts
.yardoc
_yardoc
doc/
/doc/

# Vim
*.swp
Expand Down
24 changes: 3 additions & 21 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,28 +18,10 @@ script: 'SPEC_OPTS="--format documentation" bundle exec rake validate lint spec'
matrix:
fast_finish: true
include:
- rvm: 1.8.7
env: PUPPET_GEM_VERSION="~> 3"
- rvm: 1.8.7
env: PUPPET_GEM_VERSION="~> 3" FUTURE_PARSER="yes"
- rvm: 1.9.3
env: PUPPET_GEM_VERSION="~> 3"
- rvm: 1.9.3
env: PUPPET_GEM_VERSION="~> 3" FUTURE_PARSER="yes"
- rvm: 2.0.0
env: PUPPET_GEM_VERSION="~> 3"
- rvm: 2.0.0
env: PUPPET_GEM_VERSION="~> 3" FUTURE_PARSER="yes"
- rvm: 2.1.9
env: PUPPET_GEM_VERSION="~> 3"
- rvm: 2.1.9
env: PUPPET_GEM_VERSION="~> 3" FUTURE_PARSER="yes"
- rvm: 2.1.9
env: PUPPET_GEM_VERSION="~> 4"
- rvm: 2.4.1
env: PUPPET_GEM_VERSION="~> 5"
- rvm: 2.5.1
env: PUPPET_GEM_VERSION="~> 6"
env: PUPPET_GEM_VERSION="~> 6" FIXTURES_YML=".fixtures-puppet6.yml"
- rvm: 2.7.3
env: PUPPET_GEM_VERSION="~> 7"

notifications:
email: false
54 changes: 54 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Changelog

## [v4.0.0](https://github.com/ghoneycutt/puppet-module-dnsclient/tree/v4.0.0) (2021-04-19)

[Full Changelog](https://github.com/ghoneycutt/puppet-module-dnsclient/compare/v3.6.0...v4.0.0)

### Merged Pull Requests

- Modernize [\#40](https://github.com/ghoneycutt/puppet-module-dnsclient/pull/40) ([ghoneycutt](https://github.com/ghoneycutt))
- Remove EOL Puppet Versions [\#39](https://github.com/ghoneycutt/puppet-module-dnsclient/pull/39) ([BuJo](https://github.com/BuJo))

3.6.0 - 2018-12-08
* Support Puppet versions 5 and 6.

3.5.2 - 2016-10-12
* Explicitly support puppet-lint v2

3.5.1 - 2016-08-31
* No changes, just another release to appease an issue with the Forge.

3.5.0 - 2016-08-31
* Add support for Ruby v2.3.1

3.4.0 - 2015-05-27
* Support Puppet v4 and v3 with future parser

3.0.4 - 2013-06-08 Garrett Honeycutt <code@garretthoneycutt.com>
* Fix warnings by using @ in front of variables in template
* .fixtures.yml is tracking correct version of puppetlabs/stdlib
* Drop Puppet v2.6 from travis-ci
* anders-larsson updates README to document support for SLES 10
* anders-larsson updates README to document support for all EL, not just CentOS

3.0.1 - 2013-03-16 Garrett Honeycutt <code@garretthoneycutt.com>
* fixed spec bug relating to lack of .fixtures.yml
* cleaned up testing framework

3.0.0 - 2013-03-16 Garrett Honeycutt <code@garretthoneycutt.com>
* Switched to semantic versioning - http://semver.org
* Implemented new design pattern that manages data with Hiera
* Truly portable module! Code is completely data driven, so you can make changes
through Hiera and never have to edit the code itself.

2.0.0 - 2011-09-09 Garrett Honeycutt <garrett@puppetlabs.com>
* Implemented design pattern based on http://www.puppetlabs.com/blog/design-pattern-for-dealing-with-data/

1.0.1 - 2010-09-24 Garrett Honeycutt <code@garretthoneycutt.com>
* Added documentation

1.0.0 - 2010-06-24 Garrett Honeycutt <code@garretthoneycutt.com>
* Initial release


\* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)*
35 changes: 35 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Contribution Guidelines

## Tests

- Pull requests that add any additional functionality should have tests which cover the new feature to ensure it does what is expected
- Pull requests with failing tests will not be merged

## Features

- Keep feature based PRs as small as possible, with as few commits as necessary. These are easier to review and will be merged quicker

## Bug Fixes

- Make sure you reference the issue you're closing with `Fixes #<issue number>`

## Commits

- Squash/rebase any commits where possible to reduce the noise in the PR

## Git commits

Reference the issue number, in the format `(GH-###)`.

```
(GH-123) Add support for XYZ
```

# Release process

1. Update version in `metadata.json`
1. Run Rake task to release module: `bundle exec rake release`
1. Update GitHub pages: `bundle exec rake strings:gh_pages:update`
1. Tag the release, such as `git tag -a 'v4.0.0' -m 'v4.0.0'`
1. Push release to upstream master: `git push upstream master`
1. Push tags upstream master: `git push upstream --tags`
90 changes: 64 additions & 26 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,34 +5,72 @@ if puppetversion = ENV['PUPPET_GEM_VERSION']
else
gem 'puppet', :require => false
end
if facterversion = ENV['FACTER_GEM_VERSION']
gem 'facter', facterversion, :require => false
else
gem 'facter', :require => false
end

gem 'facter', '>= 1.7.0', :require => false
gem 'rspec-puppet', '>= 2.4.0', :require => false
gem 'puppet-lint', '~> 2.0', :require => false
gem 'puppet-lint-absolute_classname-check', :require => false
gem 'puppet-lint-alias-check', :require => false
gem 'puppet-lint-empty_string-check', :require => false
gem 'puppet-lint-file_ensure-check', :require => false
gem 'puppet-lint-file_source_rights-check', :require => false
gem 'puppet-lint-leading_zero-check', :require => false
gem 'puppet-lint-spaceship_operator_without_tag-check', :require => false
gem 'puppet-lint-trailing_comma-check', :require => false
gem 'puppet-lint-undef_in_function-check', :require => false
gem 'puppet-lint-unquoted_string-check', :require => false
gem 'puppet-lint-variable_contains_upcase', :require => false
group :development, :unit_tests do
gem 'rake'
gem 'rspec-puppet', :require => false
gem 'rspec-puppet-facts', :require => false
gem 'rspec-mocks', :require => false
gem 'parallel_tests', :require => false
gem 'puppetlabs_spec_helper', :require => false
gem 'metadata-json-lint', :require => false
gem 'puppet-blacksmith', :require => false
gem 'puppet-lint', :require => false
gem 'puppet-lint-absolute_classname-check', :require => false
gem 'puppet-lint-alias-check', :require => false
gem 'puppet-lint-anchor-check', :require => false
gem 'puppet-lint-classes_and_types_beginning_with_digits-check', :require => false
gem 'puppet-lint-empty_string-check', :require => false
gem 'puppet-lint-empty_trailing_lines', :require => false
gem 'puppet-lint-file_ensure-check', :require => false
gem 'puppet-lint-leading_zero-check', :require => false
gem 'puppet-lint-legacy_facts-check', :require => false
gem 'puppet-lint-no_symbolic_file_modes-check', :require => false
gem 'puppet-lint-param-docs', :require => false
gem 'puppet-lint-resource_reference_syntax', :require => false
gem 'puppet-lint-spaceship_operator_without_tag-check', :require => false
gem 'puppet-lint-top_scope_facts-check', :require => false
gem 'puppet-lint-topscope-variable-check', :require => false
gem 'puppet-lint-trailing_comma-check', :require => false
gem 'puppet-lint-trailing_newline-check', :require => false
gem 'puppet-lint-undef_in_function-check', :require => false
gem 'puppet-lint-unquoted_string-check', :require => false
gem 'puppet-lint-variable_contains_upcase', :require => false
gem 'puppet-lint-version_comparison-check', :require => false
gem 'rubocop', '~> 0.49.0', :require => false
gem 'rubocop-i18n', '~> 1.2.0', :require => false
gem 'rubocop-rspec', '~> 1.16.0', :require => false
if Gem.win_platform? && ENV['PUPPET_GEM_VERSION'] =~ /6.x/
gem 'ffi', '~>1.11.0', :require => false
end
end

gem 'rspec', '~> 2.0', :require => false if RUBY_VERSION >= '1.8.7' && RUBY_VERSION < '1.9'
gem 'rake', '~> 10.0', :require => false if RUBY_VERSION >= '1.8.7' && RUBY_VERSION < '1.9'
gem 'json', '<= 1.8', :require => false if RUBY_VERSION < '2.0.0'
gem 'json_pure', '<= 2.0.1', :require => false if RUBY_VERSION < '2.0.0'
gem 'metadata-json-lint', '0.0.11' if RUBY_VERSION >= '1.8.7' && RUBY_VERSION < '1.9'
gem 'metadata-json-lint', '1.0.0' if RUBY_VERSION >= '1.9' && RUBY_VERSION < '2.0'
gem 'metadata-json-lint' if RUBY_VERSION >= '2.0'
group :documentation do
gem 'yard', require: false
gem 'redcarpet', require: false
gem 'puppet-strings', require: false
gem 'github_changelog_generator', require: false
end

gem 'puppetlabs_spec_helper', '2.0.2', :require => false if RUBY_VERSION >= '1.8.7' && RUBY_VERSION < '1.9'
gem 'puppetlabs_spec_helper', '>= 2.0.0', :require => false if RUBY_VERSION >= '1.9'
gem 'parallel_tests', '<= 2.9.0', :require => false if RUBY_VERSION < '2.0.0'
group :system_tests do
gem 'beaker', :require => false
gem "beaker-docker", :require => false
gem 'beaker-module_install_helper', :require => false
gem 'beaker-puppet', :require => false
gem 'beaker-puppet_install_helper', :require => false
gem 'beaker-rspec', :require => false
gem 'serverspec', :require => false
gem 'simp-beaker-helpers', :require => false
end

if puppetversion && puppetversion < '5.0'
gem 'semantic_puppet', :require => false
group :development do
gem 'simplecov', :require => false
gem 'guard-rake', :require => false
gem 'listen', :require => false
end
# vim:ft=ruby
File renamed without changes.
121 changes: 46 additions & 75 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,94 +1,65 @@
# dnsclient module #
# puppet-module-dnsclient

[![Build Status](https://travis-ci.org/ghoneycutt/puppet-module-dnsclient.png?branch=master)](https://travis-ci.org/ghoneycutt/puppet-module-dnsclient)
#### Table of Contents

This module manages /etc/resolv.conf and its various options.
1. [Module Description - What the module does and why it is useful](#module-description)
1. [Setup - The basics of getting started with dnsclient](#setup)
* [What dnsclient affects](#what-dnsclient-affects)
* [Setup requirements](#setup-requirements)
* [Beginning with dnsclient](#beginning-with-dnsclient)
1. [Usage - Configuration options and additional functionality](#usage)
1. [Limitations - OS compatibility, etc.](#limitations)
1. [Development - Guide for contributing to the module](#development)

It makes use of Hiera (http://github.com/puppetlabs/hiera) and demonstrates a
new design pattern in module development that allows for totally data driven
code with no modifications to the module itself as a guiding principle.
## Module description

# Compatibility #
This module manages `/etc/resolv.conf` and its various options. It is
feature complete for the supported platforms.

This module has been tested to work on the following systems with the
latest Puppet v3, v3 with future parser, v4, v5 and v6. See `.travis.yml`
for the exact matrix of supported Puppet and ruby versions.
[Documented with puppet-strings](http://ghoneycutt.github.io/puppet-module-dnsclient/)

* EL 5
* EL 6
* EL 7
* Debian 6
* SLES 10
* SLES 11
* Solaris 10
* Ubuntu 10.04 LTS (Lucid Lynx)
* Ubuntu 12.04 LTS (Precise Pangolin)

# Parameters #

See RESOLV.CONF(5) for more information regarding /etc/resolv.conf settings


nameservers
-----------
Array of name servers.

- *Default*: Google's public name servers

options
-------
Array of options.

- *Default*: 'rotate' and 'timeout:1'
## Setup

search
------
Array of domains for search list. This is mutually exclusive with **domain**. If both are set, search will be used and domain will be ignored.
### What dnsclient affects

- *Default*: none
Manages the system resolver, `/etc/resolv.conf`.

domain
------
Domain setting. See **search**.
### Setup requirements
This module requires `stdlib`.

- *Default*: none
### Beginning with dnsclient

sortlist
--------
Array of sortlist addresses.
Include the `dnsclient` class and it will configure the resolver to use
Google's public name servers.

- *Default*: none
## Usage

resolver_config_file
--------------------
Path to resolv.conf.
Minimal and normal usage. See the
[examples](https://github.com/ghoneycutt/puppet-module-dnsclient/tree/master/examples)
directory for more usage examples.

- *Default*: '/etc/resolv.conf'
```puppet
include dnsclient
```

resolver_config_file_ensure
---------------------------
ensure attribute for file resource. Valid values are 'file', 'present' and 'absent'.
## Limitations

- *Default*: file
This module has been tested to work on the following systems with Puppet
versions 6 and 7 with the Ruby version associated with those releases.
Please see `.travis.yml` for a full matrix of supported versions. This
module aims to support the current and previous major Puppet versions.

resolver_config_file_owner
--------------------------
resolv.conf's owner.

- *Default*: 'root'


resolver_config_file_group
--------------------------
resolv.conf's group.

- *Default*: 'root'


resolver_config_file_mode
-------------------------
resolv.conf's mode.

- *Default*: '0644'
* EL 5
* EL 6
* EL 7
* Debian 6
* SLES 10
* SLES 11
* Solaris 10
* Ubuntu 10.04 LTS (Lucid Lynx)
* Ubuntu 12.04 LTS (Precise Pangolin)

## Development

See `CONTRIBUTING.md` for information related to the development of this
module.
Loading