AWS | Chef | Vagrant

AWS | Chef | Vagrant

AWS - Chef - Vagrant

Let's start with your journey on pull model Chef !!

How to create a server on aws cloud?

Instance = server

SSH = LInux to linux

HTTP = we can access web server from internet

1) Create an Aws account and login

2) Install git on your laptop

3) Create ec2 server( instance) on AWS

  1. After create aws account and login

  2. Choose Ec2 service

  3. Choose launch instance ( server)

  4. Choose instance count and name

  5. Choose Ubuntu Linux AMI, it just like OS

  6. Choose instance type as T2.micro , it has 1 core CPU and 1 Gb ram

  7. Choose pem file, it just like passwd

  8. Choose default network and Security Group as SSH and HTTP

  9. Choose EBS Volume same as Hard disk

  10. We can create a server on cloud

  11. Install git on your laptop

  12. Try getting into the cloud server by using git bash where we have a pem file in your laptop

  13. $ sudo -i

  14. # apt-get update

  15. # apt-get install apache2 -y

Install vagrant:

1) Install virtualBox on your laptop

2) Install git on your laptop

3) Install vagrant on your laptop

I want to create a VM by using vagrant:

1) Create a folder on your laptop

2) On folder , open git bash

3) Vagrant init ubuntu/trusty64

4) Vagrant up 

5) Vagrant ssh

**6) Vagrant destroy
**

VM

OS

Provision tool

**What is CM?
**

CHEF : PULL

For Setup Chef:

1) Workstation( your laptop)

2) Chef server( hosted or Install)

3) Chef Nodes( aws ec2 servers)

chef-repo>

knife bootstrap < public ip of aws server> --ssh-user <user name> --sudo --identity-file <aws server pem file location> -N <chef node name>

knife bootstrap 18.222.149.109 --ssh-user ubuntu --sudo --identity-file "C:\Users\Admin\Desktop\myOhiokey.pem" -N mychefnode0011

chef-repo\cookbook>

chef generate cookbook <cookbook name>

chef generate cookbook my1stcookbook

chef-repo\cookbook\my1scookbook>

berks install

berks upload