module Beaker::DSL::InstallUtils::AIODefaults

def add_aio_defaults_on(hosts)

Parameters:
  • hosts (Host, Array, String, Symbol) -- One or more hosts to act upon,
def add_aio_defaults_on(hosts)
  block_on hosts do | host |
    if host['platform'] =~ /windows/
      platform = 'windows'
    else
      platform = 'unix'
    end
    add_platform_aio_defaults(host, platform)
  end
end

def add_platform_aio_defaults(host, platform)

Parameters:
  • platform (String) -- The platform type of this host, one of windows or unix
  • host (Host) -- A single host to act upon
def add_platform_aio_defaults(host, platform)
  AIO_DEFAULTS[platform].each_pair do |key, val|
    host[key] = val
  end
  # add group and type here for backwards compatability
  if host['platform'] =~ /windows/
    host['group'] = 'Administrators'
  else
    host['group'] = 'puppet'
  end
end

def remove_aio_defaults_on(hosts)

Parameters:
  • hosts (Host, Array, String, Symbol) -- One or more hosts to act upon,
def remove_aio_defaults_on(hosts)
  block_on hosts do | host |
    if host['platform'] =~ /windows/
      platform = 'windows'
    else
      platform = 'unix'
    end
    remove_platform_aio_defaults(host, platform)
  end
end

def remove_platform_aio_defaults(host, platform)

Parameters:
  • platform (String) -- The platform type of this host, one of windows, pswindows, freebsd, mac & unix
  • host (Host) -- A single host to act upon
def remove_platform_aio_defaults(host, platform)
  AIO_DEFAULTS[platform].each_pair do |key, val|
    host.delete(key)
  end
  host['group'] = nil
end