_key_path = server if serverĬonfig.vm.synced_folder ".", "/vagrant", type: "rsync"Ĭonfig.vm.provision :shell, path: server if server #aws.secret_access_key = "YOUR SECRET KEY"Īws.region = server if serverĪws.keypair_name = server if serverĪws.subnet_id = server if serverĪws.associate_public_ip = server if serverĪws.security_groups = server if serverĪws.iam_instance_profile_name = server if serverĪws.ami = server if serverĪws.instance_type = server if serverĪws.tags = server if serverĪws.user_data = server if server # Dont do these here, better to use awscli with a profile nfigure(VAGRANTFILE_API_VERSION) do |config| # Specify minimum Vagrant version and Vagrant API version The below Vagrantfile utilizes a yaml file ( servers.yaml) to provide the data, it allows you to control data using the yaml file and not have to modify the Vagrantfile code – separating code and data. TL DR To get started right away you can download the project from github vagrant-aws-puppetserver, otherwise follow the guide below. A better way is to have the AWS CLI tools installed and configuredĪWS Access Key ID : XXXXXXXXYYYĪWS Secret Access Key :ZZZZZZZOOOĭefault region name :us-east-1 While you can add your AWS credentials to the Vagrantfile, it is not recommended. I am separating data and code by having a generic Vagrantfile with the code and have a servers.yaml file with all the data that will change from user to user.įor installing the Puppet Enterprise server I am including the automated provisioning script I am using with Vagrant and using AWS Tags to set the hostname of the launched server. If you are spinning up a machine for the first time on EC2, remember to create a Security Group that allow ssh both in and out, and add port 80 for web traffic as well.In this guide I go over how to use Vagrant with AWS and in the process have an automated way to install Puppet Enterprise. Now you can both have your VirtuelBox running and spin another box identical up on Amazon EC2. Then inside that block you can add your aws provider details, then it would look something like this: config.vm.define "aws", autostart: false do |aws_vm|Īws_vm.vm.provider :aws do |aws, override| Next you can add the dummy image so it do not tries to start your machine on aws. Now, this machine will not get started when you do vagrant up, but will get started when you do vagrant up aws. config.vm.define "aws", autostart: false do |aws_vm| The tricks is to create another machine, but to set it to not start up with your default machine. Until then, please destroy the existing machine to up with a new A future version will remove this limitation. VagrantĬurrently allows each machine to be brought up with only a single If you are trying to use another provider with your current vagrant machine, you will likely get this error:Īn active machine was found with a different provider.
0 Comments
Leave a Reply. |