Code Monkey home page Code Monkey logo

puppet-dnsmasq's Introduction

puppet-dnsmasq CI Build Status

Manage dnsmasq via Puppet

Supported Puppet versions

  • Puppet >= 4
  • Last version supporting Puppet 3: v1.3.1

How to use

    dnsmasq::conf { 'local-dns':
      ensure => present,
      source => 'puppet:///files/dnsmasq/local-dns',
    }

or

    dnsmasq::conf { 'another-config':
      ensure  => present,
      content => 'dhcp-range=192.168.0.50,192.168.0.150,12h',
    }

Hiera usage

    class { '::dnsmasq':
      configs_hash    => {},
      hosts_hash      => {},
      dhcp_hosts_hash => {},
    }

purge unmanaged files in $config_dir:

    class { '::dnsmasq':
      purge_config_dir => true,
    }
    class { '::dnsmasq':
      configs_hash => {
        'another-config' => {
          content => 'dhcp-range=192.168.0.50,192.168.0.150,12h',
        },
      },
    }

class params and default values

    class { '::dnsmasq':
      configs_hash     => {},
      hosts_hash       => {},
      dhcp_hosts_hash  => {},
      package_ensure   => 'installed',
      service_control  => true,
      purge_config_dir => true,
    }

puppet-dnsmasq's People

Contributors

bodepd avatar centromere avatar dcarley avatar evilensky avatar fnoop avatar hanazuki avatar jardleex avatar krzysztofhajdamowicz avatar madandroid avatar mpdude avatar pmuller avatar saz avatar sorenisanerd avatar tnmt avatar zoide avatar

Stargazers

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

Watchers

 avatar  avatar  avatar

puppet-dnsmasq's Issues

Deprecation warnings on Puppet 5.x, 6.x

Hi,
I've found this module uses deprecated is_string.

