Class: PEBuild::Config::Global

Inherits:
Object
  • Object
show all
Includes:
PEBuild::ConfigDefault
Defined in:
lib/pe_build/config/global.rb

Direct Known Subclasses

PEBootstrap

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeGlobal

Returns a new instance of Global.



57
58
59
60
61
62
63
64
65
# File 'lib/pe_build/config/global.rb', line 57

def initialize
  @download_root = UNSET_VALUE
  @version       = UNSET_VALUE
  @version_file  = UNSET_VALUE
  @series        = UNSET_VALUE
  @suffix        = UNSET_VALUE
  @filename      = UNSET_VALUE
  @shared_installer = UNSET_VALUE
end

Instance Attribute Details

#download_rootString

Returns The root URI from which to download packages. The URI scheme must be one of the values listed in Transfer::IMPLEMENTATIONS.

Returns:

  • (String)

    The root URI from which to download packages. The URI scheme must be one of the values listed in Transfer::IMPLEMENTATIONS.

Since:

  • 0.1.0



12
13
14
# File 'lib/pe_build/config/global.rb', line 12

def download_root
  @download_root
end

#filenameString

Returns The exact name of the PE installer archive. If missing, a name will be constructed from #version.

Returns:

  • (String)

    The exact name of the PE installer archive. If missing, a name will be constructed from #version.

Since:

  • 0.1.0



46
47
48
# File 'lib/pe_build/config/global.rb', line 46

def filename
  @filename
end

#seriesString

Returns The release series of PE. Completely optional and currently has no effect other than being an interpolation token available for use in download_root.

Returns:

  • (String)

    The release series of PE. Completely optional and currently has no effect other than being an interpolation token available for use in download_root.

Since:

  • 0.9.0



34
35
36
# File 'lib/pe_build/config/global.rb', line 34

def series
  @series
end

#shared_installerBoolean

Returns Whether to run PE installation using installers and answers shared using the /vagrant mount. If set to false, resources will be downloaded remotely to the home directory of whichever user account Vagrant is using. Defaults to true.

Returns:

  • (Boolean)

    Whether to run PE installation using installers and answers shared using the /vagrant mount. If set to false, resources will be downloaded remotely to the home directory of whichever user account Vagrant is using. Defaults to true.

Since:

  • 0.14.0



55
56
57
# File 'lib/pe_build/config/global.rb', line 55

def shared_installer
  @shared_installer
end

#suffixString

Returns The distribution specifix suffix of the Puppet Enterprise installer to use.

Returns:

  • (String)

    The distribution specifix suffix of the Puppet Enterprise installer to use.

Since:

  • 0.1.0



40
41
42
# File 'lib/pe_build/config/global.rb', line 40

def suffix
  @suffix
end

#versionString

Returns The version of PE to install. Must conform to x.y.x[-optional-arbitrary-stuff]. Used to determine the name of the PE installer archive if filename is unset.

Returns:

  • (String)

    The version of PE to install. Must conform to x.y.x[-optional-arbitrary-stuff]. Used to determine the name of the PE installer archive if filename is unset.

Since:

  • 0.1.0



19
20
21
# File 'lib/pe_build/config/global.rb', line 19

def version
  @version
end

#version_fileString, URI

Returns A fully-qualified URI or a path relative to download_root. The contents of this file will be read and used to Specify version.

Returns:

  • (String, URI)

    A fully-qualified URI or a path relative to download_root. The contents of this file will be read and used to Specify version.

Since:

  • 0.9.0



26
27
28
# File 'lib/pe_build/config/global.rb', line 26

def version_file
  @version_file
end

Instance Method Details

#finalize!Object



69
70
71
72
73
74
75
76
77
# File 'lib/pe_build/config/global.rb', line 69

def finalize!
  set_default :@version, nil
  set_default :@version_file, nil
  set_default :@series, nil
  set_default :@suffix, :detect
  set_default :@download_root, nil
  set_default :@filename, nil
  set_default :@shared_installer, true
end

#validate(machine) ⇒ Object



79
80
81
82
83
84
85
86
# File 'lib/pe_build/config/global.rb', line 79

def validate(machine)
  errors = []

  validate_version(errors, machine)
  validate_download_root(errors, machine)

  {"PE build global config" => errors}
end