Cookbook Recipe : 5

 

Example5: Adding Multiple cookbooks to Node-1.


[root@chef-workstation recipes]# knife node list
Node-1
Node-2
[root@chef-workstation recipes]# knife node show Node-1
Node Name:   Node-1
Environment: _default
FQDN:        node1
IP:          192.168.2.133
Run List:
Roles:
Recipes:
Platform:    centos 7.9.2009
Tags:

[root@chef-workstation recipes]# knife node run_list add Node-1 "recipe[cookbook1]"
 Node-1:
  run_list: recipe[cookbook1]
[root@chef-workstation recipes]#  knife node show Node-1
Node Name:   Node-1
Environment: _default
FQDN:        node1
IP:          192.168.2.133
Run List:    recipe[cookbook1]
Roles:
Recipes:
Platform:    centos 7.9.2009
Tags:

[root@chef-workstation recipes]# knife node run_list add Node-1 "recipe[cookbook2]","recipe[cookbook3]"
Node-1:
  run_list:
    recipe[cookbook1]
    recipe[cookbook2]
    recipe[cookbook3]

[root@chef-workstation recipes]# knife node show Node-1
Node Name:   Node-1
Environment: _default
FQDN:        node1
IP:          192.168.2.133
Run List:    recipe[cookbook1], recipe[cookbook2], recipe[cookbook3]
Roles:
Recipes:
Platform:    centos 7.9.2009
Tags:
[root@chef-workstation recipes]#

Removing multiple cookbooks from Node-1:

[root@chef-workstation recipes]# knife node run_list remove Node-1 "recipe[cookbook1]","recipe[cookbook2]","recipe[cookbook3]"
Node-1:
  run_list:

[root@chef-workstation recipes]# knife node show Node-1
Node Name:   Node-1
Environment: _default
FQDN:        node1
IP:          192.168.2.133
Run List:
Roles:
Recipes:
Platform:    centos 7.9.2009
Tags:
[root@chef-workstation recipes]#

----------------------------End of Example5---------------------------------------

Cookbook Recipe : 6

Comments

Popular posts from this blog

To change the data directory location for PostgreSQL after installation

AWR

GIT