1

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 など、他のキッチン ファイルがあることは知っていますが、すべてのプラットフォームとスイートに適用する属性を取得する方法を見つけることができませんでした。属性をコピーしてプラットフォームに貼り付けるのが最善の方法ですか?

4

1 に答える 1

1

これらの属性をキッチンの yaml ではなく指定する理由はありますrecipe[example_server::deploy_all_artifacts]か? 必要に応じて、キッチンでオーバーライドを設定できます。

また、この投稿が役立つ場合があります:レシピ全体で属性にアクセスする

于 2015-06-12T14:43:20.970 に答える