Method: Beaker::HostPrebuiltSteps#disable_iptables

Defined in:
lib/beaker/host_prebuilt_steps.rb

#disable_iptables(host, opts) ⇒ Object

Disable iptables on centos, does nothing on other platforms

Parameters:

  • host (Host, Array<Host>)

    One or more hosts to act upon

  • opts (Hash{Symbol=>String})

    Options to alter execution.

Options Hash (opts):



457
458
459
460
461
462
463
464
465
466
467
# File 'lib/beaker/host_prebuilt_steps.rb', line 457

def disable_iptables host, opts
  logger = opts[:logger]
  block_on host do |host|
    if host['platform'] =~ /centos|el-|redhat|fedora|eos/
      logger.debug("Disabling iptables on #{host.name}")
      host.exec(Command.new("sudo su -c \"/etc/init.d/iptables stop\""), {:pty => true})
    else
      logger.warn("Attempting to disable iptables on non-supported platform: #{host.name}: #{host['platform']}")
    end
  end
end