chef-solo

Bootstrapping issues in Chef

混江龙づ霸主 提交于 2019-12-08 01:34:28
问题 I have setup a basic infrastructure using chef. This includes a local chef server(ubuntu based), workstation and an ubuntu based server(to be used as the node). Please note that the entire infrastructure lies behind the firewall in my office network. And I have made necessary proxy settings for the servers to access the internet. So here is the problem - When I try to bootstrap the node using - knife bootstrap <node's ip> --sudo -x <username> -P <password> -N "<name>" i get the following

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,

cookbook_name in recipe- TypeError: no implicit conversion of Symbol into String

戏子无情 提交于 2019-12-06 10:09:59
I have the following code in my recipe but it errors. log "###" + cookbook_name + "::" + recipe_name + " " + Time.now.inspect + ": Starting execution phase" puts "###" + cookbook_name + "::" + recipe_name + " " + Time.now.inspect + ": Starting compile phase" The error is: TypeError: no implicit conversion of Symbol into String /test/chef/cookbooks/cookbook-server/recipes/setup_server.rb:10:in `+' The issue seems to be with the cookbook_name , recipe_name etc.(the ones which are not hardcoded). Please help. When you're doing + action with the strings in Ruby, it doesn't convert other types to

Using attributes in Chef Solo JSON

半世苍凉 提交于 2019-12-06 10:04:43
问题 Is it possible to specify attribute values in Chef Solo's JSON? I have a solo.json with a run list and I would like to specify the attributes there. The Chef documentation seems to indicate it should be possible for me to do something like: { "hostname": { "test": "value2" }, "default_attributes": { "hostname": { "test": "value3" } }, "override_attributes": { "hostname": { "test": "value4" } }, "default": { "hostname": { "test": "value5" } }, "run_list": [ "recipe[hostname::default]" ] }

Chef workflow for new cookbooks

穿精又带淫゛_ 提交于 2019-12-06 08:37:04
问题 While building my own cookbooks I find myself constantly within this cycle: Change cookbook on my local computer Upload modified cookbook to chef server Run chef-client on remote machine Repeat Since I am new to chef, I repeat that cycle extremely often, but I find rather cumbersome uploading and downloading so frequently from the chef server. How experienced chef users ease this cycle? I learnt Chef with the free hosted solution, but I am not sure if I should be better off using just Chef

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

Why does the LWRP custom definition gives me undefined method for nil:NilClass

喜你入骨 提交于 2019-12-05 11:55:34
I have problem with my custom definition of this LWRP. resources : user_postgresql. actions :create, :alter default_action :create attribute :username, :kind_of => String attribute :password, :kind_of => String attribute :database_name, :kind_of => String providers : user_postgresql. def whyrun_supported? true end action :create do converge_by "Create [#{new_resource}]" do USER_NAME = new_resource.username USER_PASSWORD = new_resource.password unless (new_resource.password.nil? || new_resource.password.empty?) USER_PASSWORD = USER_NAME DATABASE_NAME = new_resource.database_name unless (new

Chef Solo error: Cookbook apt not found

﹥>﹥吖頭↗ 提交于 2019-12-05 07:21:09
Hy I'm trying to run a MongoDB recipe with Chef Solo on an Amazon EC2 Linux AMI. I've installed Omnibus, set the cookbook path in the .rb file, and the runlist in the .json file. I've copied the content of the mongodb recipe zip from github to to cookbook folder, and ran the chef-solo command. The result is below: FATAL: Chef::Exceptions::CookbookNotFound: Cookbook apt not found. If you're loading apt from another cookbook, make sure you configure the dependency in your metadata I'm pretty new to Linux too, what am I doing wrong here? The error is pretty descriptive. You likely have a cookbook

Berkshelf cookbooks are not being copied to the Vagrant directory

允我心安 提交于 2019-12-05 01:09:55
问题 I am trying to provision a Vagrant machine using Chef-solo, Berkshelf, and the vagrant-berkshelf plugin. However, the provisioning fails with this error: Berkshelf::CookbookNotFound: Cookbook <cookbook name> not found in any of the default locations berks install successfully installs everything to ~/.berkshelf/cookbooks/ , but the cookbooks are never copied over to ~./berkshelf/default/vagrant/berkshelf-20131017-8441-pqghfq-default which is where Berkshelf reports it is updating, right

Using attributes in Chef Solo JSON

ぃ、小莉子 提交于 2019-12-04 15:54:52
Is it possible to specify attribute values in Chef Solo's JSON? I have a solo.json with a run list and I would like to specify the attributes there. The Chef documentation seems to indicate it should be possible for me to do something like: { "hostname": { "test": "value2" }, "default_attributes": { "hostname": { "test": "value3" } }, "override_attributes": { "hostname": { "test": "value4" } }, "default": { "hostname": { "test": "value5" } }, "run_list": [ "recipe[hostname::default]" ] } However, whenever I try to access the value in my recipe: p node['hostname']['test'] I just get the value