Try something like this at the top of your Vagrantfile:

require 'yaml'
dir = File.dirname(File.expand_path(__FILE__))
awscreds = YAML.load_file("#{dir}/awscreds.yaml")

aws_access_key = awscreds['aws_access_key']
aws_secret_key = awscreds['aws_secret_key']
...

awscreds.yaml should look something like this:

---
aws_access_key: 'youaccesskeyhere'
aws_secret_key: 'yousecretkeyhere'

This example is sudo code off the top of my head so you might need to work 
with it a little.  You could expand on this to set almost any kind of 
config info outside of Vagrantfile.

Thanks,

robo

On Wednesday, April 29, 2015 at 10:06:25 PM UTC-7, Alvaro Miranda Aguilera 
wrote:
>
> On Thu, Apr 30, 2015 at 5:31 AM, Pani <[email protected] <javascript:>> 
> wrote: 
> > config.vm.provision 
>
> Hello, 
>
> From what I understand you need those variables set, as Vagrantfile is 
> written ruby  you can 
>
> - set your own AWS credentials outside the project at 
> ~/.vagrant.d/Vagrantfile that will be available on your instances 
> - set the enviroment before vagrant up (check vagrant-trigger plugin) 
> - load a ruby hash and use it 
> - load a file an set ENV[''variable] based on that file 
>
> config.vm.provision will copy that file to the VM created on AWS after 
> the AWS instance is created 
>
> I did write to sound like a loop because is what it's at the moment. 
>
> Please let me know if you need examples, and what path do you think is 
> the best for you 
>
> Thanks, 
> alvaro. 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to