Warning: This method is deprecated, please use match expressions with Stdlib::Compat::String instead. They are described at https://docs.puppet.com/puppet/latest/reference/lang_data_type.html#match-expressions. at ["/etc/puppetlabs/code/environments/production/modules/dnsmasq/manifests/service.pp", 5]:["/etc/puppetlabs/code/environments/production/modules/profile/manifests/dnsmasq.pp", 2]
   (location: /etc/puppetlabs/code/environments/production/modules/stdlib/lib/puppet/functions/deprecation.rb:28:in `deprecation')

Pull request #26 fixes this issue.

module uses outdated stdlib

  "dependencies": [
    {
      "name": "puppetlabs/stdlib",
      "version_requirement": ">=2.0.0 < 5.0.0"
    }
  ]

stdlib was released on 22 Aug 2018. It's time to upgrade.

Travis tests failing due to missing Rakefile

The most recent pull requests show failing tests, the output in Travis shows:

Could not find .travis.yml, using standard configuration.
system_info
Build system information
OS name: "linux", version: "2.6.32-042stab090.5", arch: "amd64", family: "unix"
git.checkout
0.06s$ git clone --depth=50 git://github.com/saz/puppet-dnsmasq.git saz/puppet-dnsmasq
Cloning into 'saz/puppet-dnsmasq'...
remote: Counting objects: 148, done.
remote: Total 148 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (148/148), 28.37 KiB | 0 bytes/s, done.
Resolving deltas: 100% (58/58), done.
Checking connectivity... done.
$ cd saz/puppet-dnsmasq
0.10s$ git fetch origin +refs/pull/12/merge:
remote: Counting objects: 10, done.
remote: Compressing objects: 100% (10/10), done.
remote: Total 10 (delta 3), reused 0 (delta 0)
Unpacking objects: 100% (10/10), done.
From git://github.com/saz/puppet-dnsmasq
 * branch            refs/pull/12/merge -> FETCH_HEAD
$ git checkout -qf FETCH_HEAD
rvm
0.25s$ rvm use default
Using /home/travis/.rvm/gems/ruby-1.9.3-p551
$ ruby --version
ruby 1.9.3p551 (2014-11-13 revision 48407) [x86_64-linux]
$ rvm --version
rvm 1.26.8 (latest-minor) by Wayne E. Seguin <[email protected]>, Michal Papis <[email protected]> [https://rvm.io/]
$ bundle --version
Bundler version 1.7.6
$ gem --version
2.4.5
0.14s$ rake
rake aborted!
No Rakefile found (looking for: rakefile, Rakefile, rakefile.rb, Rakefile.rb)
/home/travis/.rvm/gems/ruby-1.9.3-p551/bin/ruby_executable_hooks:15:in `eval'
/home/travis/.rvm/gems/ruby-1.9.3-p551/bin/ruby_executable_hooks:15:in `<main>'
(See full trace by running task with --trace)
The command "rake" exited with 1.

dnsmasq service fails to resolve DNS for first 1-2 seconds after startup - causes subsequent puppet manifest/s to fail for 2~ seconds

Need to somehow inject an explicit "sleep 2" after the dnsmasq service is started, to ensure no DNS resolution breakage. Otherwise if another package resource tries to execute for example it fails due to name resolution.

To confirm - the log output below had UNIX timestamps before each line (due to the shell used to get the output), and I can confirm that the whois package at the bottom installs fine after 2 seconds.

Info: /Stage[main]/Dnsmasq::Config/File[/etc/dnsmasq.conf]: Filebucketed /etc/dnsmasq.conf to filebucket_local with sum 31f87a2b4c6363e5741da8a2059a1814
Notice: /Stage[main]/Dnsmasq::Config/File[/etc/dnsmasq.conf]/content: content changed '{md5}31f87a2b4c6363e5741da8a2059a1814' to '{md5}6161ae53c6d8a5aee1eb4bb2fa902b2c'
Info: /Stage[main]/Dnsmasq::Config/File[/etc/dnsmasq.conf]: Scheduling refresh of Class[Dnsmasq::Service]
Error: Execution of '/usr/bin/apt-get -q -y -o DPkg::Options::=--force-confold install numactl' returned 100: Reading package lists...
Building dependency tree...
Reading state information...
The following packages were automatically installed and are no longer required:
libgudev-1.0-0 gir1.2-gudev-1.0
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
libnuma1
The following NEW packages will be installed:
libnuma1 numactl
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 46.3 kB of archives.
After this operation, 196 kB of additional disk space will be used.
Err http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ precise/main libnuma1 amd64 2.0.8~rc3-1
Temporary failure resolving 'us-east-1.ec2.archive.ubuntu.com'
Err http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ precise/universe numactl amd64 2.0.8~rc3-1
Temporary failure resolving 'us-east-1.ec2.archive.ubuntu.com'
Failed to fetch http://us-east-1.ec2.archive.ubuntu.com/ubuntu/pool/main/n/numactl/libnuma1_2.0.8~rc3-1_amd64.deb  Temporary failure resolving 'us-east-1.ec2.archive.ubuntu.com'
Failed to fetch http://us-east-1.ec2.archive.ubuntu.com/ubuntu/pool/universe/n/numactl/numactl_2.0.8~rc3-1_amd64.deb  Temporary failure resolving 'us-east-1.ec2.archive.ubuntu.com'
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

Error: /Stage[main]/Kix_base_packages/Package[numactl]/ensure: change from purged to present failed: Execution of '/usr/bin/apt-get -q -y -o DPkg::Options::=--force-confold install numactl' returned 100: Reading package lists...
Building dependency tree...
Reading state information...
The following packages were automatically installed and are no longer required:
libgudev-1.0-0 gir1.2-gudev-1.0
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
libnuma1
The following NEW packages will be installed:
libnuma1 numactl
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 46.3 kB of archives.
After this operation, 196 kB of additional disk space will be used.
Err http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ precise/main libnuma1 amd64 2.0.8~rc3-1
Temporary failure resolving 'us-east-1.ec2.archive.ubuntu.com'
Err http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ precise/universe numactl amd64 2.0.8~rc3-1
Temporary failure resolving 'us-east-1.ec2.archive.ubuntu.com'
Failed to fetch http://us-east-1.ec2.archive.ubuntu.com/ubuntu/pool/main/n/numactl/libnuma1_2.0.8~rc3-1_amd64.deb  Temporary failure resolving 'us-east-1.ec2.archive.ubuntu.com'
Failed to fetch http://us-east-1.ec2.archive.ubuntu.com/ubuntu/pool/universe/n/numactl/numactl_2.0.8~rc3-1_amd64.deb  Temporary failure resolving 'us-east-1.ec2.archive.ubuntu.com'
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

Notice: /Stage[main]/Install_stuff/Package[whois]/ensure: ensure changed 'purged' to 'present'
Notice: /Stage[main]/Install_stuff/Package[numactl]/ensure: ensure changed 'purged' to 'present'

LICENSE

Could you drop a LICENSE file of your choosing into this repo?

Cheers,
Dan

Clarify or remove dependency on common module

In int.pp and hosts.pp there are references to a common::line define. If the common module is not present in the environment, the puppet run will fail. Additionally, there is nothing in the Modulefile, medata.json or README which tell which common module or version that this depends on. Searching the forge for 'common' module gives a handful of same-named results, so it would help to be explicit.

An issue would be to decide how to best handle this:

  1. At minimum, call out in the README which common module has been tested with this dnsmasq module.
  2. To enforce dependency, add it with a version in the metadata.json
  3. (My personal preference) Remove dependency on common module
    * For my use case I don't need the hosts file management so it would be nice if there were a way to pass in a parameter to just not modify hosts file, then I would never have to pull in the common module.

Purge option?

Hi saz,

  • is there a way to manage conf files under /etc/puppet.d ?
  • in particular, is there an option to purge existing files under /etc/puppet.d ?

new release

hi, it seems like master has some changes since the last 1.4.0 release.

would you be so kind to publish a new release with the contents of master?

i am most interested in getting rod of the deprecation warning caused by using "validate_hash"

No service parameter

This module unconditionally controls the dnsmasq service. If you're trying to define interfaces that don't exist yet (for example if you're naming interfaces through udev that won't be available until the next reboot), then this module produces errors, unconditionally.
There should be an option to disable control of the systemd service.

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.