0
votes

I have set up Puppet master/agent in Oracle VirtualBox using Vagrant and installed netdev_stdlib on both master and agent according to instruction in the README.

I have set up module path to /etc/puppet/modules/netdev_stdlib where standard library stdlib also exists.

The master node is puppet.example.com and agent is node01.example.com.

My manifest file is as follows:

node default {
    file { "/tmp/example_ip": ensure  => present }

    include stdlib               #  No error on this line
    # include netdev_stdlib      #  Uncomment this line will cause error
    netdev_device { $hostname: }
}

However, when I run puppet agent -t on the client I got

Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Puppet::Parser::AST::Resource failed with error ArgumentError: Invalid resource type netdev_device at /etc/puppet/manifests/site.pp:17 on node node01.example.com Warning: Not using cache on failed catalog Error: Could not retrieve catalog; skipping run

I tried to use include netdev_stdlib in the manifest file site.pp, but Puppet couldn't find the class netdev_stdlib. However, include stdlib is fine.

2
sorry the manifest file site.pp format was messed up above, my point is the file '/tmp/example_ip' is able to sync between master and agent so the file is fine, but after adding netdev_device { $hostname: } the agent (or the master?) is not able to recognize the resource 'netdev_device' which should come with netdev_stdlib.luke
Are you using stages? Otherwise include stdlib is unnecessary.Matt Schuchard

2 Answers

1
votes

I tried to use include netdev_stdlib in manifest file site.pp but Puppet couldn't find the class netdev_stdlib, but include stdlib is fine.

The netdev_stdlib module doesn't provide a class that can simply be included. It's more of a programming framework for writing new Puppet types to manage network devices in Ruby.

You should either use the module to write a new network device module of your own for interfacing to some new type of device, per the README, or remove it and don't include the class.

If you're trying to manage a network device, you should look for an existing module that supports that type of device - it may then use this module as a dependency instead. If you're not managing a network device, I don't think you should be trying to use the module.

Note that most module READMEs will indicate class names that can be included; not all modules will contain Puppet classes.

0
votes

Miss { in end of file type:

change from:

file { "/tmp/example_ip": ensure => present,

to

file { "/tmp/example_ip": ensure => present, }