Sha256: 285d13d7b6c6e8094ca153a4e63960ab40fdb2e5d8ed99a910685f50d4542b6f
Contents?: true
Size: 615 Bytes
Versions: 29
Compression:
Stored size: 615 Bytes
Contents
module Kontena::Cli::Vault class ExportCommand < Kontena::Command include Kontena::Cli::Common include Kontena::Cli::GridOptions banner "Exports secrets from Vault to STDOUT as YAML or JSON." requires_current_master option '--json', :flag, "Output JSON" def execute require 'shellwords' meth = json? ? :to_json : :to_yaml puts Hash[ *Kontena.run('vault ls --return', returning: :result).sort.flat_map do |secret| [secret, Kontena.run("vault read --return #{secret.shellescape}", returning: :result)] end ].send(meth) end end end
Version data entries
29 entries across 29 versions & 1 rubygems