Module: Avm::Instances::Base::AutoValues::Install

Defined in:
lib/avm/instances/base/auto_values/install.rb

Instance Method Summary collapse

Instance Method Details

#auto_accessObject



10
11
12
# File 'lib/avm/instances/base/auto_values/install.rb', line 10

def auto_access
  read_entry_optional(::Avm::Instances::EntryKeys::INSTALL_URL).present? ? 'ssh' : 'local'
end

#auto_install_hostnameObject



14
15
16
17
# File 'lib/avm/instances/base/auto_values/install.rb', line 14

def auto_install_hostname
  inherited_entry_value(::Avm::Instances::EntryKeys::INSTALL_ID,
                        ::Avm::Instances::EntryKeys::INSTALL_HOSTNAME)
end

#auto_install_portObject



19
20
21
22
# File 'lib/avm/instances/base/auto_values/install.rb', line 19

def auto_install_port
  inherited_entry_value(::Avm::Instances::EntryKeys::INSTALL_ID,
                        ::Avm::Instances::EntryKeys::INSTALL_PORT) || 22
end

#auto_install_urlObject



29
30
31
32
33
# File 'lib/avm/instances/base/auto_values/install.rb', line 29

def auto_install_url
  inherited_entry_value(::Avm::Instances::EntryKeys::INSTALL_ID,
                        ::Avm::Instances::EntryKeys::INSTALL_URL) ||
    auto_install_url_by_parts
end

#auto_install_url_by_partsObject



35
36
37
38
39
40
41
42
43
# File 'lib/avm/instances/base/auto_values/install.rb', line 35

def auto_install_url_by_parts
  read_entry_optional(::Avm::Instances::EntryKeys::INSTALL_HOSTNAME).if_present do |a|
    a = read_entry_optional(::Avm::Instances::EntryKeys::INSTALL_USERNAME)
          .if_present(a) { |v| "#{v}@#{a}" }
    a = read_entry_optional(::Avm::Instances::EntryKeys::INSTALL_PORT)
          .if_present(a) { |v| "#{a}:#{v}" }
    "ssh://#{a}"
  end
end

#auto_install_usernameObject



24
25
26
27
# File 'lib/avm/instances/base/auto_values/install.rb', line 24

def auto_install_username
  inherited_entry_value(::Avm::Instances::EntryKeys::INSTALL_ID,
                        ::Avm::Instances::EntryKeys::INSTALL_USERNAME)
end