class VaultTemplateSource
Public Instance Methods
template(template_name)
click to toggle source
# File lib/tiller/template/vault.rb, line 30 def template(template_name) path = interpolate("#{@vault_config['templates']}") Vault.with_retries(Vault::HTTPConnectionError, Vault::HTTPError) do |attempt, e| Tiller::log.warn("#{self} : Received exception #{e} from Vault") if e Vault.logical.read(File.absolute_path(template_name,path)).data[:content] end end
templates()
click to toggle source
# File lib/tiller/template/vault.rb, line 10 def templates return [] unless Tiller::config.has_key?('vault') path = interpolate("#{@vault_config['templates']}") Tiller::log.debug("#{self} : Fetching templates from #{path}") templates = nil Vault.with_retries(Vault::HTTPConnectionError, Vault::HTTPError) do |attempt, e| Tiller::log.warn("#{self} : Received exception #{e} from Vault") if e templates = Vault.logical.list(path) end if templates.is_a? Array templates else Tiller::log.warn("Consul : No templates could be fetched from #{path}") [] end end