Class: Kraaken::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/kraaken/config.rb

Instance Method Summary collapse

Instance Method Details

#cloudObject



8
9
10
# File 'lib/kraaken/config.rb', line 8

def cloud
  @cloud ||= Kraaken::Cloud::Hetzner.new(config: self)
end

#credentialsObject



4
5
6
# File 'lib/kraaken/config.rb', line 4

def credentials
  @credentials ||= Kraaken::Credentials::OnePassword.new
end

#ingressObject



16
17
18
# File 'lib/kraaken/config.rb', line 16

def ingress
  @ingress ||= Kraaken::Cloudflare.new(config: self)
end

#load_template(name, **locals) ⇒ Object



24
25
26
27
28
# File 'lib/kraaken/config.rb', line 24

def load_template(name, **locals)
  locals[:config] = self
  name = File.expand_path("../config/#{name}", __dir__) unless name.start_with?("/")
  ERB.new(File.read(name)).result_with_hash(locals)
end

#loggerObject



20
21
22
# File 'lib/kraaken/config.rb', line 20

def logger
  @logger ||= Kraaken::Logger.new
end

#sshObject



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

def ssh
  @ssh ||= Kraaken::Ssh.new(config: self)
end