Appropriate firewalling support is a hard thing in gluster if you take
in to account all the bootstrapping problems of what needs to be open
before subsequent things can work. Hopefully this patch is a good first
step in finally doing the right things.
# along with this program. If not, see <http://www.gnu.org/licenses/>.
classgluster::server(
- $ips = [], # this should be a list of ip's for each in hosts[] # TODO: i would have rather this happen with a local dns resolver, but I can't figure out how to make one! # NOTE: this can be overcome probably by using exported resources or dns names in shorewall (bad)
- $clients = [], # list of allowed client ip's
#$vip = '', # vip of the cluster (optional but recommended)
$nfs = false, # TODO
$shorewall = false,
$zone = 'net', # TODO: allow a list of zones
- $allow = 'all'
+ $ips = false, # an optional list of ip's for each in hosts[]
+ $clients = [] # list of allowed client ip's # TODO: get from exported resources
) {
$FW = '$FW'# make using $FW in shorewall easier
@@ -78,77 +77,49 @@
}
if$shorewall {
- if $allow == 'all' {
- $net = 'net'
- } else {
- $net = "net:${allow}"
- }
- # TODO: could the facter values help here ?
- #$other_host_ips = inline_template("<%= ips.delete_if {|x| x == '${ipaddress}' }.join(',') %>") # list of ips except myself
+ # if "${::gluster_firewall_ips}" == '' { # fact !
+ # $src = "${zone}"
+ # } else {
+ # $src = "${zone}:${::gluster_firewall_ips}"
+ # }
+ #}
- # TODO: is this only used for nfs?
- shorewall::rule { 'gluster-111':
- rule => "
- ACCEPT ${src} $FW tcp 111
- ACCEPT ${src} $FW udp 111
- ",
- comment => 'Allow tcp/udp 111.',
- before => Service['glusterd'],
- }
+ #shorewall::rule { 'glusterfsd-easyfw': # XXX: use the correct port range
+ # rule => "
+ # ACCEPT ${src} $FW tcp 24009:25009
+ # ",
+ # comment => 'Allow incoming tcp:24009-25009 from each other glusterfsd and clients.',
+ # before => Service['glusterd'],
+ #}
- # XXX: WIP
- #$endport = inline_template('<%= 24009+hosts.count %>') # XXX: is there one brick per server or two ? what does 'brick' mean in the context of open ports?
- #$nfs_endport = inline_template('<%= 38465+hosts.count %>') # XXX: is there one brick per server or two ? what does 'brick' mean in the context of open ports?
0 comments on commit
1d423ad