knife node run list add Node1 "role[webserver]" add actually "recipe[roles]"

335 views
Skip to first unread message

Gabriel Enache

unread,
Dec 4, 2015, 6:53:25 AM12/4/15
to learnchef-fundamentals-webinar
Hello guys,

I have a node named Node1.

As per Webinar3, i wanted to remove from node's run list recipe apache and add role[webserver]

Running the command as presented in the webinar, instead of adding role webserver to my runlist, the command added recipe[roles]. Below i'll present the output of running commands:

$ knife role from file webserver.json
Updated Role webserver!

$ knife node run list remove node1 "recipe[httpd]"
node1:
  run_list:
$ knife node run list add node1 "role[webserver]"
node11:
  run_list: recipe[roles]

$ knife node show node1
Node Name:   node1
Environment: test
FQDN:        node1.company.corp
IP:          10.10.10.109
Run List:    recipe[roles]
Roles:
Recipes:     httpd, httpd::default
Platform:    centos 6.7
Tags:

Any ideea why is this happening?

To overcome this problem, I've edited the node with

$ knife node edit node1

and the output of the 
$ knife node show node1
Node Name:   node1
Environment: test
FQDN:        node1.company.corp
IP:          10.10.10.109
Run List:    role[webserver]
Roles:       webserver
Recipes:     httpd, httpd::default
Platform:    centos 6.7
Tags:


Thank you,
Gabriel

Nathen Harvey

unread,
Dec 4, 2015, 7:05:12 AM12/4/15
to learnchef-fundamentals-webinar
Gabriel,

Try the workaround suggested by Elon in this post.

Let us know how that goes.

Thanks,
Nathen

Gabriel Enache

unread,
Dec 4, 2015, 7:23:15 AM12/4/15
to learnchef-fundamentals-webinar
Thank you, Nathen.

it is solved by escaping the quotes.

Gabriel

Nathen Harvey

unread,
Dec 4, 2015, 9:43:03 AM12/4/15
to learnchef-fundamentals-webinar
great, could you let me know what 'knife --version' returns? 
Reply all
Reply to author
Forward
Message has been deleted
Message has been deleted
0 new messages