Software
- Visual Studio Code Download from here
Lab Environment
- Azure VM Creation Watch Here
- AWS EC2 Creation Watch Here
- Create atleast one Ubuntu VM either on AWS/Azure/any other means. Ensure the VM is connected to internet
How to enable communication between Chef Workstation and Chef Server
-
Chef-Repo:
- Is a directory on your workstation that stores everything required to communicate to the Chef Server
- It also has the definitions to create
- Cookbooks
- Databags
- Policyfiles
- Chef-repo also has security keys for verifying the connection
- Where do i get chef repo?
- Chef-repo DIrectory Structure
- .chef/ Directory in chef-repo will store validation files and whenever a starter kit is download a new validation file is generated. so its not a good idea to download starter kit multiple times
-
ChefDK:
- ChefDK has many software components which are installed on the workstation which can communicate with the server, but they need validation keys
- Example without validation keys
- Example with validation keys
How to enable communication between chef client node and chef server
- For this to happen, chef-client (agent) should be installed on the chef client nodes and this process of installing chef-client on client nodes is called as bootstrapping.
- knife is a commmand line tool which is installed as a part of chefdk and it can help in many things and bootstrap is one of them
- Lets learn how to use knife
cd <chef-repo>
knife --help
knife bootstrap --help
- Refer Here to build a bootstrap command
- For the machine with username and password
knife bootstrap <ipaddress> -x <username> -P <password> --sudo -N <nodename>
- For the machine with username and key
knife bootstrap <ipaddress> -x <username> -i <identityfile> --sudo -N <nodename>