【问题标题】:Test Kitchen, store credentials测试厨房,存储凭证
【发布时间】:2015-04-24 00:53:13
【问题描述】:

使用 Test Kitchen,在 yaml 配置中......哪里是存储适用于多个平台和多个套件的全局使用属性的最佳位置?

以我的 .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: <snip>
      ssh_key: <snip>
      availability_zone: us-east-1a
      subnet_id: subnet-<snip>
      require_chef_omnibus: true
      iam_profile_name: <snip>
      ebs_delete_on_termination: true
      security_group_ids: sg-<snip>

# area in question (does not work here)
attributes:
  teamcity:
    server: 'build.example.com'
    port: 80
    username: 'example'
    password: 'example'
# end area in question

suites:
  - name: resin4
    run_list:
      - recipe[example_server::resin4]
      - recipe[example_server::deploy_all_artifacts]
  - name: deploy
    run_list:
      - recipe[example_server::deploy_all_artifacts]
  - name: default
    run_list:
      - recipe[example_server::elasticsearch]
      - recipe[example_server::resin4]
      - recipe[example_server::deploy_all_artifacts]

我知道还有其他厨房文件,例如 ~/kitchen/config.yml 和 .kitchen.local.yml,但我一直无法找到适用于所有平台和套件的属性。将属性复制和粘贴到平台是最好的方法吗?

【问题讨论】:

    标签: test-kitchen chefdk


    【解决方案1】:

    是否有理由在厨房的 yaml 中而不是 recipe[example_server::deploy_all_artifacts] 中指定这些属性?如有必要,您可以在厨房设置覆盖。

    另外,这篇文章可能会有所帮助:Access Attributes Across Recipes

    【讨论】:

    • 这正是我发表这篇文章后最终要做的事情。谢谢!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-03-15
    • 1970-01-01
    相关资源
    最近更新 更多