You don't want to write your secret variable like api_key
or token
directly in your Vagrantfile.
This plugin enables,
secret.yaml
and write your secret keysInstall it as a Vagrant plugin.
$ vagrant plugin install vagrant-secret
Generate secret.yaml
$ vagrant secret-init
Edit your .vagrant.secret.yaml
client_id: "*******"
api_key: "********"
Use it in your Vagrantfile (for example when you use DigitalOcean).
Vagrant.configure('2') do |config|
config.vm.provider :digital_ocean do |provider, override|
provider.client_id = Secret.client_id
provider.api_key = Secret.api_key
end
end
You can use your yaml key as Secret
class variable.
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)