Setup Chef Server on Microsoft Azure
This is the second post in the Chef and Microsoft Azure blog series. You can read the first blog in this series at https://manesh.me/2015/10/17/setup-chef-workstation-on-microsoft-azure/
In this blog, I am exploring how to setup a Chef Server on Microsoft Azure. For most part, I followed the steps suggested in https://docs.chef.io/azure_portal.html
Prerequisites
- Microsoft Azure Subscription
Setup Sequence
- Create Virtual Machine
- Set DNS Name Label for virtual machine
- Configure Chef Server
- Create Organization
- Establish Connectivity from Workstation
Create Virtual Machine
Navigate to https://portal.azure.com and login using your credentials.
Click New, then Compute, then Marketplace
Search for Chef Server, then select Chef Server 12, BYOL.
Note: Chef provides a fully functional Chef server that can be launched from the Azure Marketplace. This server is preconfigured with Chef Server, the Chef Management console, Chef reporting, and Chef Analytics. This configuration is free to use for deployments under 25 nodes, and can be licensed for deployments beyond 25 nodes.
Choose Resource Manager as the deployment model and click Create
Provide basic settings and click OK.
Click Size, then A5 Standard, then Select
Click Settings and then OK. Choose the default options, unless you want to change something.
Click Summary, review summary and click OK
Click Buy on left menu, review offer details and click Buy button
Wait for the newly created server to be in Running state.
Set DNS Name Label for virtual machine
Click Virtual machines, then mme-chef-server
Click on IP Address
Click on Settings, then Configuration
Update DNS name label and click Save
DNS name for the virtual machine in this case is ‘mme-chef-server.southcentralus.cloudapp.azure.com’. Wait for 5 minutes and check if you are able to ssh to the server using ‘ssh chefadmin@mme-chef-server.southcentralus.cloudapp.azure.com‘
Configure Chef Server
Open Git Bash and run the following commands.
# Here chefadmin is the admin user created during virtual machine creation.
# Provide DNS name label of the virtual machine ssh chefadmin@mme-chef-server.southcentralus.cloudapp.azure.com #sudo chef-setup -u <username> -p <password> -d <fqdn> #Here username is a new user, which will be created in this process. # You will use this username to connect form portal sudo chef-setup -u admin -p Demo@Pass1 –d mme-chef-server.southcentralus.cloudapp.azure.com |
Create Organization
Browse https://mme-chef-server.southcentralus.cloudapp.azure.com
Enter Username (specified during chef-setup), Password (specified during chef-setup) and click Sign In
Click Create New Organization
Provide Full Name, Short Name, then click Create Organization
Click on Administration, then Organizations, then contoso
Click Starter Kit, then Download Starter Kit
Click Proceed
Save chef-starter.zip locally. In my machine (Windows Laptop), it saved by default in the Downloads folder.
Establish Connectivity from Workstation
Copy the downloaded chef-starter.zip from local machine to Chef Workstation (I am copying it to workstation, I created as per the first blog in this series). I used the following command to copy the file from Git Bash. You might have to change according to your environment.
scp Downloads/chef-starter.zip azureuser@mme-chef-ws.cloudapp.net:/home/azureuser |
SSH into workstation
ssh azureuser@mme-chef-ws.cloudapp.net |
Execute following commands to get SSL keys and test connection to Chef Server
# move to home directory of azureuser
cd # install unzip utility sudo apt-get install unzip # unzip the starter kit unzip chef-starter.zip # move to chef-repo directory cd chef-repo # retrieve SSL keys from server knife ssl fetch # test connection to server, we should see contoso-validator knife client list |
Next Blog
Next, I will try out adding a Chef Node to the organization and running cookbooks.
Posted on 2015/10/19, in DevOps, Microsoft Azure and tagged Chef, Cloud, DevOps, Microsoft Azure, Ubuntu. Bookmark the permalink. 3 Comments.
Pingback: Setup Chef Node on Microsoft Azure | Imagine - Experiment - Realize
Pingback: Writing cookbook on Microsoft Azure | Imagine - Experiment - Realize
Pingback: Getting started with Chef on Microsoft Azure | Imagine - Experiment - Realize