DevOps Classroom Series – 09/Apr/2020

Software

Lab Environment

Preview

  • 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? Preview

    Preview

    • Chef-repo DIrectory Structure Preview
    • .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 Preview
  • 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 Preview
    • Example with validation keys Preview

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. Preview
  • 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

Preview

  • 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>

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

About learningthoughtsadmin