class Tiller::DataSource

Subclasses provide global_values and/or values (things local to a specific template) and target_values (meta data about a template, e.g. target location, permissions, owner and so on)

Public Class Methods

new() click to toggle source
# File lib/tiller/datasource.rb, line 14
def initialize
  setup
end

Public Instance Methods

common() click to toggle source

This is where we override any of the common.yaml settings per environment. EG, the exec: parameter and so on. Also can be used for things like network service connection strings (e.g. Zookeeper) and so on.

# File lib/tiller/datasource.rb, line 26
def common
  {}
end
global_values() click to toggle source
# File lib/tiller/datasource.rb, line 30
def global_values
  {}
end
ping() click to toggle source
# File lib/tiller/datasource.rb, line 54
def ping
  'ping!' + Tiller::config.to_s
end
setup() click to toggle source

This is where any post-initialisation logic happens (connecting to a database etc.)

# File lib/tiller/datasource.rb, line 20
def setup
end
target_values(_template_name) click to toggle source

This should provide a hash similar to this example : {

'target'  => "/tmp/#{template_name}",
'user'    => 'root',
'group'   => 'root',
'perms'   => '0644',
'exec_on_write' => [ "/usr/bin/touch" , "somefile.tmp" ]

} Again, we should always return a hash; if we have no data for the given template, just return an empty hash.

# File lib/tiller/datasource.rb, line 50
def target_values(_template_name)
  {}
end
values(_template_name) click to toggle source

We should always return a hash; if we have no data for the given template, just return an empty hash.

# File lib/tiller/datasource.rb, line 36
def values(_template_name)
  {}
end