我们在Windows上运行Vagrant,使用EC2插件来启动Windows框。
运行我们的Vagrant文件时,系统会提示我们输入SMB共享的用户名/密码。
我们如何编辑Vagrant文件或添加命令行开关来抑制此用户交互?
我们的Vagrant命令是vagrant up --provider=aws
我们的流浪档案如下
Vagrant.configure("2") do |config|
config.vm.box = "dummy"
config.vm.guest = :windows
config.vm.network :forwarded_port, guest: 3389, host: 3389
config.vm.network :forwarded_port, guest: 22, host: 22
config.vm.network :forwarded_port, guest: 5985, host: 5985, id: "winrm", auto_correct: true
config.ssh.username = "user"
config.ssh.password = "password"
config.ssh.insert_key = false
config.vm.provider :aws do |aws, override|
aws.access_key_id = "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
aws.secret_access_key = "KKKKKKKKKKKKKKKKKKKKKK"
aws.ami = "ami-i866gft"
end
end
答案 0 :(得分:1)
也许你有一种不同的方式与流浪汉合作。这适用于我的情况,没有任何互动:
Vagrant.configure("2") do |config|
config.vm.box = "dummy.box"
config.vm.synced_folder '.', '/vagrant', disabled: true
config.vm.provider :aws do |aws, override|
aws.access_key_id = "XXXX"
aws.secret_access_key = "XXXX"
aws.ami ="ami-f2f5f9ef"
aws.security_groups = ['instance-name-on-aws']
aws.keypair_name = "ssh_key_name"
override.ssh.username = "user"
override.ssh.private_key_path = "ssh_key_name.pem"
aws.instance_type = "t2.micro"
aws.region = "region"
end
end