Method: Beaker::HostPrebuiltSteps#disable_se_linux

Defined in:
lib/beaker/host_prebuilt_steps.rb

#disable_se_linux(host, opts) ⇒ Object

Disable SELinux 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):



441
442
443
444
445
446
447
448
449
450
451
# File 'lib/beaker/host_prebuilt_steps.rb', line 441

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