Puppet for Junos OS
Puppet for Junos OS

Problem creating VLANs via create_resources

‎04-12-2013 04:45 AM

Hi,

 

we just installed puppet on a test switch and trying it out with our puppet infrastructure. I tried to create a few VLANs but it fails with an error:

 

Apr 12 13:30:04  puppet-sw1.test puppet-agent[11950]: iconv couldn't be loaded, which is required for UTF-8/UTF-16 conversions
Apr 12 13:30:10  puppet-sw1.test puppet-agent[11950]: Could not retrieve catalog from remote server: Error 400 on SERVER: Could not autoload puppet/type/netdev_vlan: Could not autoload puppet/provider/netdev_vlan/junos: undefined method `symbolize' for Puppet::Type::Netdev_vlan::ProviderJunos_vlan:Class on node puppet-sw1.test
Apr 12 13:30:10  puppet-sw1.test puppet-agent[11950]: Using cached catalog
Apr 12 13:30:10  puppet-sw1.test puppet-agent[11950]: Finished catalog run in 0.22 seconds

 

This is the node definition at the moment:

 

node 'puppet-sw1.test' {
  netdev_device { $hostname: }

  cron { 'puppetrun':
      environment => 'PATH=/bin:/usr/bin:/sbin:/usr/sbin:/opt/sbin:/opt/bin:/opt/sdk/juniper/bin',
      command => 'puppet agent --onetime --no-daemonize > /tmp/puppetrun.txt 2>&1',
      user => puppet,
      minute => '*/5',
  }

  $vlans = {
    'cust_web' => { vlan_id => 2001, description => 'Customer Webserver' },
    'cust_db' => { vlan_id => 2002, description => 'Customer Databases' },
    'cust_mgmt' => { vlan_id => 2003, description => 'Customer Management' }
  }

  create_resources( netdev_vlan, $vlans )


  $customer_ports = [
    'ge-0/0/10',
    'ge-0/0/11',
    'ge-0/0/12',
    'ge-0/0/13',
    'ge-0/0/14',
    'ge-0/0/15',
    'ge-0/0/16',
    'ge-0/0/17',
    'ge-0/0/18',
    'ge-0/0/19',
    'ge-0/0/20'
  ]

  $customer_vlans = [
    'cust_web',
    'cust_db',
    'cust_mgmt'
  ]

  netdev_l2_interface { $customer_ports:
    vlan_tagging => enable,
    tagged_vlans => $customer_vlans
  }

}

 Is this a problem with netdev_stdlib_junos or with my usage?

 

--
Sebastian Wiesinger
JNCIS-SP
2 REPLIES 2
Puppet for Junos OS

Re: Problem creating VLANs via create_resources

[ Edited ]
‎04-12-2013 05:54 AM

Okay, the symbolize() method was removed from puppet 3.0. We have a puppet 3.0 master so that's the problem. I opened a pull request for the module on github that changes the method:

 

https://github.com/Juniper/puppet-netdev-stdlib-junos/pull/2

--
Sebastian Wiesinger
JNCIS-SP
Puppet for Junos OS

Re: Problem creating VLANs via create_resources

‎04-13-2013 01:46 PM

@sebastianw -

 

Thank you *very much* for testing this on Puppet 3.0 and contributing the patch on the fix.  I greatly appreciate your community support, and I'll roll this into the next distro.

 

Cheers,

-- Jeremy

Cheers,
-- Jeremy

@nwkautomaniac