class MStrap::Configuration

Included Modules

Defined in:

mstrap/configuration.cr

Constant Summary

DEFAULT_PROFILE_CONFIG_DEF = Defs::DefaultProfileConfigDef.new

Constructors

Instance Method Summary

Instance methods inherited from module MStrap::DSL::System

cmd(env : Hash | Nil, command : String, args : Array(String) | Nil, shell = true, input = Process::Redirect::Inherit, output = Process::Redirect::Inherit, error = Process::Redirect::Inherit, quiet = false, sudo = false) cmd

Instance methods inherited from module MStrap::DSL::Logging

log(msg) log, logc(msg) logc, logd(msg) logd, logn(msg) logn, logw(msg) logw, success(msg) success

Constructor Detail

def self.new(config : Defs::ConfigDef, config_path : String = Paths::CONFIG_HCL) #

[View source]

Instance Method Detail

def config_path : String #

Returns path to configuration file


[View source]
def known_profile_configs : Array(MStrap::Defs::ProfileConfigDef) #

Returns known profile configurations


[View source]
def load_profiles!(force = false) #

Loads all profiles and resolves them into the resolved_profile

Raises ConfigurationNotFoundError if a profile cannot be found.


[View source]
def loaded_profile_configs : Array(MStrap::Defs::ProfileConfigDef) #

Returns loaded profile configurations


[View source]
def loaded_profiles : Array(MStrap::Defs::ProfileDef) #

Returns loaded profiles


[View source]
def loaded_profiles? #

Returns whether profiles have been loaded


[View source]
def profile_configs #

Returns profile configurations for active profiles


[View source]
def profiles #

Returns active profiles


[View source]
def reload!(force = false) #

Resets and reloads configuration and any managed profiles.

Raises ConfigurationNotFoundError if the mstrap configuration cannot be found or accessed, or any managed profiles cannot be found or accessed.


[View source]
def resolved_profile : MStrap::Defs::ProfileDef #

Returns resolved profile. This is the result of merging loaded managed profiles with the default profiles.


[View source]
def save! #

Saves configuration back to disk


[View source]
def user : MStrap::User #

Returns the mstrap user


[View source]