Running Chef server 12.15 on RHEL7.3, using ChefDK on cygwin / Windows 7.
Going through Chef tutorial, I am trying to add a role named test-webserver
to a run_list for a server testserver
.
However, trying to add role[test-webserver]
to the run_list instead attempts to add a recipe named roles
to the runlist, even though roles
is not a defined recipe.
$ knife node run_list set testserver 'role[test-webserver]'
testserver:
run_list: recipe[roles]
There, I would expect run_list: role[test-webserver]
to show up instead of run_list: recipe[roles]
.
The test-webserver
role is defined role as below.
$ knife role show test-webserver
chef_type: role
default_attributes:
chef_client:
interval: 300
splay: 60
description: Web server role.
env_run_lists:
json_class: Chef::Role
name: test-webserver
override_attributes:
run_list:
recipe[chef-client::default]
recipe[chef-client::delete_validation]
recipe[learn_chef_httpd::default]
Running chef-client
on the testserver
causes an error because there is no cookbook called roles
.
[testserver ~]$ sudo chef-client
[2017-07-20T10:53:45+09:00] INFO: Forking chef instance to converge...
Starting Chef Client, version 13.2.20
[2017-07-20T10:53:45+09:00] INFO: *** Chef 13.2.20 ***
[2017-07-20T10:53:45+09:00] INFO: Platform: x86_64-linux
[2017-07-20T10:53:45+09:00] INFO: Chef-client pid: 48215
[2017-07-20T10:53:45+09:00] INFO: The plugin path /etc/chef/ohai/plugins does not exist. Skipping...
[2017-07-20T10:54:06+09:00] INFO: Run List is [recipe[roles]]
[2017-07-20T10:54:06+09:00] INFO: Run List expands to [roles]
[2017-07-20T10:54:06+09:00] INFO: Starting Chef Run for testserver
[2017-07-20T10:54:06+09:00] INFO: Running start handlers
[2017-07-20T10:54:06+09:00] INFO: Start handlers complete.
[2017-07-20T10:54:06+09:00] INFO: Error while reporting run start to Data Collector. URL: https://mychefserver.example.com/organizations/redacted/data-collector Exception: 404 -- 404 "Not Found" (This is normal if you do not have Chef Automate)
resolving cookbooks for run list: ["roles"]
================================================================================
Error Resolving Cookbooks for Run List:
================================================================================
Missing Cookbooks:
------------------
The following cookbooks are required by the client but don't exist on the server:
* roles
Expanded Run List:
------------------
* roles
System Info:
------------
chef_version=13.2.20
platform=redhat
platform_version=7.3
ruby=ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-linux]
program_name=chef-client worker: ppid=48210;start=10:53:45;
executable=/opt/chef/bin/chef-client
Running handlers:
[2017-07-20T10:54:07+09:00] ERROR: Running exception handlers
Running handlers complete
[2017-07-20T10:54:07+09:00] ERROR: Exception handlers complete
Chef Client failed. 0 resources updated in 21 seconds
[2017-07-20T10:54:07+09:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
[2017-07-20T10:54:07+09:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
[2017-07-20T10:54:07+09:00] ERROR: 412 "Precondition Failed"
[2017-07-20T10:54:07+09:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
Why is the role not being added to the run_list, and why is a non-existent roles
recipe being added instead?
How can I add the desired cookbooks, included in the test-webserver
role, to the target server testserver
?
Thanks