Creating a role
Once all cookbooks have been uploaded successfully, we need to create a role. A role is defined for a specific function and provides a path for different patterns and workflow processes.
For example, the web server role can consist of Tomcat server recipes and any custom attributes:
Go to Policy| Roles | Create to create a role. In the Create Role window, provide a Name and Description and then click on Next, as shown in the following screenshot:
A Run List keeps roles/recipes in a proper manner and order. We can say that it describes the specifications of a node. Select tomcat from the Available Recipes section, drag it to the Current Run List section, and click on Create Role:
Verify the newly added role details in the hosted Chef dashboard:
Now, we are ready to associate the role while converging the node. Add the role to the node with
knife node run_list add tomcatserver"role[v-tomcat]"
:[root@devops1 chef-repo]# knife node run_list add tomcatserver"role[v-tomcat]"...