Setting up Nodes for Chef
- In the last session, we were able to install chef workstation & create an account in hosted chef server with starter kit downloaded.
- Now lets try to configure nodes.
- Lab Setup:
-
Creating a Ubuntu Node in AWS:
- Refer Here to create an ec2 instance in AWS
- EC2 instance created
- To login into this ec2 instance the command would be
ssh -i <path to pem> ubuntu@<publicip> - On this node we need to ensure
chef-clientwhich is agent to be installed. This process is called as bootstrapping - To bootstrap the node, when we install chef-workstation we get a application called as knife, we can use knife & starter kit to bootstrap the node
- cd into the chef-repo (extracted from starter kit)
- Refer Here for the knife bootstrap command
- Login into hosted chef
- Now lets try to build a command to bootstrap the node
knife bootstrap '34.209.212.75' --connection-user 'ubuntu' --ssh-identity-file '.\chefnode.pem' --sudo --node-name 'ip-172-31-23-112.us-west-2.compute.internal'- Lets observe the hosted chef management console
- Try form command line
knife node list
-
Create a Centos 7 vm in Azure:
- Refer Here for steps to create Azure VM
- The ssh command for this node is
ssh <username>@<ipaddress> - Now lets try to build the command to bootstrap the node
knife bootstrap '20.106.244.250' --connection-user 'qtdevops' --connection-password 'motherindia@123' --sudo --use-sudo-password --node-name 'qtchefnode2'- Management console
- Execute
knife node list
- Refer Here for steps to create Azure VM
-
- Exercise: Try to bootstrap any linux node using knife
