Class: DInstallerCli::InstallConfigReader

Inherits:
Object
  • Object
show all
Defined in:
lib/dinstaller_cli/install_config_reader.rb

Overview

Class for generating the config of the installation from a YAML file

The YAML file has the following structure:

product: <product-id>

languages:

- <language-id>
- <language-id>

disks:

- <device-name>
- <device-name>

user:

name:      <name>
fullname:  <fullname>
password:  <password>
autologin: <autologin>

root:

password: <password>
ssh_key:  <key>

Examples:

config = InstallConfigReader.new("example.yaml").read
config.languages  #=> ["en_US", "es_ES"]
config.disks      #=> ["/dev/vda"]
config.user       #=> #<InstallConfig::User>
config.user.name  #=> "john"

Defined Under Namespace

Classes: Error

Instance Method Summary collapse

Constructor Details

#initialize(source) ⇒ InstallConfigReader

Constructor

Parameters:

  • source (String)

    path of the config file



63
64
65
# File 'lib/dinstaller_cli/install_config_reader.rb', line 63

def initialize(source)
  @source = source
end

Instance Method Details

#readInstallConfig

Reads the config file and generates an installation config

Returns:

Raises:

  • (Error)

    see #load_content



72
73
74
75
# File 'lib/dinstaller_cli/install_config_reader.rb', line 72

def read
  content = load_content
  config_from(content)
end