FilBot3
FilBot3

Reputation: 3708

Chef Role not applying as a role but rather a recipe

After following the documentation from Opscode on how to upload and apply a Role to a chef-client, I received the Updated Role Zabbix_Proxy_Standalone! from my terminal. Then I attempted to apply the role to a node using:

`$ knife node run_list add MyServer.net 'role[Zabbix_Proxy_Standalone]'

run_list: [recipe[roles]]`

Then when I ran chef-client on the target node, I received an error telling me that the cookbook roles did not exist on the server.

I also tried using single quotes around the role part of the statement, or taking out the underscore between run and list, still no dice. What am I doing wrong?

Upvotes: 0

Views: 556

Answers (1)

Jared Russell
Jared Russell

Reputation: 11352

I've seen this happen before however I'm not sure why it interprets the role as a recipe. As a workaround you can manually edit the JSON definition for the node:

knife node edit MyServer.net

You then need to change the run_list attribute:

{
  ...
  "run_list": [
    "role[Zabbix_Proxy_Standalone]"
  ]
}

Note: you will need to set the EDITOR environment variable to your favourite text editor for this to work.

Upvotes: 1

Related Questions