How do i create a chef role using the knife command?



  • Note: It's important to note that this only create an empty shell of a JSON file on the chef server, a role has to have recipes that it execute and other information, before it does anything useful.

    The role logical grouping of functions in the infrastructure. For example a web server, database server, etc can be considered roles. They will share a set of recipes and configuration data.

    To create role in chef using the knife command, run the following:

    $ knife role create -d webserver        
    Created role[webserver]
    

    Check the role has been created.

    $ knife role list
    webserver
    

    Note: It's important to note that this only create an empty shell of a JSON file, a role has to have recipes that it execute and other information, before it does anything useful.


Log in to reply
 

© Lightnetics 2024