test-kitchen

Chef solo can't find cookbook during kitchen test run

夙愿已清 提交于 2019-12-13 07:56:21
问题 I'm trying to add a Test Kitchen for a bunch of cookbooks that we use to provision a Jenkins CI instance. We use Berkshelf to manage dependencies. The file structure is as follows: | .gitignore | .kitchen.yml | Berksfile | Berksfile.lock | bootstrap.sh | chefignore | metadata.rb | provision.sh | readme.md | solo.json | solo.rb | tree.txt | VERSION | +---.kitchen | | default-ubuntu-1404.yml | | | +---kitchen-vagrant | | \---kitchen-chef-jenkins-default-ubuntu-1404 | | | Vagrantfile | | | | | \

Chef Vault with Test-Kitchen, Vagrant and Chef-Zero provisioner

拥有回忆 提交于 2019-12-11 05:40:39
问题 I have an environment setup with Test-Kitchen v1.5.0, Vagrant v1.8.1. I have a recipe that uses chef vault to decrypt our encrypted passwords that our in our data_bags_path/passwords/pilot.json file. I am using the solution here https://github.com/chef/chef-vault/issues/58 that daxgames provides towards the end of the page. My .kitchen.yml : --- driver: name: vagrant provisioner: name: chef_zero require_chef_omnibus: 12.14.77 roles_path: ../../roles environments_path: ../../environments data

How can I get test kitchen run same chef recipe multiple times?

北城以北 提交于 2019-12-10 21:16:17
问题 I have a chef recipe that I'm using for deploying an application. Each time the recipe runs it creates a new "release" (with the current timestamp) directory and deletes older "release" directories leaving only the 5 most recent "release" directories. (similar to how Capistrano's keep_releases works). To test that functionality I need to run my "deploy" recipe 6 times and verify that there are only 5 "release" directories. It seems that I am not able to have the same recipe in the run_list

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:

How to specify cookbook path in .kitchen.yml file for chef_solo provisioner?

淺唱寂寞╮ 提交于 2019-12-07 17:13:36
问题 I want to specify cookbook paths using chef_solo as a provisioner in Test Kitchen. We are not using Berkshelf or chef_zero at this time. I set cookbooks_path in my .kitchen.yml file, but it seems like the chef_solo provisioner ignores that flag. See stack trace, below. .kitchen.yml --- driver: name: vagrant provisioner: name: chef_solo require_chef_omnibus: 11.8.0 roles_path: '../../roles' data_bags_path: '../../data_bags' environments_path: '../../environments' cookbooks_path: '../cookbooks,

How to specify cookbook path in .kitchen.yml file for chef_solo provisioner?

吃可爱长大的小学妹 提交于 2019-12-06 01:48:28
I want to specify cookbook paths using chef_solo as a provisioner in Test Kitchen. We are not using Berkshelf or chef_zero at this time. I set cookbooks_path in my .kitchen.yml file, but it seems like the chef_solo provisioner ignores that flag. See stack trace, below. .kitchen.yml --- driver: name: vagrant provisioner: name: chef_solo require_chef_omnibus: 11.8.0 roles_path: '../../roles' data_bags_path: '../../data_bags' environments_path: '../../environments' cookbooks_path: '../cookbooks, ../../site-cookbooks' Stack trace: $ kitchen converge analytics-centos-65 -----> Starting Kitchen (v1

node search is giving nothing in test kitchen

霸气de小男生 提交于 2019-12-02 18:42:47
问题 No output from search in test kitchen Throwing error check the recipe and suggest me some details Node JSON file { "id": "cldb", "chef_type": "node", "json_class": "Chef::Node", "run_list": [], "automatic": { "hostname": "cldb.net", "fqdn":"127.0.0.1", "name": "cldb.net", "ipaddress": "127.0.0.1", "roles": [], "cldb" : true } } Recipe cldbNodes = search(:node, "cldb:true") cldb = "#{cldbNodes["fqdn"]}" file '/tmp/test.txt' do content "#{cldb}" end 回答1: To summarize from the comments above,

node search is giving nothing in test kitchen

﹥>﹥吖頭↗ 提交于 2019-12-02 08:21:39
No output from search in test kitchen Throwing error check the recipe and suggest me some details Node JSON file { "id": "cldb", "chef_type": "node", "json_class": "Chef::Node", "run_list": [], "automatic": { "hostname": "cldb.net", "fqdn":"127.0.0.1", "name": "cldb.net", "ipaddress": "127.0.0.1", "roles": [], "cldb" : true } } Recipe cldbNodes = search(:node, "cldb:true") cldb = "#{cldbNodes["fqdn"]}" file '/tmp/test.txt' do content "#{cldb}" end To summarize from the comments above, search(...) returns an array so you need to get a specific element, usually the first, before you can access

Adding Attributes to Test Kitchen

两盒软妹~` 提交于 2019-11-30 20:04:02
I'm trying to override attributes in the java cookbook with test-kitchen . When I try run kitchen converge default-centos-64 , a bad YAML error shows up. --- driver: name: vagrant customize: memory: 1024 cpuexecutioncap: 50 provisioner: name: chef_solo platforms: - name: centos-6.4 suites: - name: default run_list: - recipe[java::default] - recipe[maven::default] attributes: { java.install_flavor: "oracle", java.jdk_version: "7" } I pasted the above into http://yamllint.com/ . When I hit "Go," it removes all lines beginning at "attributes", and then shows a Green "Valid YAML". Attributes are

How to specify cookbook path in .kitchen.yml file?

坚强是说给别人听的谎言 提交于 2019-11-30 18:12:14
I have my Chef cookbooks stored in chef/cookbooks/ folder. When running kitchen converge I am still getting notice Berksfile, Cheffile, cookbooks/, or metadata.rb not found so Chef will run with effectively no cookbooks. Is this intended? I tried many options, for example: suites: - name: default run_list: recipe[git] cookbook_path: "chef/cookbooks" but I can't find the proper solution. How to specify the cookbooks' and roles' paths? You'll want to put the path in your berksfile, which will likely end up looking like so.. source 'https://supermarket.chef.io' cookbook 'cookbookname', path: