first stab at creating a custom type

works pretty well actually!
first stab at creating a custom provider

works pretty well too(ish)!!

we can use the custom type 'linux_firewall' which takes the parameter 'name'
and the properties 'source_ip' and 'dest_ip'. 'get_rules_list' never comes
back as empty so the specified rule is added over and over again on each run.
updated the iptables command to something more verbose (although line numbers
are not a possibility) and added a comment to the create definition

losing the will to live.

now, what is this funny business going on with the return nill if != =~ etc..
USE CIDR IP ADDRESSES
USE Proc.new TO ITERATE OVER LINES & RETURN VALUE

TODO iterate over the list of rules taken from the manifest instead of
just checking for "-A"
temporarily set source/dest ip's to params
POPULATE DESTROY DEF, ENABLING GRANULAR DELETION

individual rules are deleted instead of a complete flush

added second rule to assist with testing
COMPLETELY WORKING PROTOTYPE F/W TYPE & PROVIDER

for each linux_firewall resource instance, the provider iterates over
each line of the output of "iptables -S", regex checking for a match
against the resource instance's source, dest and commment. (this regex
will need to be updated when support for ports and protocols is
implemented). if a match is found, the variable "finding" is set to 1,
else it remains nil.

a proc was chosen over a block to allow the setting of the "finding"
varible outside of the proc and allow the variable to be set to 1 if
criteria are met anywhere during the iteration within the proc.

a proc was chosen over a lambda because of the way the return command
is handled by procs.

having said that, as iteration over resource instances is not required
it may be possible to use a simple block.

http://awaxman11.github.io/blog/2013/08/05/what-is-the-difference-between-a-block/

TODO

revert source/dest back to properties
add ordering logic
tests!!!!
use 'iptables' method instead of invoking shell

a method is created at the top of the myprovider.rb file. use this
method instead of executing an external command. allows for debug
logging.
moved variable definitions to a saner place