GithubHelp home page GithubHelp logo

Comments (8)

bastelfreak avatar bastelfreak commented on July 18, 2024

Hi @nigemar, we've a test for the interfaces parameter which works:
https://github.com/voxpupuli/puppet-dhcp/blob/master/spec/classes/dhcp_spec.rb#L68
Maybe the hiera lookup isn't working properly? Can you implement a notice to verify the content of $interfaces in your profile?

from puppet-dhcp.

nigemar avatar nigemar commented on July 18, 2024

Hi @bastelfreak, I will try this again.
cheers
-Nigel

from puppet-dhcp.

nigemar avatar nigemar commented on July 18, 2024

Hi,
Unfortunately the issue still persists:

Puppet run with a notify:

root@grace# puppet agent -t
Info: Using configured environment 'master'
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Retrieving locales
Info: Loading facts
Info: Caching catalog for grace.network.local
Info: Applying configuration version 'puppet-master-889eb9d1868'
Notice: Inside the base class
Notice: /Stage[main]/Profile::Base/Notify[Inside the base class]/message: defined 'message' as 'Inside the base class'
Notice: Inside the dhcp class interface: eno1
Notice: /Stage[main]/Profile::Dhcp/Notify[Inside the dhcp class interface: eno1]/message: defined 'message' as 'Inside the dhcp class interface: eno1'
Notice: Applied catalog in 0.40 seconds

I had to disable the class, so now here is the run with the class enabled

root@grace# puppet agent -t
Info: Using configured environment 'master'
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Retrieving locales
Info: Loading facts
Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Function Call, You need to set $interfaces in dhcp (file: /etc/puppetlabs/code/environments/master/modules/dhcp/manifests/init.pp, line: 104, column: 5) on node grace.network.local
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run`

Cheers
-Nigel

from puppet-dhcp.

bastelfreak avatar bastelfreak commented on July 18, 2024

Can you please provide a PR that uses your code as an acceptance test?

from puppet-dhcp.

nigemar avatar nigemar commented on July 18, 2024

Just checking you want a pull request which includes:

  1. role
  2. profile
  3. manifest
  4. node yaml

Is that correct?

from puppet-dhcp.

nigemar avatar nigemar commented on July 18, 2024

Pull request created.
All data under tests directory.

#223

from puppet-dhcp.

nigemar avatar nigemar commented on July 18, 2024

I have tested this on Centos 7 and I get the same response:

Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Function Call, You need to set $interfaces in dhcp (file: /etc/puppetlabs/code/environments/master/modules/dhcp/manifests/init.pp, line: 104, column: 5) on node grace.network.local

Class is still the same.

from puppet-dhcp.

nigemar avatar nigemar commented on July 18, 2024

I think I have this sorted, perhaps its my lack of understanding of how to implement this class, but I have this work around, but explicitly setting the interface and interfaces value being passed to class.

# Class: profile::dhcp()
class profile::dhcp(

  String $dns_server,
  String $gateway,
  String $pxe_server,
  Array[String] $interfaces,
  Optional[String] $interface = 'NOTSET',

){

  class { 'dhcp':
    service_ensure => running,
    dnsdomain      => [
      'network.local',
      '0.168.192.in-addr.arpa',
    ],
    nameservers    => [$dns_server],
    ntpservers     => ['192.168.0.1'],
    interfaces     => $interfaces,
    pxeserver      => $pxe_server,
    pxefilename    => 'pxelinux.0',
  }

  dhcp::pool {'sn_192.168.0.0' :
    network     => '192.168.0.0',
    mask        => '255.255.255.0',
    range       => '192.168.0.120 192.168.0.140',
    nameservers => [$dns_server],
    gateway     => $gateway,
  }
}

from puppet-dhcp.

Related Issues (20)

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.