Last active
March 16, 2017 18:10
-
-
Save tuxpower/0aa92f86f82f1c059d7ddc728888bf1d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ``` | |
| # Defines our Vagrant environment | |
| # | |
| # -*- mode: ruby -*- | |
| # vi: set ft=ruby : | |
| Vagrant.configure("2") do |config| | |
| config.vm.box = "dummy" | |
| ENV['VAGRANT_DEFAULT_PROVIDER'] = 'aws' | |
| # create some web servers | |
| # https://docs.vagrantup.com/v2/vagrantfile/tips.html | |
| (1..1).each do |i| | |
| config.vm.define "mgnt" do |node| | |
| node.ssh.username = "centos" | |
| node.ssh.proxy_command = "ssh -t -i ~/.ssh/ubuntu.pem <BASTION-IP> -l ubuntu nc %h %p" | |
| node.ssh.private_key_path = "~/.ssh/centos.pem" | |
| node.ssh.pty = true | |
| node.vm.provider :aws do |aws, override| | |
| aws.aws_profile = "aws-profile-name" | |
| aws.ami = "ami-xxxx" | |
| aws.subnet_id = "subnet-xxxx" | |
| aws.security_groups = "sg-xxxx" | |
| aws.instance_type = "t2.large" | |
| aws.keypair_name = "keypair-name" | |
| end | |
| end | |
| end | |
| end | |
| ssh -v -o ProxyCommand='ssh -i ~/.ssh/ubuntu.pem ubuntu@<BASTION-IP> nc <DEST-IP> 22' -i ~/.ssh/centos.pem centos@<DEST-IP> | |
| ``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment