firewall { '100 allow http and https access': |
source => [ |
'1.1.1.1/24', |
'1.1.2.1/24', |
], |
dport => [80, 443], |
proto => tcp, |
action => accept, |
} |
-- Alex Harvey RAZOR Consulting
http://razorconsulting.com.au T: +61 409 665 227
--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/56BD0C52.80307%40Alumni.TU-Berlin.de.
ACCEPT tcp -- 1.1.1.1/24 0.0.0.0/0 multiport dports 80,443 /* 100 allow http and https access */
ACCEPT tcp -- 2.2.2.2/24 0.0.0.0/0 multiport dports 80,443 /* 100 allow http and https access */
firewall { '100 allow http and https access':
ensure => 'present',
action => 'accept',
chain => 'INPUT',
checksum_fill => 'false',
clamp_mss_to_pmtu => 'false',
clusterip_new => 'false',
dport => ['80', '443'],
isfragment => 'false',
kernel_timezone => 'false',
log_uid => 'false',
physdev_is_bridged => 'false',
proto => 'tcp',
random => 'false',
rdest => 'false',
reap => 'false',
rsource => 'false',
rttl => 'false',
socket => 'false',
source => ['1.1.1.1/24', '2.2.2.2/24'],
table => 'filter',
time_contiguous => 'false',
}
On 02/12/2016 07:11 AM, Alex Harvey wrote:
<snip>
ACCEPT tcp -- 1.1.1.1/24 0.0.0.0/0 multiport dports 80,443 /* 100 allow http and https access */
ACCEPT tcp -- 2.2.2.2/24 0.0.0.0/0 multiport dports 80,443 /* 100 allow http and https access */
The provider could be modified so as to represent these as:
Conceptionally, it might just work. But it would be quite hard, and create a maintenance nightmare. (Have you *looked* at the current provider instances/parsing methods? Oh my...)
2.
Add to the firewall module (or perhaps a new Forge module) a defined type that wraps around the existing firewall types/providers. In Puppet 4, that should be easy to do in the DSL using an iterator; but because I'd like to support Puppet 3 as well, it's a bit trickier. Still, quite doable. The hardest part seems to be thinking up a name for the new type. Any suggestions?
While naming things *is* one of the hardest problems in software, I'm sure we can figure something out on this one. No worries.
Iterating on the DSL level is nice and all, but it will cause issues for users who don't purge unmanaged firewall rules (granted, that should be a rare issue, but then I'm willing to bet that there are people with weird edge cases like that.)
The problem is that removing sources from the array of your multiplexer resource will just lead to some firewall resources not being in the catalog anymore. Their respective rules will remain orphaned, which is not what the user will expect.
The problem is that removing sources from the array of your multiplexer resource will just lead to some firewall resources not being in the catalog anymore. Their respective rules will remain orphaned, which is not what the user will expect.
Is this really a problem though? The documentation for the module recommends that users do purge the unmanaged firewall rules. If they choose not to, then they should understand that means they need to take care of those manually. It's no different to any other resource in Puppet. If one day I stop managing the /etc/motd file, I should understand that Puppet won't delete the file; it'll simply leave it in whatever state it was in.
Sure, but I feel that this case is especially confusing.
The user does not remove a resource from their manifest. They change a parameter of one of their resources, which feels like changing a property value for a proper resource. The fact that this may not be sync'ed correctly by the agent can be surprising, and removing firewall rules is a highly critical operation.
So, yes, I think you should go ahead and build that module, but please make sure to plaster its documentation with warnings ;-)
--
You received this message because you are subscribed to a topic in the Google Groups "Puppet Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/puppet-users/6pF_AP3lZbk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to puppet-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/56C8F68B.4000504%40Alumni.TU-Berlin.de.