Giter Club home page Giter Club logo

puppet-resolv_conf's Introduction

puppet-resolv_conf Build Status

Manage resolv.conf via Puppet

Show some love

If you find this module useful, send some bitcoins to 1Na3YFUmdxKxJLiuRXQYJU2kiNqA3KY2j9

Supported Puppet versions

  • Puppet >= 4.9.3
  • Last version supporting Puppet 3: v3.3.0

Usage

    class { 'resolv_conf':
      nameservers => ['192.168.1.1', '192.168.2.2', '192.168.3.3'],
    }

Different domain than current machine

    class { 'resolv_conf':
        nameservers => ['192.168.1.1', '192.168.2.2', '192.168.3.3'],
        domainname  => 'different.example.com',
    }

Different searchpath

    class { 'resolv_conf':
        nameservers => ['192.168.1.1', '192.168.2.2', '192.168.3.3'],
        searchpath  => ['sub1.example.com', 'sub2.example.com'],
    }

Class parameters

  • nameservers: Array. Required. List of nameservers
  • domainname: String. Default: $::domain
  • searchpath: String or Array. List of search domains. Default: []
  • options: Array. Default: empty

puppet-resolv_conf's People

Contributors

adamcrews avatar archii avatar bastelfreak avatar blubbme avatar bonivart avatar brontitall avatar dan33l avatar dcj avatar deric avatar elmobp avatar erander1 avatar fadenb avatar fraenki avatar gerapeldoorn avatar igalic avatar lingfish avatar lrupp avatar motley74 avatar raryates avatar razorsedge avatar saz avatar sazzle2611 avatar sethlyons avatar szynaka avatar trlinkin avatar vstone avatar zanloy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

puppet-resolv_conf's Issues

Fix for Solaris 11

Thanks for the Solaris 11 support but there's still two small issues. First is that Solaris wants the options space separated on one line, not one per line. If you have more than one option only the last one will count. Second is that Solaris writes back /etc/resolv.conf with the options line before the nameserver lines but the template does it the other way causing Puppet to "correct" it every time it runs.

The attached diff fixes both issues.

resolv.sol11.diff.txt

Error while evaluating a Resource Statement upon release of v4.0.0

Good afternoon! My Puppet server picked up the new release of the resolv_conf module today, and immediately started throwing the following error when it ran

Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Resource Statement, Evaluation Error: Error while evaluating a Resource Statement, Class[Resolv_conf]: expects a value for parameter 'config_file' expects a value for parameter 'config_template' expects a value for parameter 'use_resolvconf' expects a value for parameter 'update_cmd' expects a value for parameter 'package' expects a value for parameter 'manage_package' expects a value for parameter 'package_ensure' at /etc/puppetlabs/code/environments/production/site/profile/manifests/dns_config.pp:4:3 on node aarontest.ipfw.edu

My manifest is pretty simple and worked porperly before the update.

`class profile::dns_config {

class { 'resolv_conf':
nameservers => ['149.164.1.13'],
domainname => 'ipfw.edu',
}
}`

Any suggestions? I'm on Puppet Enterprise 2016.4 (Puppet 4.7.0). Thanks!

Detail: undefined method `join' for "example.com"

Getting this with Puppet 3.0.1/ruby 1.8.7:

Nov 2 01:42:09 MAC00259073D546 puppet-agent[26141]: Could not retrieve catalog from remote server: Error 400 on SERVER: Failed to parse template resolv_conf/resolv.conf.erb:
Nov 2 01:42:09 MAC00259073D546 puppet-agent[26141]: Filepath: /etc/puppet/env/production/modules/resolv_conf/templates/resolv.conf.erb
Nov 2 01:42:09 MAC00259073D546 puppet-agent[26141]: Line: 4
Nov 2 01:42:09 MAC00259073D546 puppet-agent[26141]: Detail: undefined method `join' for "example.com":String
Nov 2 01:42:09 MAC00259073D546 puppet-agent[26141]: at /etc/puppet/env/production/modules/resolv_conf/manifests/config.pp:13 on node mac00259073d546.32yzx.com
Nov 2 01:42:09 MAC00259073D546 puppet-agent[26141]: Using cached catalog
Nov 2 01:42:10 MAC00259073D546 puppet-agent[26141]: Finished catalog run in 0.43 seconds

class { 'resolv_conf':
    domainname => '32xyz.com',
    searchpath => '32xyz.com',
    nameservers => ['10.1.10.5', '10.1.10.6', '10.1.50.5'],
    options => ['timeout:2', 'attempts:3'],
}

tried replacing my domain with example.com and still got the same error. any ideas? Thanks!

Unable to install on Centos 6.5

I'm able to install your other modules but not this one. Is there an undocumented dependancy?

# puppet module install --verbose saz-resolv_conf
Notice: Preparing to install into /etc/puppet/environments/production/modules ...
Notice: Downloading from https://forgeapi.puppetlabs.com ...
Info: Resolving dependencies ...
Info: Preparing to install ...
Error: No such file or directory - /Users
Error: Try 'puppet help module install' for usage

domain and search parameters mutually exclusive

From the manpage for resolv.conf:

"The domain and search keywords are mutually exclusive. If more than one instance of these keywords is present, the last instance wins."

Since searchpath is a required parameter for this module, the domain parameter is superfluous and will never be used. Would you please include logic to use one or the other, but not both?

"how to use" is unclear

Is the "how to use" in the readme old? I have no idea where I'm supposed to put my domain, searchpath and dns servers. I've tried putting it in init.pp, config.pp and params.pp and I get an error no matter what.

Can't clone into machine via vagrant

For some reason, this module does not play well with Vagrant sync'ed directories.

