Pastie now auto-senses if line-wrap is a bad or good idea. Feedback?
## mark a section (Learn more)
module Puppet::Parser::Functions newfunction(:interface_alias, :type => :rvalue) do |args| interface_alias = args[0] $stderr = File.open("/tmp/plugin.output","w") interface_data = `/sbin/ip address show label #{interface_alias}`.split if interface_data[1].nil? "_default_" else interface_data[1].gsub(/\/\d+/, '') end end end --- manifest usage --- $foo = interface_alias("eth0:0")
This paste will be private.
From the Design Piracy series on my blog: