Skip to content

Instantly share code, notes, and snippets.

@lak
Created December 28, 2010 01:32
Show Gist options
  • Select an option

  • Save lak/756769 to your computer and use it in GitHub Desktop.

Select an option

Save lak/756769 to your computer and use it in GitHub Desktop.
Puppet::Type.newtype(:iptables) do
...
def generate
self.class.new(:name => "last")
end
def autorequire(:iptables)
return unless name == "last"
self.catalog.resources.collect { |r| r.type == :iptables }
end
# In provider:
def flush
return unless name == "last"
# write file out
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment