example42/puppet-network

Network::Interface[bond0]: has no parameter named 'options_extra_redhat'

mick-t opened this issue · 2 comments

Expected Behavior

Generate a bonded interface with the MACADDR set using options_extra_redhat on Centos 7.7.

Actual Behavior

Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Resource Statement, Network::Interface[bond0]: has no parameter named 'options_extra_redhat' at /etc/puppetlabs/code/environments/mick_gpu_nodes/modules/network/manifests/init.pp:239 on node superdupernode

Steps to Reproduce the Problem

  1. See the code specifications below.

Specifications

Please add this info:

  1. Output of facter -p on the failing node (at least the OS related facts)
    facter-p.txt
  2. Version of Puppet and of the module
    - example42-network', '3.3.6'
    - Puppet 4.8.2
  3. The relevant Puppet code and eventually Hiera data
    Create a puppet fact that contains the following definition:
network_hash = {
  'net4'=>{
    'bootproto'=>'none', 
    'master'=>'bond0', 
    'slave'=>'yes', 
    'onboot'=>'yes', 
    'hwaddr'=>'42:42:42:42:42:42'
    }, 
  'net5'=>{
    'bootproto'=>'none', 
    'master'=>'bond0', 
    'slave'=>'yes', 
    'onboot'=>'yes',
    'hwaddr'=>'43:43:43:43:43:43'
    },
    'bond0'=>{'peerdns'=>'yes',
    'peerntp'=>'yes',
    'bonding_opts'=>'mode=4 lacp_rate=0 miimon=100',
    'onboot'=>'yes',
    'dns1'=>'192.168.1.1',
    'dns1'=>'192.168.2.1',
    'bootproto'=>'dhcp',
    'nm_controlled'=>'no',
    'options_extra_redhat'=>{
      'MACADDR'=>'42:43:42:43:42:43'
      }
    }
  }

In the manifest instantiate the network class using the fact:

    class { 'network':
      config_dir_purge => true,
      interfaces_hash  => $::network_hash,
    }

Alessandro, thanks for a great puppet module! :)

@mick-t you are using an older version of the module (3.3.6) which has not the options_extra_redhat param https://github.com/example42/puppet-network/blob/master/manifests/interface.pp#L269 present in more recent versions.
(be careful and test before upgrading in production, some changes might trigger a network service restart related to config files changes)