Reputation: 750
Being new to Chef, I started a sample cookbook to create a file on a node. Below is the code in my default.rb file
file 'home/ubuntu/sample.txt' do
content 'this is test content'
mode '0755'
end
I uploaded the cookbook to the server please find the screenshot below:
I also added the cookbook to the runlist under the specific node. When I try to knife bootstrap the node I get a warning saying the runlist is empty. I am not able to figure out what is missing. Below is the bootstrap command I am using
sudo knife bootstrap xx.xx.xx.xx --ssh-user ubuntu -i /home/ubuntu/keys/keyname.pem --sudo --use-sudo-password <password> -N testnodelatest
OUTPUT on executing above command:
Starting the first Chef Client run...
54.40.1.69 Starting Chef Client, version 12.18.31
54.40.1.69 resolving cookbooks for run list: []
54.40.1.69 Synchronizing Cookbooks:
54.40.1.69 Installing Cookbook Gems:
54.40.1.69 Compiling Cookbooks...
54.40.1.69 [2017-02-14T01:36:22-05:00] WARN: Node testnodelatest has an empty run list.
54.40.1.69 Converging 0 resources
54.40.1.69
54.40.1.69 Running handlers:
54.40.1.69 Running handlers complete
54.40.1.69 Chef Client finished, 0/0 resources updated in 01 seconds
Upvotes: 2
Views: 3396
Reputation: 37630
Your knife bootstrap
command does not specify a run list (-r
). As this kicks off the Chef run, this is used as run list for this very first run.
I find it a bit weird that you already added a run list "under the specific node" (in your Chef Server, I assume?). If the node is already registered at the Chef server, then just don't use the bootstrap
command. Instead, simply run chef-client
on the node.
Upvotes: 3