【问题标题】:Test Kitchen (chefdk), Vagrant and Amazon VPC测试厨房 (chefdk)、Vagrant 和 Amazon VPC
【发布时间】:2015-03-07 06:12:18
【问题描述】:

我正在尝试让 KitchenCI 在我的 Amazon VPC 中构建测试实例。我有这个工作,但是当 Vagrant 尝试连接到 ec2 实例时,它使用实例的外部(公共)IP 与它的内部(VPC)IP。有什么办法可以在 Vagrant 中改变这一点?

.kitchen.yml:

---
provisioner:
   name: chef_solo

platforms:
  - name: centos-6.5
    driver:
      name: vagrant
  - name: amazon
    driver:
      name: ec2
      image_id: ami-ed8e9284
      flavor_id: t2.medium
      aws_ssh_key_id: DevOps
      ssh_key: /Users/djimenez/.ssh/devops_rsa.pub
      availability_zone: us-east-1a
      subnet_id: subnet-1903a976
      require_chef_omnibus: true
      iam_profile_name: atc
      ebs_delete_on_termination: true
      security_group_ids: sg-7461ae1b

suites:
 <snip>

【问题讨论】:

    标签: amazon-ec2 vagrant amazon-vpc test-kitchen


    【解决方案1】:

    看来我需要将以下内容添加到我的 .kitchen.yml 中:

    driver:
      name: ec2
      interface: private
    

    docs 说:

    界面

    从中派生主机名以与 实例。可以是 dns、公共或私有的。如果未设置,驱动程序 将通过按以下顺序故障返回来派生主机名:

    1. DNS 名称
    2. 公共 IP 地址
    3. 私有 IP 地址

    默认未设置。

    【讨论】:

      猜你喜欢
      • 2017-07-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-03-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多