You don't want to write your secret variable like api_key
or token
directly in your Vagrantfile.
This plugin enables,
- Generate
secret.yaml
and write your secret keys - Use secret variable in your Vagrantfile
Install 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.
- Fork it ( http://github.com//vagrant-secret/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request