Test Kitchen, store credentials

不想你离开。 提交于 2019-12-08 04:37:50

问题


With Test Kitchen, in the yaml configs... where is the best place to store globally used attributes that apply to multiple platforms and multiple suites?

To use my .kitchen.yml as an example:

---
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]

I know there are other kitchen files, such as ~/kitchen/config.yml and .kitchen.local.yml but I've been unable to find a away to get attributes to apply to all platforms and suites. Is copy and pasting attributes to platforms the best way?


回答1:


Is there a reason to specify these attributes in kitchen's yaml and not recipe[example_server::deploy_all_artifacts]? If necessary you could set overrides in kitchen.

Also, this post might be helpful: Access Attributes Across Recipes



来源:https://stackoverflow.com/questions/28661252/test-kitchen-store-credentials

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!