We are trying to replace our Chef-Vault implementation with HashiVault. In the migration I have ben working to do a stand in replacement for how secrets are currently handled. Ideally we get to a more dynamic rotation method, but that is down the road.
I am trying to do this documentation: GitHub - hashicorp/vault-ruby: The official Ruby client for HashiCorp's Vault
but am getting errors related to a method call.
chef_gem 'vault' do
compile_time true
action :upgrade
end
require 'vault'
Vault.configure do |config|
config.address = "VAULT URL"
config.token = "TOKEN"
end
secret = Vault.logical.read("test/vault_test")
test_key = secret.data[:test]
puts "HERE IS YOUR KEY #{test_key}"
The error that it throws is that method data is undefined, but it is supposed to be part of the Vault gem.
Thanks in advance for help!