in my Vagrantfile:

  config.vm.synced_folder '.vagrant/modules', '/etc/puppet/modules'
  ...snip...
  config.vm.provision 'shell' do |shell|
    shell.inline =
      '[ -d /etc/puppet/modules/resolv_conf ] || sudo puppet module install saz-resolv_conf;'

Vagrant up:

==> default: Running provisioner: shell...
    default: Running: inline script
Notice: Preparing to install into /etc/puppet/modules ...
Notice: Downloading from https://forge.puppetlabs.com ...
Notice: Installing -- do not interrupt ...
Error: No such file or directory - /etc/puppet/modules/resolv_conf/spec/fixtures/modules/resolv_conf
Error: Try 'puppet help module install' for usage
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

chmod +x /tmp/vagrant-shell && /tmp/vagrant-shell

Stdout from the command:

Notice: Preparing to install into /etc/puppet/modules ...
Notice: Downloading from https://forge.puppetlabs.com ...
Notice: Installing -- do not interrupt ...
/etc/puppet/modules
└── puppetlabs-firewall (v1.1.3)
Notice: Preparing to install into /etc/puppet/modules ...
Notice: Downloading from https://forge.puppetlabs.com ...
Notice: Installing -- do not interrupt ...


Stderr from the command:

Error: No such file or directory - /etc/puppet/modules/resolv_conf/spec/fixtures/modules/resolv_conf
Error: Try 'puppet help module install' for usage

Go into machine and try to remove the module (it did get there and it does work regardless of error):

]$ sudo rm -rf /etc/puppet/modules/resolv_conf/
rm: cannot remove `/etc/puppet/modules/resolv_conf/spec/fixtures/modules/dnsmasq/.git/objects/pack/pack-c9301f8377a5487e51f0c5cc0b78d3d9d8458a6a.idx': Operation not permitted
rm: cannot remove `/etc/puppet/modules/resolv_conf/spec/fixtures/modules/dnsmasq/.git/objects/pack/pack-c9301f8377a5487e51f0c5cc0b78d3d9d8458a6a.pack': Operation not permitted

It's synchronised, so i can logout and rm it with: rm -rf .vagrant/modules/resolv_conf

It installs just fine to a non-synchronised folder:

$ sudo puppet module install saz-resolv_conf -i /home/vagrant/blah/
Notice: Preparing to install into /home/vagrant/blah ...
Notice: Downloading from https://forge.puppetlabs.com ...
Notice: Installing -- do not interrupt ...
/home/vagrant/blah
└── saz-resolv_conf (v3.0.0)

accept puppetlabs-stdlib with version 6.x

The current version of the module does not accept puppetlabs-stdlib version < 5.

Can you update the requirement ? Or the module can not be used with last stdlib version.

deprecation warnings

this modules is using deprecated functions:

Warning: This method is deprecated, please use the stdlib validate_legacy function, with Stdlib::Compat::Array. There is further documentation for validate_legacy function in the README. at ["/etc/puppetlabs/code/environments/devvm/modules/resolv_conf/manifests/init.pp"

could you please fix them?

Deprecation warning with latest Puppet

I see this deprecation warning running this module on Puppet 4.8.2:

Warning: This method is deprecated, please use the stdlib validate_legacy function, with Stdlib::Compat::Array. There is further documentation for validate_legacy function in the README. at ["/tmp/vagrant-puppet/modules-d13e566bc1ef5c5b77f837a1b7abf98a/resolv_conf/manifests/init.pp", 24]:["/tmp/vagrant-puppet/modules-349b2fc5f7c6f9d1a4035056f56a248f/role/manifests/init.pp", 4

Missing dependency

You use stdlib (manifests/init.pp line 7) but you're missing the dependency info.
Cloning via forge:

$ sudo puppet module install saz-resolv_conf -i /home/vagrant/blah/
Notice: Preparing to install into /home/vagrant/blah ...
Notice: Downloading from https://forge.puppetlabs.com ...
Notice: Installing -- do not interrupt ...
/home/vagrant/blah
└── saz-resolv_conf (v3.0.0)

You need a Puppetfile that lists it, as well as in your metadata.json that is published to the forge.

New version on PuppetForge

Can we get a new version pushed to the forge, the master branch has a fix for stdlib so you can use with version 6 (<7.0.0), but this has not been pushed to the forge, so using 4.1.0 still throws an error.

Having to pull via git atm as a work around, but would love a new version via froge.

Support custom comment header

Rather than be forced to have this at the top of /etc/resolv.conf:

# File managed by puppet

It would be nice to support a custom string to be passed in instead. The existing behavior is a good default, but not everyone is going to want that header. Thanks for your consideration.

spec tests

Add some spec tests and travis-ci magic

expects a value for parameter 'config_file'

Hi,

i have simple class defined as below

class ent::dns (
Array $searchpath,
Array $ent_resolver,
) {
class { 'resolv_conf':
nameservers => $ent_resolver,
searchpath => $searchpath,
}
}

I could see the value config_file in fixture/modules/resolv_conf/data , but its not picking up the value. I am running this test on rhel7.5, all puppet facter works fine. any suggestions ?

Forge release?

Puppet 3 is complaining about variable deprecation warnings. Is there a chance for a Forge release soon?

Issues with Debian 9 and Ubuntu 16.04 ?

Hi,

on these 2 systems I had to install the resolvconf package for this module to work. I didn't had to do this on other systems.

Does someone have the same issue ? Could this package be realized in the module ?

New major release with puppet

Is it possible to release A new major version in the short term to the puppet forge so we can avoid the using the github urls?

cut new forge release

Is there any chance at getting a new version of this module uploaded to the puppet forge. After #21 a new release would let me go back to using the forge vs a git fork.

Options should be one-per-line

Currently the ERB template makes a single "options" like, with a concatentation of all of the elements in the options array. This should actually be one options line per element in the array.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.